-
Notifications
You must be signed in to change notification settings - Fork 124
Add ability to skip tests #221
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
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
|
8543e24
to
5bcde55
Compare
I need to figure out why CI is not showing the The
The
|
6795d06
to
9e66712
Compare
If you prefer to play with it in follow up (bugfix), I'm good with it! |
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.
Minors only and a general comment about the Skip section, but nothing blocking I believe.
@@ -107,6 +107,16 @@ func (r *runner) run() ([]testrunner.TestResult, error) { | |||
} | |||
tr.Name = tc.name | |||
|
|||
if tc.config.Skip != nil { |
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.
I think I have a general concern, but I'm sure if it can be solved. I'm worried that one day we'll add a new test runner, in which we'll forget to add the "Skip" config section. Maybe we should limit this to minimum. Do we need a skip check for assets tests (same for install)?
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.
This is a good point. Maybe this goes well with your other suggestion of a commonTestConfig
. Let me try something and update this PR.
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.
In 4e25215, I introduced a SkippableConfig
struct that could be embedded in any test config structs that allow skipping. This doesn't necessarily address the concern you are bringing up (a future test runner forgetting to include the skip config section) but I think it can help make it a bit easier to add a skip config section to a future test runner. I think to truly address your concern a larger refactor might be needed which would allow a higher-level generic test runner of some sort to handle skipping before delegating the actual running of a test to specific types of test runners.
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.
I think to truly address your concern a larger refactor might be needed which would allow a higher-level generic test runner of some sort to handle skipping before delegating the actual running of a test to specific types of test runners.
... and we may think about such refactoring exercise soon, as we have a better clarity of what do we expect from test runners and what kind of tests we need. Definitely we can postpone it at the moment.
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.
Agreed. Added #238 to track the refactoring.
@mtojek This PR is now failing CI with an unrelated error: https://beats-ci.elastic.co/blue/organizations/jenkins/Ingest-manager%2Felastic-package/detail/PR-221/20/pipeline#step-122-log-693. The same / similar error is occurring on I would suggest that you review this PR for the latest changes but let's not merge it even when it passes review. I think we need to take care of the error on |
I believe the CI error I mentioned in my previous comment will be resolved once we have a new Kibana 7.11 Docker image. Related: elastic/kibana#89644. |
jenkins, run the tests please |
@@ -107,6 +107,16 @@ func (r *runner) run() ([]testrunner.TestResult, error) { | |||
} | |||
tr.Name = tc.name | |||
|
|||
if tc.config.Skip != nil { |
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.
I think to truly address your concern a larger refactor might be needed which would allow a higher-level generic test runner of some sort to handle skipping before delegating the actual running of a test to specific types of test runners.
... and we may think about such refactoring exercise soon, as we have a better clarity of what do we expect from test runners and what kind of tests we need. Definitely we can postpone it at the moment.
@@ -1,3 +1,6 @@ | |||
skip: | |||
reason: testing skip | |||
link: https://github.com/elastic/integrations/issues/123456789 | |||
vars: ~ | |||
data_stream: | |||
vars: |
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.
I assume that this test will fail if it runs, that's why it's skipped = PASS
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.
This used to be a test that used to pass before I added the skip. I think you are suggesting that I should make it fail, so we have a way to know something is not working correctly if the skip logic in the test runner breaks? I like that idea, and can implement it — just want to make sure that's what you are suggesting here first. 🙂
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.
Yes, that's point :) I think the quick way is to introduce some faulty variables? Don't have to implement anything special. But I wouldn't say it's blocking comment. For me this PR is ready to be merged.
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.
Thanks for confirming, I will make this change now. Should be fairly quick to test.
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.
I'm going to do a series of 3 commits to test this change:
- A commit that comments out the
skip
section, effectively re-enabling theapache.error
system test. With this commit the test should pass: 322c835. - A commit that breaks the test. With this commit the test should fail: cec86cf.
- A commit that adds back the
skip
section. With this commit the test should be skipped: 0fbf9ad.
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!
This PR adds the ability for package developers to skip tests.
TODO
skip
struct from various test runners.Related: #218.