Skip to content
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

Re-use the same launches when using jest --shard #121

Open
snitin315 opened this issue Jan 10, 2023 · 3 comments
Open

Re-use the same launches when using jest --shard #121

snitin315 opened this issue Jan 10, 2023 · 3 comments

Comments

@snitin315
Copy link

Jest recently introduced--shard option to fasten up tests on CLI.

This option breaks a single run into multiple runs as shown in the image below:

Screenshot 2023-01-10 at 10 43 00 AM

All of these 4 runs are actually part of a single test run on CI and hence same launch ID should be used for all of the individual shard runs.

However, the current behavior is that the package creates 4 different launches and hence 4 different reports on the report portal. Which disturbs the final graph on the report portal.

@burhanuday
Copy link

There isn't an easy way to do this but here's what my team has been doing:

  1. Create a launch id using @reportportal/client-javascript
  2. Write the launch id to a file and upload it to S3 (or any object storage) with the commit id (or head commit id in case of PR) as the filename
  3. In each shard, download the file from S3 and read it to get the launch id
  4. After all the shards are done running, in another job you can download the launch id and then close the launch

@snitin315
Copy link
Author

I believe this issue is also related #58

@burhanuday
Copy link

alternatively, upload-artifact action could be used in place of S3

as for #58, this functionality does exist but its not documented. You can pass launchId: string in the @reportportal/agent-js-jest config in the jest.config.js file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants