(@wdio/cli): Support for sharding#11441
Conversation
| const { total, current } = config.shard | ||
| if (total > 1) { | ||
| log.info(`No specs to execute in shard ${current}/${total}, exiting!`) | ||
| return resolve(0) |
There was a problem hiding this comment.
If we exit with code 1 when there are no tests, I would expect the same here
There was a problem hiding this comment.
For sharding, this would be not desireable. For example: let's say a user has a CI setup that by defaults uses 10 workers and calls wdio always with --shard 1/10 ... --shard 10/10. Now let's say we have 100 test files and provide a dynamic parameter like --spec="SOME_PATTERN" which can resolves in 9 test files. In this case just because the dynamic spec parameter causes let's files to be selected than for what sharding is set up for should not cause the worker to break.
There was a problem hiding this comment.
Interesting, I had not thought of it like that.
I'm assuming that the No specs found to run, exiting with failure with exit code 1 is still preferable but just to be just, I want to verify if this could also be resolved with an exit code of 0 then or if we actually want to fail here.
Since this is a question and it is not blocking, I'll resolve and approve 👍
There was a problem hiding this comment.
Thanks Erwin!
Yes, the other case is desired because, e.g. someone has a typo in the spec pattern causing WebdriverIO no match no files. They would run it in CI not checking the logs and would be happy they always get green builds while in reality nothing gets tested. This is a case where we do want to fail the runner to make folks aware of that.
erwinheitzman
left a comment
There was a problem hiding this comment.
Omg I really love this, clean code, well done on this Christian. Just one comment on the exit code 👍
erwinheitzman
left a comment
There was a problem hiding this comment.
There's one merge conflict that needs to be resolved but other than that this LGTM 👍
| const { total, current } = config.shard | ||
| if (total > 1) { | ||
| log.info(`No specs to execute in shard ${current}/${total}, exiting!`) | ||
| return resolve(0) |
There was a problem hiding this comment.
Interesting, I had not thought of it like that.
I'm assuming that the No specs found to run, exiting with failure with exit code 1 is still preferable but just to be just, I want to verify if this could also be resolved with an exit code of 0 then or if we actually want to fail here.
Since this is a question and it is not blocking, I'll resolve and approve 👍
|
@christian-bromann, was debugging an issue inside Please note that it's happening for few test cases, mostly skipped ones. |
Which value?
What information? |
|
|
These information should be still accessible. Can you please point out which service or reporter hook used to have this information? |
|
We are extending The info isn't available for certain cases, |
|
Please create a separate issue for this. Any contributions are welcome! |
|
@christian-bromann Sure, what was the reason of removing these keys from WDIO_DEFAULTS? |
|
These are testrunner specific defaults and should not be a concern for the |
Proposed changes
implements #11243
Types of changes
Checklist
Further comments
I will extend the docs once the feature is released with an example how to use sharding with Github Action.
Reviewers: @webdriverio/project-committers