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

support predictive test selection with test runner #54173

Open
soryy708 opened this issue Aug 1, 2024 · 2 comments
Open

support predictive test selection with test runner #54173

soryy708 opened this issue Aug 1, 2024 · 2 comments
Labels
feature request Issues that request new features to be added to Node.js. never-stale Mark issue so that it is never considered stale stale test_runner Issues and PRs related to the test runner subsystem.

Comments

@soryy708
Copy link

soryy708 commented Aug 1, 2024

What is the problem this feature will solve?

Very large projects that have a lot of tests take a very long time to run the full tests suite.
Running all of the tests can be avoided, by doing Predictive Test Selection to select only a subset of tests to run.
This enables speeding up the Continuous Integration turnaround time for users using Test Runner.

What is the feature you are proposing to solve the problem?

Some interface, whether programmatic API or CLI, to do predictive test selection.
If we look at Jest as an example (of a popular testing framework), they have:
--onlyChanged and --changedSince, which analyze the (transitive) source code dependencies of the tests and of the changes in Git/Hg, to select only tests that have a source dependency on the changes.

What alternatives have you considered?

Not sure we'll want to lock in users to Git/Hg, some may want to use a different version control solution, so perhaps the integration with the specific source control can be left up to the community. What Node needs IMO is some interface for such library author to use.

@soryy708 soryy708 added the feature request Issues that request new features to be added to Node.js. label Aug 1, 2024
@github-project-automation github-project-automation bot moved this to Awaiting Triage in Node.js feature requests Aug 1, 2024
@MoLow
Copy link
Member

MoLow commented Aug 2, 2024

this sounds feasible using the run API from node:test, first analyzing what files need to run, then calling run
perhaps this could be experimented in user land before we add it to core.
I might try implementing in the future if I have the time

@MoLow MoLow added the test_runner Issues and PRs related to the test runner subsystem. label Aug 2, 2024
Copy link
Contributor

There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Mark issue so that it is never considered stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Jan 30, 2025
@pmarchini pmarchini added the never-stale Mark issue so that it is never considered stale label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. never-stale Mark issue so that it is never considered stale stale test_runner Issues and PRs related to the test runner subsystem.
Projects
Status: Awaiting Triage
Development

No branches or pull requests

3 participants