mirror of
https://github.com/tester-army/e2e.git
synced 2026-12-03 04:45:58 +08:00
* feat(runner): start the tests a change is likeliest to break first A test filter can score the tests it keeps: `relevance` in its result maps test ids to a number from 0 to 1. With `--changed-since`, each target starts the files of the likeliest tests first, in bands at 75%, 50%, and 25%, and the target with the likeliest file goes first. Inside a band the longest-first order from the previous run still decides, with more than one worker. `decisionFilter()` scores every test it hands back: 1 for a test whose file, setup file, or stored screenshots changed, the model's answer for one it judged, and 0.5 for one it did not. It requires e2e 0.23.1 or newer, since an older runner refuses the unknown `relevance` key and drops the whole filter. The run prints `ranked N of M tests by relevance, likeliest first` when the scores change the order. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * test(runner): write the failing fixture as a constant, not built from a parameter CodeQL flagged `failingFile(title)` for putting `JSON.stringify` output into generated code. Only `gamma` used it, so the file is a constant now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs(runner): say how targets, bands, and the ranking line are decided Review of #1589 found the docs looser than the code: targets go by the band of their best file, not its exact score, with ties in config order; a rating the model did not give counts as 50% and the test takes the higher of its two ratings; the bands are half-open; the ranking line follows when the scores put tests in more than one band; and a filter that returns no scores leaves the order alone. One test title said an empty target goes last, but it keeps its place. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs(runner): score known areas on the fallback path and name files, not tests The areas example now scores the tests whose area a change reaches even when another changed file maps to no area, keeping the no-exclusion fallback. The README, docs, and skill say the run starts the files of the likeliest tests, ordered by relevance band with collection order breaking ties on one worker. The timings test makes beta and gamma wait for each other before they sleep, so a slow second worker cannot start alpha ahead of gamma. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(runner): keep the scores of a filter that fails A filter that threw left every test unscored, so a run with no AI Gateway key (a pull request from a fork) or a model outage fell back to collection order and lost the one thing the decision filter knows without the model: which tests the change touches. The error a filter throws may now carry `relevance`. The runner checks it the way it checks a result's, merges it by the highest score, and still warns, leaves nothing out, and records `outcome: failed`. Scores that fail the check are dropped, and the note says why. A call past its deadline is abandoned, and nothing it throws is read. decisionFilter() puts the scores the change alone gives (1 for a test the change touches, 0.5 for the rest) on the error it throws, as a property that is not enumerable, so printing the error does not list every test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * docs(runner): point the ordering prose at the timings history The timings history (#1639) replaced the previous report as where file durations come from, so the prose that says what orders files inside a relevance band now names it: the filters guide, the `workers` bullet in the config reference, the CI guide, the skill's running reference, and the wording of the integration test that pins the one-worker gate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>