Skip to content

feature: allow custom comparator for parallelRuns #2965

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

Closed
erezrokah opened this issue Feb 9, 2022 · 3 comments · Fixed by #2968
Closed

feature: allow custom comparator for parallelRuns #2965

erezrokah opened this issue Feb 9, 2022 · 3 comments · Fixed by #2968
Assignees

Comments

@erezrokah
Copy link
Contributor

Please provide details about:

  • What you're trying to do

    Follow up to RFC: Parallelizing across machines in CI #1811. Better load balance test files across multiple CI machines

  • Why you can't use AVA for this

    Ava sorts files by file name, which is not the best load balancing strategy, especially when some tests are slower than others.

  • And maybe how you think AVA could handle this

    Allow setting a custom comparator to be used here:

    ava/lib/api.js

    Line 180 in 3131ccd

    selectedFiles = selectedFiles.sort((a, b) => a.localeCompare(b, [], {numeric: true}));

Alternatives:
Ensure number of tests per file is low enough via a lint rule.

More context:
netlify/cli#4178

@novemberborn
Copy link
Member

What would you think about being able to configure the comparator function in an ava.config.js file?

@erezrokah
Copy link
Contributor Author

erezrokah commented Feb 10, 2022

What would you think about being able to configure the comparator function in an ava.config.js file?

That would be great and will solve our use case 💯

Are you open for me to contribute this change or prefer someone else to do it?

@novemberborn
Copy link
Member

All yours @erezrokah! Let me know if you have questions.

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

Successfully merging a pull request may close this issue.

2 participants