-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support skip-tests option to skip some specific tests in alpha or beta features #184
Conversation
Codecov Report
@@ Coverage Diff @@
## master #184 +/- ##
==========================================
+ Coverage 94.45% 94.49% +0.04%
==========================================
Files 34 35 +1
Lines 685 690 +5
==========================================
+ Hits 647 652 +5
Misses 27 27
Partials 11 11
Continue to review full report at Codecov.
|
/lgtm I'll add this requirement to my over-arching conformance improvements issue: knative/pkg#1563 Also |
test/conformance/ingress/run.go
Outdated
delete(alphaTests, name) | ||
delete(betaTests, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to create a set of skipped test names and invoke t.Skip()
so you get some output that a test was skipped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is nice idea but t.Skip()
calls against "root" test 😢. So It outputs SKIP: TestIngressConformance
even though each conformance test outputs PASS
like this:
--- SKIP: TestIngressConformance (0.00s)
--- PASS: TestIngressConformance/headers/tags (8.02s)
--- PASS: TestIngressConformance/headers/tags/matching_tag_header (1.29s)
--- PASS: TestIngressConformance/headers/tags/no_tag_header (0.32s)
--- PASS: TestIngressConformance/headers/tags/empty_tag_header (0.12s)
--- PASS: TestIngressConformance/headers/tags/non-matching_tag_header (0.11s)
It is strange... So I think we should avoid to call t.Skip
in run.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could artificially call skip on the subtest - ie.
if test.ServingFlags.EnableAlphaFeatures {
for name, test := range alphaTests {
if skipTest(name) {
t.Run(name, func(t *t.testing.T) { t.Skip() }
continue
}
t.Run(name, test)
}
}
Would that give the desired output we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every test calls test.Setup(t)
, doesn't it? How about putting it in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Updated. The current result shows like this:
=== RUN TestIngressConformance/host-rewrite
TestIngressConformance/host-rewrite: run.go:107: Skipping the test in skip-test flag
...
--- PASS: TestIngressConformance (0.00s)
--- SKIP: TestIngressConformance/host-rewrite (0.00s)
--- PASS: TestIngressConformance/headers/tags (15.67s)
--- PASS: TestIngressConformance/headers/tags/matching_tag_header (0.61s)
--- PASS: TestIngressConformance/headers/tags/no_tag_header (0.11s)
--- PASS: TestIngressConformance/headers/tags/empty_tag_header (0.10s)
--- PASS: TestIngressConformance/headers/tags/non-matching_tag_header (0.21s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coryrc Thank you. But Setup
is a function to setup test client. I feel it is a little bit weird that we put the Skip
logic there. Let's go on Dave's suggestion.
/hold @davetropeano Thank you for the review! |
/lgtm leaving for others to review & unhold |
It seems fine, albeit a bit convoluted and disappointing we can't rely on the standard Go constructs to do this. |
I opened an issue - golang/go#41583 - give it some emojis ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nak3, tcnghia The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Currently Alpha or Beta conformance tests must be implemented when we enabled the flag.
This patch allows users to skip one or some specific tests in alpha or beta features.
Fixes #183