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

Ava parallel is missing the first chunk #2521

Closed
MathieuPuech opened this issue Jun 18, 2020 · 3 comments
Closed

Ava parallel is missing the first chunk #2521

MathieuPuech opened this issue Jun 18, 2020 · 3 comments

Comments

@MathieuPuech
Copy link

I try to use parallel CI job with GitLab CI, the first index in GitLab CI is 1.

the currentIndex is 1 for the first chunk and chunkd starts with 0.

It should be:

selectedFiles = chunkd(selectedFiles, currentIndex - 1, totalRuns); 

ava/lib/api.js

Line 141 in 1222ce9

selectedFiles = chunkd(selectedFiles, currentIndex, totalRuns);

And in the reporter, it should be currentIndex instead of currentIndex + 1

this.reportStream.write(`# Ran ${currentFileCount} test ${plur('file', currentFileCount)} out of ${this.stats.files} for job ${currentIndex + 1} of ${totalRuns}` + os.EOL + os.EOL);

Maybe on other CI, the first index is 0?

@MathieuPuech
Copy link
Author

MathieuPuech commented Jun 18, 2020

it seems that in circle ci, it's starting from 0 and in gitlab ci from 1. I suppose the issue is in https://www.npmjs.com/package/ci-parallel-vars

It seems that only GitLab is starting from 1 instead of 0.

@MathieuPuech
Copy link
Author

it was fixed in ci-parallel-vars@1.0.1, no need to do anything more here

@novemberborn
Copy link
Member

it was fixed in ci-parallel-vars@1.0.1, no need to do anything more here

Thanks for digging into this @MathieuPuech. We'll make that the minimal version in the next AVA release.

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

No branches or pull requests

2 participants