Skip to content

Find the tests to run for modified paths at the pushed revision - #7524

Draft
marco-c wants to merge 1 commit into
mozilla:masterfrom
marco-c:find-tests-at-revision
Draft

marco-c wants to merge 1 commit into
mozilla:masterfrom
marco-c:find-tests-at-revision

Conversation

@marco-c

@marco-c marco-c commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes #5854.

find_manifests_for_paths and find_tasks_for_paths used the files in the working directory, which the HTTP service doesn't update to the pushed revisions anymore (462d916), so tests and manifests added by a push were missed.

Instead of updating the working directory, they now take the revision and read the files at that revision with Mercurial:

  • The first time, the files are listed with hg files -r REV. The files of later revisions are computed from the ones of the previous revision and hg status --rev PREV --rev REV, and only the test manifests changed in between are read (hg cat -T json) and parsed again.
  • The worker parses the manifests at tip when booting, before forking for each job, so jobs only need to handle the changes since then.
  • The HTTP service passes the head of the push.

Tested on a mozilla-central clone: the selected manifests and tasks were identical to the ones found in an updated working directory for 350 sampled paths. On my (slow, WSL) machine, booting took ~16-19s and a job on a revision 300 commits after the boot one ~7-10s, nearly all spent in hg status/hg cat.

In the tests, the files are committed and the working directory is emptied before each call, to check that nothing is read from it.

The manifests and tasks selected for the modified paths were found in the
working directory, which is not updated to the pushed revisions as it is
too slow, so new tests and manifests were missed.

Read the files at the head of the push with Mercurial instead: the files
of a revision are computed from the ones of the previous revision and
the files changed between the two, and only the changed test manifests
are parsed again. The manifests at tip are parsed when booting the
worker, before it forks for each job.

Fixes mozilla#5854

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Improve the way to handle new tests

1 participant