diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6cc1e0a8f..d7cfd5a956 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,10 +91,11 @@ jobs: # The test row runs in four shards on four runners (#3050). On one runner the suite took 355 s # to 528 s for the same tests, depending on the speed of the runner that GitHub gave: more than # the 300 s of AGENTS.md rule 5, and growing with the suite. Each shard runs a quarter of the - # tests with `pytest-split`, keeps its coverage data, and checks no floor, since it measures a - # part of the tree. The job `Tests & Coverage` below joins the data and checks the floor. The - # matrix lists the shards and `strategy.job-total` gives their number, so a fifth shard is one - # more entry. The shard jobs are no required check: ADR 0004 binds the ruleset to the aggregate. + # tests, keeps its coverage data, and checks no floor, since it measures a part of the tree. It + # passes the paths of its own test files to pytest, so no worker collects the whole suite (#2371). + # The job `Tests & Coverage` below joins the data and checks the floor. The matrix lists the + # shards and `strategy.job-total` gives their number, so a fifth shard is one more entry. The + # shard jobs are no required check: ADR 0004 binds the ruleset to the aggregate. # # A pull request that only adds a plan under openspec/changes/-/ changes no line the # suite tests, so shard 1 runs tests/invariants, which read the change folders, and no shard diff --git a/docs/SDLC.md b/docs/SDLC.md index e964490889..bd228869a1 100644 --- a/docs/SDLC.md +++ b/docs/SDLC.md @@ -214,7 +214,7 @@ CI is the authoritative gate ([ADR 0004](adr/0004-ci-is-the-authoritative-gate.m 14. `openspec`: Runs `devops openspec check`, the OpenSpec gate: `openspec validate --all --strict` and `--archived`, a regeneration of the committed skills under the isolated profile compared with the tree, the instructions of a probe change with nothing on standard error, and a check that no requirement is rewritten by two active changes. It needs Node and the pinned `openspec` (`uv run devops install-tools --tool openspec --only-missing`), runs in every `devops ci` and in the `static` job with no path filter and no exemption, and runs alone in a commit hook when a commit touches `openspec/` or the generated skills ([ADR 0010](adr/0010-openspec-is-the-spec-and-change-proposal-layer.md)). #### The Test Shards (`ci.yml`, `test-shard` and `test`) -The suite has about 18,000 tests, and on one runner it took 355 s to 528 s, depending on the speed of the runner that GitHub gave. AGENTS.md rule 5 sets the bound at 300 s. The test row therefore runs in four shards on four runners, the jobs `Tests & Coverage (shard of 4)`. Each runs `uv run devops ci --check --no-cache --only test --shard --shards 4`, which gives one quarter of the tests to `pytest-split`. A shard checks no coverage floor, since it measures a part of the tree. It uploads its coverage data as an artifact. +The suite has about 18,000 tests, and on one runner it took 355 s to 528 s, depending on the speed of the runner that GitHub gave. AGENTS.md rule 5 sets the bound at 300 s. The test row therefore runs in four shards on four runners, the jobs `Tests & Coverage (shard of 4)`. Each runs `uv run devops ci --check --no-cache --only test --shard --shards 4`, which passes the paths of about one quarter of the test files to pytest, so a shard collects only its own files. A shard checks no coverage floor, since it measures a part of the tree. It uploads its coverage data as an artifact. The required check `Tests & Coverage` is the job that waits for the shards. It fails when a shard did not succeed, because a skipped job would pass a required check. It downloads the data, runs `coverage combine` and `coverage report`, which applies `fail_under` of `pyproject.toml` to the whole tree, and then runs the step `Changed-Line Coverage`. The ruleset binds to this job, never to a shard ([ADR 0004](adr/0004-ci-is-the-authoritative-gate.md)). To add a shard, add a number to the matrix `shard` of `test-shard`: the name, `--shards` and the split follow the count. diff --git a/docs/TESTING.md b/docs/TESTING.md index 3e4930cdc5..954b97c574 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -164,8 +164,9 @@ Every new test follows these rules. Some of them name a path, fixture or check t ### Run time - The `Tests & Coverage` check must average under 300 s (AGENTS.md, rule 5). `devops ci job-time` reads the time of the check in the last 20 completed pushes to `main` from the Actions API and fails when their mean is over the limit. The time of a run is the time from the first start of a shard job `Tests & Coverage (shard of )` to the end of the job `Tests & Coverage`, which joins the shards, so the short join does not hide the wait. It counts a job that passed, failed or timed out, whatever the run concluded, so a slow run that failed, and a run that this check turned red, stay in the mean. The `Test Job Duration` job of `ci.yml` runs it after every push to `main` and every day. A pull request cannot show the mean, so the check reads the history of `main`, not the pull request. -- The same suite took 355 s on a fast runner and 528 s on a slow one (2026-11-04), so no cut of constant work holds the bound on every runner. The test row runs in four shards, one quarter of the tests on each runner (`devops ci --only test --shard --shards 4`, split by `pytest-split`). When `Test Job Duration` nears the bound, add a number to the matrix of the job `test-shard`. A test must not depend on a test that runs before it in the same process, since a shard holds only some of the tests. +- The same suite took 355 s on a fast runner and 528 s on a slow one (2026-11-04), so no cut of constant work holds the bound on every runner. The test row runs in four shards, one quarter of the tests on each runner (`devops ci --only test --shard --shards 4`, split by lines of test code). When `Test Job Duration` nears the bound, add a number to the matrix of the job `test-shard`. A test must not depend on a test that runs before it in the same process, since a shard holds only some of the tests. - A shard measures a part of the tree, so it checks no coverage floor and prints no report. The job `Tests & Coverage` combines the coverage data of the shards and checks `fail_under` on the whole. +- A shard collects only its own test files. Pytest collects every file it gets, in every xdist worker. A split plugin that deselects tests after collection makes each worker collect the whole suite. That cost 31.8 s of CPU in each of 16 workers, which is 13.5% of the CPU of a run (2026-11-05, 16-CPU host, 19,074 tests). Now `devops ci --shard --shards ` passes the paths of the test modules of the shard to pytest. The split is by lines of test code, heaviest file first, and it stores no data. A new test module joins a shard with no other step. A quarter of the files collects in about two thirds of the CPU time of the whole suite, not a quarter. The imports of shared modules stay. In the same run, worker start was 2.8% of the CPU and the controller was 1.4%. A preload fixture gave no saving. A test must not depend on a test of another file, because a shard holds only some of the files. For the same reason a `conftest.py` below `tests/` imports no devops-cli module at its top: a run that names a file below its directory loads it before the root conftest isolates HOME, and devops-cli binds its paths under HOME when it is first imported. - An autouse fixture runs before each of the 14,000 tests, so it does no work that most tests do not need. A fixture that loads settings, opens a database or lists a directory belongs to the tests that ask for it. A numbered directory made for every test, such as `tmp_path_factory.mktemp("run")`, is slow: pytest lists every entry of the base directory to find the next number. - `tmp_path_retention_policy = "failed"` in `pyproject.toml` deletes the directory of a test that passed, so the base directory stays small. A later test can therefore get the path of an earlier one. A cache that is keyed by a path and holds the content of a file is wrong in such a run: key it by the content. - The root conftest raises the young threshold of the garbage collector to `GC_YOUNG_THRESHOLD`. The default made the collector a tenth of the run time. A test that needs the collector calls `gc.collect()`. diff --git a/openspec/changes/2371-measure-and-cut-what-each-of/design.md b/openspec/changes/2371-measure-and-cut-what-each-of/design.md deleted file mode 100644 index a989223129..0000000000 --- a/openspec/changes/2371-measure-and-cut-what-each-of/design.md +++ /dev/null @@ -1,24 +0,0 @@ -# Design - -## Decisions - -- **Measure first, then pick the lever.**: The issue asks for the change with the largest measured share, so the plan does not name the lever before the numbers exist. Group 1 measures. Group 2 picks from the table below. Group 3 applies one row. -- **Measure CPU time, not wall time.**: The shell `time` of the controller counts the user and system time of its worker children. Wall time moved from 3 m 28 s to 6 m 27 s on one suite when the host was loaded (#2356). CPU time moves less. -- **Measure a plain run, `uv run pytest`.**: The coverage cost is the work of #2373. A plain run keeps this change apart from it. `--cov` stays out of both the before and the after runs. -- **Run the measurement with plain `uv run pytest`.**: Tasks 1.1 and 1.3 are measurement runs and not verification. `devops ci test` cannot load a scratch plugin, so these runs use the plain pytest command with the same `addopts`. The verify step of 1.1 reads the output file. Verification runs in the other groups use `uv run devops ci test`. -- **Keep the measuring plugin out of git.**: It is a scratch file of about 40 lines. Nothing in the repository reads it. A committed plugin would be a tool to keep for one measurement. -- **Stop when no candidate can reach 5%.**: AGENTS.md rule 2 says to write no compensating code when the premise fails. If the numbers of group 1 show that no row of the table can lower the CPU time of a full run by 5%, group 2 stops. The implementer then returns the item to New with the figures: `uv run devops roadmap return 2371 --comment "" --confirm`. - -## Candidates - -| Candidate | Files it changes | Evidence now | Share to compute | -| :--- | :--- | :--- | :--- | -| Fewer workers than CPUs on the 4-CPU runner (`-n 3`, `-n 2`) | `.github/workflows/ci.yml` or `pyproject.toml` (`addopts`), and the pin in `tests/commands/test_test_selection.py` when `addopts` changes | Each worker collects the whole suite in about 19 s of CPU time, so N workers spend N times that. | CPU time of one collection times the workers removed, against the total CPU time. The wall time of the job must not rise. | -| Shorter collection | `tests/conftest.py`, `tests/support/`, or the top-level imports of the test modules | The profile of one collection spends the most self time in `_matchfactories` and `process_argname`, which build the fixture closure of 15,801 tests. Imports are about 3 s of 19 s. | CPU time of one collection saved, times the number of workers. | -| Preload fixture for the heavy modules | none | Rejected. `pydantic_ai`, `anthropic`, `kubernetes` and `textual` are in `sys.modules` after collection. A fixture moves an import and cannot lower the total CPU time. | none | - -## Rejected alternatives - -- **A session fixture that imports `pydantic_ai`, `anthropic`, `kubernetes` and `textual`.**: The collection of every worker already imports them (see Feasibility in `proposal.md`). The fixture is a no-op for them. For a module that is not in `sys.modules` after collection, the fixture adds the import to every worker, also to a worker that would never import it. The issue says it itself: a test that carries the import cost moves it to the next test when the test goes. -- **A spec delta on `ci-job-time`.**: That capability is the command `devops ci job-time`. A change to the test suite alters nothing that command does. -- **A new test for the chosen change.**: The change is a setting or a refactor of the test suite with no new behavior. Its check is the CPU time of three runs and the green suite. diff --git a/openspec/changes/2371-measure-and-cut-what-each-of/proposal.md b/openspec/changes/2371-measure-and-cut-what-each-of/proposal.md deleted file mode 100644 index 0202032311..0000000000 --- a/openspec/changes/2371-measure-and-cut-what-each-of/proposal.md +++ /dev/null @@ -1,49 +0,0 @@ -# Proposal - -## Why - -Issue #2371 asks for two things. First, measure what each of the xdist workers repeats before and between its tests. Second, remove the largest share of that work. A full run on 16 workers took 287 s on 2026-10-27, and its tests added up to 151 s of that. The issue says the other 136 s is worker start, collection that each worker repeats, the tail of the longest tests and the coverage report. - -Those figures are old. The suite now has 15,801 tests, not 11,285, and #2764 cut other repeated work after the measurement. The change measures again before it picks a lever. - -## What Changes - -- The change measures one full run on an idle host three times, and splits the CPU time of each worker into start, collection and busy time. -- The change ranks the heavy modules that a test body imports for the first time. -- The change applies the one candidate that removes the largest share of CPU time, and measures three runs again. -- The change adds no module that does not already exist, and no product code. -- The change alters no behavior that a consumer observes: it is a change to the test suite and to its settings. So it carries no spec delta and sets `skip_specs: true` in `.openspec.yaml`. -- The change fits one pull request. -- The coverage report is out of scope. Issue #2373 owns it. The startup-import tests are out of scope. Issue #2369 owns them. - -## Acceptance - -- Criterion 1, three-run CPU split per worker: group 1. -- Criterion 2, ranked list of first imports: group 1. -- Criterion 3, the change with the largest share, and the reason: groups 2 and 3. -- Criterion 4, at least 5% less CPU time in a full run on an idle host: group 3. -- Criterion 5, the median of `Tests & Coverage` does not rise: group 1 records the median before. Pending a person: the median after the merge, because only runs of `main` show it (see Workflow follow-up in `tasks.md`). - -## Impact - -- Files that group 3 can change, by candidate: `pyproject.toml`, `.github/workflows/ci.yml`, `tests/conftest.py`, `tests/support/`, or the top-level imports of the test modules. `design.md` lists the candidates. -- Existing code and tests that must stay green: `tests/commands/test_test_selection.py` pins the `addopts` and the pytest command of the `test` gate. `tests/invariants/test_hermetic_floor.py` pins the hermetic floor, so a fixture of the floor stays. `tests/support/check_test_settings.py` checks the timeout settings and the conftest environment. `tests/support/typer_commands.py` and the garbage collector threshold in `tests/conftest.py` are earlier cuts of repeated work (#1725, #2764): keep them. -- The scratch plugin that measures is not committed. It lives in `.data/agent/scratch/`. - -## Feasibility - -All commands ran on 2026-11-01 in a worktree of `origin/main` (1c20865a) on a 16-CPU host. The host was not idle (see the last item), so the numbers below show the mechanism and not the final figures. - -- The suite size changed. `uv run pytest --collect-only -q -n 0 tests` printed `15756/15801 tests collected (45 deselected) in 28.62s`. The issue says 11,282 tests and 9 s. -- The premise "a test body pays the first import of the heavy libraries" is false for the four libraries that the first plan named. A script that runs the collection and then lists `sys.modules` printed `pydantic_ai True`, `anthropic True`, `kubernetes True` and `textual True` after collection and before any test. `git grep -lE "^(import|from) (pydantic_ai|anthropic|kubernetes|textual)\b" -- tests` lists 43 test modules, so every worker imports them while it collects. The libraries `google.genai`, `openai`, `agentops`, `litellm` and `libtmux` were not in `sys.modules` after collection. Group 1 finds out whether a test body imports them. -- A fixture that imports a module once per worker cannot lower the total CPU time. The worker imports the module once in both cases. It only moves the cost to another place. So the preload fixture cannot meet criterion 4. `design.md` rejects it with this evidence. -- Collection is repeated work. A worker collects the whole suite. In one process, `python -I -X importtime` over the collection printed `collect wall 19.0 cpu 19.0` and `cProfile` printed `41.084 seconds` with profile overhead. In that profile, `_pytest/fixtures.py:2155(_matchfactories)` had 853,589 calls and `process_argname` 1,564,991 calls. `grep -c "autouse" tests/conftest.py` prints 29. Imports are about 3 s of the 19 s (`importtime` self times, sum 2.7 s). So the cost of collection is mostly in building the fixture closure of 15,801 tests, and not in imports. -- Nothing newer removed the work. `git log origin/main` shows #2764 (`perf(ci): cut test job time and guard its mean`), which cut the cache build, the garbage collector, the shutdown polls and the Typer command build. It touched none of collection, the worker count or the first imports. Issue #2809 (`fix(k8s): bound the test workers`, commit 2314ef98) sets `PYTEST_XDIST_AUTO_NUM_WORKERS=2` in the runner pod (`k8s/devops/cronjob-runner.yaml:72`). A Job that implements this plan therefore runs 2 workers on 2 CPUs. It cannot measure the split of 16 workers. Task 1.3 stops in that case and names it as an open point. The open issues #2369 (startup-import tests) and #2373 (coverage cost) are separate work. -- The worker setting is `addopts = "-n logical --dist worksteal ..."` at `pyproject.toml:199`. The `Tests & Coverage` job runs `uv run devops ci --check --no-cache --only test` (`.github/workflows/ci.yml:146`) and so uses `-n logical` on the 4-CPU runner. -- The method works. A scratch plugin with the hooks `pytest_sessionstart`, `pytest_collection_finish`, `pytest_runtest_logstart` and `pytest_runtest_logreport` wrote one line for each of four workers: `{"worker": "gw2", "collection_wall_s": 0.15, "start_to_first_test_wall_s": 0.28, "busy_s": 1.81, "cpu_total_s": 2.02}`. The shell `time` of the controller counts the CPU time of the workers: `real 15.874s user 38.393s sys 3.931s`. -- The runner baseline moved. `uv run devops ci job-time` printed `the last 10 runs of Tests & Coverage took 376 s on average, and the limit is 300 s`. The issue says a median of 291 s. Criterion 5 therefore compares with the median that group 1 records now, and not with 291 s. -- The host is not idle. `uptime` printed `load average: 14.51, 23.42, 23.29` and, later, `5.36, 17.92, 21.34`. Criterion 1 needs a load under 2 before each run. Group 1 waits for that load, and the pull request stays a draft when the host never reaches it. - -## Existing Tool Considered - -`pytest-xdist` is in use and has the options `-n` and `--maxprocesses`. `pytest --durations=0` and `pytest -v` give the seconds and the worker of each test. `python -X importtime` lists the cost of each import. `cProfile` from the standard library shows where a collection spends its time. The shell `time` gives user and system CPU time of a process and its children. The plugin hooks of pytest give the start, collection and busy time of a worker, in a scratch file of about 40 lines that is not committed. The change builds no tool. The change deletes no internal code. diff --git a/openspec/changes/2371-measure-and-cut-what-each-of/tasks.md b/openspec/changes/2371-measure-and-cut-what-each-of/tasks.md deleted file mode 100644 index 3e1ce96278..0000000000 --- a/openspec/changes/2371-measure-and-cut-what-each-of/tasks.md +++ /dev/null @@ -1,31 +0,0 @@ -# Tasks - -## 1. Measure the split, and rank the first imports - -Reads: `pyproject.toml` (`addopts`, line 199), `tests/commands/test_cli_startup_imports.py` (`CONST_CLI_HEAVY_MODULES`, lines 19 to 32). Changes: scratch files in `.data/agent/scratch/` only. No file under git changes in this group. - -- [ ] 1.1 Verify the method on a small selection. Write a scratch plugin `.data/agent/scratch/workersplit.py` with the hooks `pytest_sessionstart`, `pytest_collection_finish`, `pytest_runtest_logstart`, `pytest_runtest_logreport` and `pytest_sessionfinish`. For each xdist worker it appends one JSON line with the CPU time at the start of the session (`time.process_time()`, which counts the start of the interpreter and the imports before it), the time of the collection, the time to the first test, the busy time and the CPU time in total. A second hook records, after each test, the heavy modules that are new in `sys.modules` and the CPU time of that test. Run `PYTHONPATH=.data/agent/scratch WORKERSPLIT_OUT=.data/agent/scratch/split.jsonl uv run pytest -p workersplit -n 4 -q tests/watchers`, and verify that `split.jsonl` holds four lines, one for each worker -- [ ] 1.2 Record the baseline of the runner. Run `uv run devops ci job-time` and write the mean and the median of `Tests & Coverage` of the last ten runs in the notes file `.data/agent/scratch/2371-measurement.md` -- [ ] 1.3 Run the full suite three times on an idle host. Before each run, wait until the first load average in `uptime` is under 2 and write the `uptime` line in the notes file. Run `bash -c 'time uv run pytest -p workersplit'` with the scratch plugin. Write the `user` plus `sys` time of each run, and the lines of `split.jsonl` of each run, in the notes file. The result is the split of criterion 1. The split of 16 workers needs a host with 16 CPUs. If the host has fewer CPUs, or if the run is in a runner pod where `PYTEST_XDIST_AUTO_NUM_WORKERS=2` sets 2 workers (#2809), stop, leave the pull request a draft and name this task as the open point. If the load stays over 2, stop in the same way -- [ ] 1.4 Rank the first imports. From the heavy-module records of the three runs, list the modules that a test body imports for the first time, with the CPU time of the test that imported each one. For each of the top five, run `uv run python -X importtime -c 'import '` and write its import time in seconds. Write the ranked list in the notes file. The result is the list of criterion 2 - -## 2. Choose the change with the largest share - -Reads: the notes file of group 1, `design.md` (table of candidates). Changes: the notes file. - -- [ ] 2.1 For each row of the table in `design.md` except the rejected one, compute the CPU time it can remove from the figures of group 1, as the formula of its last column gives. Write the share of each row in the notes file, and the row with the largest share. If no row reaches 5% of the total CPU time, follow the stop rule in `design.md` and do not go on to group 3. Verify that the notes file names one row and gives its figures -- [ ] 2.2 Verify the choice against the existing code. For the chosen row, list in the notes file the tests that pin its files (`uv run devops ci test tests/commands/test_test_selection.py tests/invariants/test_hermetic_floor.py`) and run them on the unchanged tree. Verify that they pass - -## 3. Apply the chosen change and measure again - -Reads: the files of the chosen row in `design.md`. `tests/conftest.py` is about 47 KB, so read only the fixtures that the numbers name. Changes: the files of the chosen row, and `docs/TESTING.md`. The chosen row changes at most 5 files under git, not counting `docs/TESTING.md`. If it needs more, stop. Do not go on. Return the item for a split with the figures of group 2: `uv run devops roadmap return 2371 --comment "" --confirm`. - -- [ ] 3.1 Apply the chosen row in its files. Change the pin in `tests/commands/test_test_selection.py` in the same commit when the change alters `addopts`. Verify that `uv run devops ci test tests/commands/test_test_selection.py tests/invariants/test_hermetic_floor.py` passes, and that `uv run devops ci test-settings` passes (it checks `tests/support/check_test_settings.py`) -- [ ] 3.2 Run the full suite three times on an idle host with the command of task 1.3. Write the `user` plus `sys` time of each run in the notes file, and the change against the baseline. Verify that the mean CPU time is at least 5% lower than in group 1. If it is not, follow the stop rule in `design.md` -- [ ] 3.3 Verify that the full suite passes as the CI job runs it: `uv run devops ci --check --no-cache --only test`. Verify that `uv run devops ci test-settings` passes -- [ ] 3.4 Write the result in the `Run time` part of `docs/TESTING.md` and in the comment above the setting that the change touches: the lever, the CPU time before and after, and the date. Verify that `uv run devops docs generate --sync-readme` leaves no diff and that `uv run devops ci docs` passes -- [ ] 3.5 Put the notes of the three groups in the body of the pull request: the split of each worker for the three runs, the ranked first imports, the lever and the reason why it has the largest share, and the CPU time before and after. Verify that the body holds each of the five criteria of the issue with its figure - -## Workflow follow-up - -- Pending a person: after the merge, read `uv run devops ci job-time` once ten runs of `main` have the change. The median of `Tests & Coverage` must not be above the median that task 1.2 recorded. diff --git a/openspec/changes/2371-measure-and-cut-what-each-of/.openspec.yaml b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/.openspec.yaml similarity index 70% rename from openspec/changes/2371-measure-and-cut-what-each-of/.openspec.yaml rename to openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/.openspec.yaml index 5849f5c860..25002a8e81 100644 --- a/openspec/changes/2371-measure-and-cut-what-each-of/.openspec.yaml +++ b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/.openspec.yaml @@ -1,3 +1,2 @@ schema: spec-driven created: 2026-11-01 -skip_specs: true diff --git a/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/design.md b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/design.md new file mode 100644 index 0000000000..2cd330d7a5 --- /dev/null +++ b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/design.md @@ -0,0 +1,21 @@ +# Design + +## Decisions + +- **Pass file paths to pytest.**: Pytest collects only the files it gets. No worker imports a test module of another shard, and no plugin is needed. +- **Deal by lines of test code, heaviest file first.**: Each module goes to the shard with the fewest lines so far. A tie goes to the lower shard number. The split reads only the tree, so each runner computes the same lists from the same checkout, and no stored file can go out of date. A new test module joins a shard with no other step. +- **Reuse `_directory_modules("tests", root)`.**: It gives the same 830 files that pytest collects, and it is the function that `devops ci test` already uses to expand a directory. +- **Keep the coverage options.**: A shard keeps `--cov=src`, `--cov-report=`, `--cov-fail-under=0` and `--snapshot-warn-unused`. The snapshots of the other shards are unused in a shard. +- **Remove `pytest-split`.**: Nothing else uses it. +- **The unsharded row is unchanged.**: With `--shards` at 1 the row passes no path, and pytest takes `testpaths` as before. + +## Balance + +At 4a2d958e the split by lines gave 4,834, 5,181, 4,971 and 4,528 tests per shard. The largest is 6.2% above the mean. A split by file size gave 14.4%, so it is not used. A split by test count is exact but needs a collection or a stored file. The old split dealt single tests, so its shards were equal in count. If the shard times spread too far after this change, a follow-up item can add a stored per-file duration file. That is out of scope here. + +## Rejected alternatives + +- **A preload fixture for heavy modules, and fewer workers.**: Worker start is 2.8% of the CPU and a preload fixture gives 0%. Fewer workers raise the wall time (issue comment of 2026-11-05). +- **`pytest-test-groups`, `pytest-shard`, `--dist loadfile`, a `pytest_ignore_collect` plugin.**: See "Existing Tool Considered" in `proposal.md`. +- **A split by file size.**: 14.4% imbalance, against 6.2% for lines. +- **A stored duration file.**: It can go out of date, and the balance by lines is enough for now. diff --git a/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/proposal.md b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/proposal.md new file mode 100644 index 0000000000..9019137b0b --- /dev/null +++ b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/proposal.md @@ -0,0 +1,53 @@ +# Proposal + +## Why + +Issue #2371 asks to cut the work that each xdist worker repeats. The test row runs in four shards, and each shard runs `-n logical` workers, 16 in all. `pytest-split` picks the tests of a shard in `pytest_collection_modifyitems`, after collection. So each of the 16 workers collects the whole suite (19,514 tests in 830 files) and then drops three quarters of it. + +One full run on a 16-CPU host (2026-11-05, 19,074 tests) spent 31.8 s of CPU in the collection of each worker. Over 16 workers that is 508.9 s, which is 13.5% of the 3,769.5 s of CPU of the run. Worker start was 2.8% of the CPU, and a preload fixture gave 0%. So the first plan of this change, a preload fixture, cannot be built, and the largest repeated cost is collection. + +## What Changes + +- `devops ci --shard --shards ` passes the paths of the test modules of its own shard to pytest, so a worker collects no file of another shard. +- A function in `src/devops_cli/commands/ci.py` deals the test modules to the shards, heaviest file first (by lines), to the shard with the fewest lines so far. A tie goes to the lower shard. It stores no data. +- The test row no longer passes `--splits`, `--group` and `--splitting-algorithm`. +- `pytest-split` is removed from `pyproject.toml` and `uv.lock`. +- The spec `ci-test-shards` changes through a delta: one MODIFIED and one ADDED requirement. The command is observable, so the change carries a delta. +- `docs/TESTING.md`, `docs/SDLC.md` and the comment of the `test-shard` job in `ci.yml` stop naming `pytest-split` as the tool that splits the shards. +- The change fits one pull request and depends on no other item. +- The coverage report (#2373) and the startup-import tests (#2369) are out of scope. + +## Acceptance + +- Partition, same split everywhere, and the command: tests in `tests/commands/test_ci_shard.py`, groups 1 and 2. +- Same tests as before, shorter collection, lower CPU, shard time and runner time: measured and recorded in a comment of the pull request, as the issue lists. See "Workflow follow-up" in `tasks.md`. +- `pytest-split` is gone from `pyproject.toml` and `uv.lock`, and `openspec validate` passes: group 3. + +## Impact + +- Code: `src/devops_cli/commands/ci.py` (`_resolve_pytest_cmd`, new `_shard_test_files`). +- Tests: `tests/commands/test_ci_shard.py`. +- Dependencies: `pyproject.toml`, `uv.lock`. +- Documents and workflow comment: `docs/TESTING.md`, `docs/SDLC.md`, `.github/workflows/ci.yml`. +- Spec: `openspec/specs/ci-test-shards/spec.md`, through the delta in this folder. + +## Feasibility + +Checked on 2026-11-06 at `origin/main` ffaea530, and against the measurements of the issue (origin/main 4a2d958e). + +- `pytest-split` 0.11.0 selects after collection. `pytest_split/plugin.py` defines `pytest_collection_modifyitems` with `@hookimpl(trylast=True)`, printed with `inspect.getsource` from the locked environment. A worker has collected every file by then. +- The files that pytest collects and the files that `_directory_modules("tests", root)` returns are the same set: the symmetric difference is empty (issue, 2026-11-06). +- A quarter of the files collects in 19.1 s of CPU against 29.0 s for the whole suite (66%; 12 runs of a quarter, 3 of the whole, pinned with `taskset -c 0-3`, loaded host). So the saving is about 158 s of CPU in a run, which is about 4%, and 10 s to 15 s of wall time in each shard. +- Split by lines gave 4,834, 5,181, 4,971 and 4,528 tests per shard, the largest 6.2% above the mean. A split by file size gave 14.4%. +- The earlier plan of this folder (a preload fixture and a measurement of worker start) is false: `pydantic_ai`, `anthropic`, `kubernetes` and `textual` are in `sys.modules` after collection, and a fixture moves an import and cannot lower the total CPU time. The issue of 2026-11-05 measured worker start at 2.8% of the CPU. +- The CI speed on the runner cannot be tested on this host. The pull request measures it, as the acceptance criteria say. + +## Existing Tool Considered + +- **`pytest`** takes file paths as arguments and then collects only those files. This open tool does the work. +- **`pytest-split` 0.11.0** is in use. It selects after collection and has no file-level option. This change removes it. +- **`pytest-xdist`** stays (`-n logical --dist worksteal`). `--dist loadfile` and `loadgroup` change how collected tests go to workers, and every worker still collects all tests. +- **`pytest-test-groups` and `pytest-shard`** are rejected: the first runs a subset of the collected tests by its README (the source was not read), and the second splits by test case only. +- **A `pytest_ignore_collect` hook** also skips files before collection, but it needs a conftest plugin and a `--shard` option. A list of paths does the same with no plugin. +- Cost if built: about 30,000 tokens to build, about 2,000 tokens a year to keep, and about half a day elapsed. The new function is about 25 lines and replaces a dependency, so the net code is small. +- Internal code deleted: the three split options in `_resolve_pytest_cmd`, and the `pytest-split` dependency. diff --git a/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/specs/ci-test-shards/spec.md b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/specs/ci-test-shards/spec.md new file mode 100644 index 0000000000..42eb6672d5 --- /dev/null +++ b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/specs/ci-test-shards/spec.md @@ -0,0 +1,33 @@ +## MODIFIED Requirements + +### Requirement: The test row runs one shard of the suite +The command `devops ci` SHALL take the options `--shard ` and `--shards `, whole numbers of at least 1 that default to 1. With `--shards` above 1, the command of the `test` row SHALL hold `--cov=src` and the paths of the test modules of shard ``. It SHALL hold none of `--splits`, `--group` and `--splitting-algorithm`. With `--shards` at 1, the command SHALL be that of an unsharded run. + +#### Scenario: Shard two of four +- **WHEN** the user runs `devops ci --dry-run --only test --shard 2 --shards 4` +- **THEN** the planned command holds the paths of the test modules of shard 2 and holds none of `--splits`, `--group` and `--splitting-algorithm` + +#### Scenario: No shard +- **WHEN** the user runs `devops ci --dry-run --only test` +- **THEN** the planned command holds none of `--splits`, `--group` and `--cov-fail-under=0`, and holds `--cov-report=term-missing` + +#### Scenario: A shard above the total +- **WHEN** the user runs `devops ci --only test --shard 5 --shards 4` +- **THEN** the command exits 2 and starts no check + +## ADDED Requirements + +### Requirement: Each shard collects only its own test files +The shards SHALL partition the test modules of `tests/`: each module SHALL be in exactly one shard, and no shard SHALL be empty. The split SHALL be the same in every call. It SHALL be computed from the files of the checkout alone, with no stored input. + +#### Scenario: Four shards cover every test module once +- **WHEN** the module lists of shards 1 to 4 of 4 are built for the tree +- **THEN** every test module of `tests/` is in exactly one list, and no list is empty + +#### Scenario: The split is the same in every call +- **WHEN** the module list of a shard is built twice, in any order of the shards +- **THEN** the two lists are equal + +#### Scenario: The split has no stored input +- **WHEN** the modules of a tree are dealt to two shards +- **THEN** the lists come from the line counts of the files alone, the heaviest file going first to the shard with the fewest lines so far diff --git a/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/tasks.md b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/tasks.md new file mode 100644 index 0000000000..ea96d1d713 --- /dev/null +++ b/openspec/changes/archive/2026-11-06-2371-measure-and-cut-what-each-of/tasks.md @@ -0,0 +1,24 @@ +# Tasks + +## 1. The tests of the shard split (behavior) + +- [x] 1.1 In `tests/commands/test_ci_shard.py`, add tests that fail on the old code: the shards 1 to N cover every test module of `tests/` once for N of 2, 3 and 4 with no empty list; two calls give the same lists in any order of asking; the split deals the heaviest file first to the lightest shard; the planned command of shard 2 of 4 holds its paths and none of `--splits`, `--group` and `--splitting-algorithm`; the unsharded row holds no path. + Verification: `uv run devops ci test tests/commands/test_ci_shard.py` + +## 2. The test row passes the files of its shard (behavior) + +- [x] 2.1 Add `_shard_test_files` to `src/devops_cli/commands/ci.py`, and end the command of a sharded `test` row with its result. Drop `--splits`, `--group` and `--splitting-algorithm`, and fix the docstring of `_resolve_pytest_cmd`. + Verification: `uv run devops ci test tests/commands/test_ci_shard.py tests/commands/test_test_selection.py` + +## 3. Remove `pytest-split`, and fix the documents (dependency, documents, workflow) + +- [x] 3.1 Remove `pytest-split` from `pyproject.toml`, run `uv lock`, and fix the text in `.github/workflows/ci.yml`, `docs/SDLC.md` and `docs/TESTING.md`, which gets the paragraph on collection. + Verification: `! git grep -il pytest-split -- . ':!openspec/changes/archive' ':!openspec/changes/2371-measure-and-cut-what-each-of' ':!openspec/changes/archive'` +- [x] 3.2 Check the spec delta and the other changes. + Verification: `uv run devops openspec check` + +## Workflow follow-up + +- Pending a person: the pull request comment records the measurements of the issue: the test counts of the four lists against the whole suite (criterion 4), the CPU time of `pytest --collect-only -q -n 0 -p no:cacheprovider` for one list against the whole suite (criterion 5, at most 75%), the summed CPU of the four shard commands (criterion 6), and the durations of the four `Tests & Coverage Quality Gate` steps of one run (criterion 6a, the slowest at most 15% above the mean). +- Pending a person: after the merge, compare `uv run devops ci job-time` with the mean recorded just before the merge (criterion 7), and record both on #2371. +- Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD). diff --git a/openspec/specs/ci-test-shards/spec.md b/openspec/specs/ci-test-shards/spec.md index 1aa30337fa..e6142888f2 100644 --- a/openspec/specs/ci-test-shards/spec.md +++ b/openspec/specs/ci-test-shards/spec.md @@ -6,11 +6,11 @@ How `devops ci` runs one part of the test row, and how `ci.yml` splits the test ## Requirements ### Requirement: The test row runs one shard of the suite -The command `devops ci` SHALL take the options `--shard ` and `--shards `, whole numbers of at least 1 that default to 1. With `--shards` above 1, the command of the `test` row SHALL hold `--splits `, `--group `, `--splitting-algorithm least_duration` and `--cov=src`. With `--shards` at 1, the command SHALL be that of an unsharded run. +The command `devops ci` SHALL take the options `--shard ` and `--shards `, whole numbers of at least 1 that default to 1. With `--shards` above 1, the command of the `test` row SHALL hold `--cov=src` and the paths of the test modules of shard ``. It SHALL hold none of `--splits`, `--group` and `--splitting-algorithm`. With `--shards` at 1, the command SHALL be that of an unsharded run. #### Scenario: Shard two of four - **WHEN** the user runs `devops ci --dry-run --only test --shard 2 --shards 4` -- **THEN** the planned command holds `--splits 4`, `--group 2` and `--splitting-algorithm least_duration` +- **THEN** the planned command holds the paths of the test modules of shard 2 and holds none of `--splits`, `--group` and `--splitting-algorithm` #### Scenario: No shard - **WHEN** the user runs `devops ci --dry-run --only test` @@ -69,3 +69,18 @@ When the join check `Tests & Coverage` and a shard check `Tests & Coverage (shar #### Scenario: A shard and the join fail - **WHEN** the join check and one shard check are failed checks of the pull request - **THEN** the watch reports the shard check, and the fix step reads the log of that shard + +### Requirement: Each shard collects only its own test files +The shards SHALL partition the test modules of `tests/`: each module SHALL be in exactly one shard, and no shard SHALL be empty. The split SHALL be the same in every call. It SHALL be computed from the files of the checkout alone, with no stored input. + +#### Scenario: Four shards cover every test module once +- **WHEN** the module lists of shards 1 to 4 of 4 are built for the tree +- **THEN** every test module of `tests/` is in exactly one list, and no list is empty + +#### Scenario: The split is the same in every call +- **WHEN** the module list of a shard is built twice, in any order of the shards +- **THEN** the two lists are equal + +#### Scenario: The split has no stored input +- **WHEN** the modules of a tree are dealt to two shards +- **THEN** the lists come from the line counts of the files alone, the heaviest file going first to the shard with the fewest lines so far diff --git a/pyproject.toml b/pyproject.toml index d5febd92eb..d6bf068d0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,6 @@ dev = [ "pytest-cov==7.1.0", "diff-cover==10.6.0", "pytest-xdist==3.8.0", - "pytest-split==0.11.0", "pytest-randomly==5.0.0", "pytest-timeout==2.4.0", "bandit==1.9.4", diff --git a/src/devops_cli/commands/ci.py b/src/devops_cli/commands/ci.py index ac3caa1834..0d9fa6a24b 100644 --- a/src/devops_cli/commands/ci.py +++ b/src/devops_cli/commands/ci.py @@ -650,12 +650,12 @@ def _resolve_pytest_cmd(*, shard: int = 1, shards: int = 1) -> list[str]: The row prints the term report and writes no XML report: only CI's changed-line coverage step reads `coverage.xml`, and it writes the file from the combined data (#1743). - With `shards` above 1 the row runs the part `shard` of the suite (#3050). `pytest-split` - deals the tests one after the other to the group with the fewest tests so far - (`least_duration` with no stored durations), so the heavy tests of a directory spread over the - shards. A shard measures a part of the tree: it checks no floor and prints no report, and the - job that combines the data of every shard does both. A shard also warns on, and does not fail - on, an unused snapshot: the snapshots of the tests in the other shards are unused in it. + With `shards` above 1 the row runs the part `shard` of the suite (#3050). It passes the paths + of the test files of that part to pytest, so pytest collects no file of another shard: a plugin + that deselects after collection makes every xdist worker collect the whole suite (#2371). A + shard measures a part of the tree: it checks no floor and prints no report, and the job that + combines the data of every shard does both. A shard also warns on, and does not fail on, an + unused snapshot: the snapshots of the tests in the other shards are unused in it. """ cmd = [ "uv", @@ -671,15 +671,35 @@ def _resolve_pytest_cmd(*, shard: int = 1, shards: int = 1) -> list[str]: "--cov-report=", "--cov-fail-under=0", "--snapshot-warn-unused", - "--splits", - str(shards), - "--group", - str(shard), - "--splitting-algorithm", - "least_duration", + *_shard_test_files(shard, shards, _get_project_root()), ] +def _shard_test_files(shard: int, shards: int, root: Path) -> list[str]: + """The sorted repo-relative paths of the test modules of shard `shard` of `shards` (#2371). + + The modules go one by one, heaviest first (most lines, then path), to the shard with the fewest + lines so far, and a tie goes to the lower shard. The split reads only the tree, so every runner + computes the same lists and no stored data can go out of date. + """ + + def line_count(module: str) -> int: + with (root / module).open("rb") as handle: + return sum(1 for _ in handle) + + weighted = sorted( + ((line_count(module), module) for module in _directory_modules("tests", root)), + key=lambda item: (-item[0], item[1]), + ) + weights = [0] * shards + parts: list[list[str]] = [[] for _ in range(shards)] + for lines, module in weighted: + lightest = weights.index(min(weights)) + weights[lightest] += lines + parts[lightest].append(module) + return sorted(parts[shard - 1]) + + def _with_test_shard(specs: Sequence[CheckSpec], *, shard: int, shards: int) -> list[CheckSpec]: """The rows `specs`, with the command of the `test` row set to run its part of the suite.""" return [ diff --git a/tests/commands/test_ci_shard.py b/tests/commands/test_ci_shard.py index 7737a6edfb..edf0d48670 100644 --- a/tests/commands/test_ci_shard.py +++ b/tests/commands/test_ci_shard.py @@ -1,22 +1,34 @@ """Tests for `devops ci --shard` and `--shards`: the test row runs one part of the suite (#3050). The `Tests & Coverage` job of CI runs the test row in shards on separate runners, so each shard -takes a part of the suite with `pytest-split`, and a job that waits for all of them joins their -coverage data and checks the floor. A shard measures a part of the tree, so it checks no floor. +takes the test files of one part of the suite, and a job that waits for all of them joins their +coverage data and checks the floor. A shard measures a part of the tree, so it checks no floor. A +shard passes the paths of its own files to pytest, so it collects no file of another shard (#2371). """ from __future__ import annotations +from pathlib import Path from typing import Any import pytest from typer.testing import CliRunner from devops_cli.commands import ci as ci_module -from devops_cli.commands.ci import CheckResult, _resolve_pytest_cmd, app, get_check_specs +from devops_cli.commands.ci import ( + CheckResult, + _directory_modules, + _resolve_pytest_cmd, + _shard_test_files, + app, + get_check_specs, +) +from tests.support.paths import REPO_ROOT runner = CliRunner() +_SPLIT_OPTIONS = ("--splits", "--group", "--splitting-algorithm") + def _said(output: str) -> str: """The output with the line breaks of the terminal width taken out.""" @@ -42,47 +54,85 @@ def test_one_shard_of_one_is_the_unsharded_row() -> None: assert _resolve_pytest_cmd(shard=1, shards=1) == _resolve_pytest_cmd() -def test_a_shard_splits_the_suite_and_checks_no_floor() -> None: - """Shard 2 of 4 runs its quarter of the tests, keeps the coverage data, prints no report and +def test_a_shard_runs_its_own_test_files_and_checks_no_floor() -> None: + """Shard 2 of 4 runs the files of its quarter, keeps the coverage data, prints no report and leaves the floor to the job that combines the data of all shards. The snapshots of the other shards are unused in this one, and syrupy would fail the run on them.""" cmd = _resolve_pytest_cmd(shard=2, shards=4) + own_files = _shard_test_files(2, 4, REPO_ROOT) assert ( - cmd[cmd.index("--splits") + 1], - cmd[cmd.index("--group") + 1], - cmd[cmd.index("--splitting-algorithm") + 1], + cmd[-len(own_files) :], + [option in cmd for option in _SPLIT_OPTIONS], "--cov=src" in cmd, "--cov-fail-under=0" in cmd, "--cov-report=" in cmd, "--cov-report=term-missing" in cmd, "--snapshot-warn-unused" in cmd, - ) == ("4", "2", "least_duration", True, True, True, False, True) + ) == (own_files, [False, False, False], True, True, True, False, True) + + +@pytest.mark.parametrize("shards", [2, 3, 4]) +def test_the_shards_cover_every_test_module_once(shards: int) -> None: + """Each test module is in exactly one shard, and no shard is empty.""" + every_module = _directory_modules("tests", REPO_ROOT) + lists = [_shard_test_files(shard, shards, REPO_ROOT) for shard in range(1, shards + 1)] + + assert ( + sorted(module for files in lists for module in files), + all(lists), + ) == (every_module, True) + + +def test_the_split_is_the_same_in_every_call_and_in_any_order_of_asking() -> None: + """Every runner computes its own shard, so the split must not depend on the call: two calls + give one list, and asking for shard 4 first changes no list.""" + first = [_shard_test_files(shard, 4, REPO_ROOT) for shard in (1, 2, 3, 4)] + reversed_order = {shard: _shard_test_files(shard, 4, REPO_ROOT) for shard in (4, 3, 2, 1)} + + assert first == [reversed_order[shard] for shard in (1, 2, 3, 4)] -def test_the_dry_run_of_a_shard_lists_its_split_and_starts_nothing() -> None: - """The planned command of `--only test --shard 2 --shards 4` holds the split options.""" +def test_the_split_deals_the_heaviest_file_to_the_lightest_shard(tmp_path: Path) -> None: + """Files go heaviest first to the shard with the fewest lines so far, and a tie goes to the + lower shard. Lines of the files stand for the cost, so no stored data can go out of date.""" + tests = tmp_path / "tests" + tests.mkdir() + for name, lines in {"test_a.py": 5, "test_b.py": 4, "test_c.py": 3, "test_d.py": 3}.items(): + (tests / name).write_text("x = 1\n" * lines) + (tests / "helper.py").write_text("x = 1\n" * 99) + + assert [_shard_test_files(shard, 2, tmp_path) for shard in (1, 2)] == [ + ["tests/test_a.py", "tests/test_d.py"], + ["tests/test_b.py", "tests/test_c.py"], + ] + + +def test_the_dry_run_of_a_shard_lists_its_files_and_starts_nothing() -> None: + """The planned command of `--only test --shard 2 --shards 4` holds the files of shard 2 and + none of the split options of the old plugin.""" result = runner.invoke(app, ["--dry-run", "--only", "test", "--shard", "2", "--shards", "4"]) said = _said(result.output) + own_files = _shard_test_files(2, 4, REPO_ROOT) assert ( result.exit_code, - "--splits 4" in said, - "--group 2" in said, - "--splitting-algorithm least_duration" in said, - ) == (0, True, True, True) + all(path in said for path in own_files), + any(option in said for option in _SPLIT_OPTIONS), + ) == (0, True, False) def test_the_dry_run_of_an_unsharded_run_lists_no_split() -> None: - """Without the options the planned command holds none of the split options.""" + """Without the options the planned command holds no split option and no test file.""" result = runner.invoke(app, ["--dry-run", "--only", "test"]) said = _said(result.output) - assert (result.exit_code, "--splits" in said, "--cov-report=term-missing" in said) == ( - 0, - False, - True, - ) + assert ( + result.exit_code, + "--splits" in said, + "tests/commands/test_ci_shard.py" in said, + "--cov-report=term-missing" in said, + ) == (0, False, False, True) @pytest.mark.parametrize( diff --git a/tests/ui/conftest.py b/tests/ui/conftest.py index 45bd5f34d4..f0d5d4f399 100644 --- a/tests/ui/conftest.py +++ b/tests/ui/conftest.py @@ -1,22 +1,27 @@ -"""Package fixtures for the reactive dashboard UI tests.""" +"""Package fixtures for the reactive dashboard UI tests. + +A conftest loads before the root conftest isolates HOME when a run names a file under this +directory, as a test shard does (#2371). So this module imports no devops-cli module at its top: +devops-cli binds its paths under HOME when it is first imported. +""" from __future__ import annotations from collections.abc import Callable, Iterator -from typing import Any +from typing import TYPE_CHECKING, Any from unittest.mock import MagicMock import pytest -import devops_cli.ui.refresh as refresh_module -from devops_cli.config.constants import CONST_DASHBOARD_DOMAINS -from devops_cli.ui.state import DashboardState -from tests.support.ui import SAMPLES +if TYPE_CHECKING: + from devops_cli.ui.state import DashboardState @pytest.fixture def state() -> DashboardState: """Provide an empty dashboard state store.""" + from devops_cli.ui.state import DashboardState + return DashboardState() @@ -37,6 +42,10 @@ def patched_fetchers(monkeypatch: pytest.MonkeyPatch) -> Callable[..., None]: test that does not control the providers is racing real network calls. """ + import devops_cli.ui.refresh as refresh_module + from devops_cli.config.constants import CONST_DASHBOARD_DOMAINS + from tests.support.ui import SAMPLES + def apply(**overrides: Callable[[], Any]) -> None: fetchers = {domain: SAMPLES[domain] for domain in CONST_DASHBOARD_DOMAINS} fetchers.update(overrides) diff --git a/uv.lock b/uv.lock index 9cd8841399..df30bd8f14 100644 --- a/uv.lock +++ b/uv.lock @@ -868,7 +868,6 @@ dev = [ { name = "pytest-cov" }, { name = "pytest-mock" }, { name = "pytest-randomly" }, - { name = "pytest-split" }, { name = "pytest-timeout" }, { name = "pytest-xdist" }, { name = "ruff" }, @@ -972,7 +971,6 @@ dev = [ { name = "pytest-cov", specifier = "==7.1.0" }, { name = "pytest-mock", specifier = "==3.16.0" }, { name = "pytest-randomly", specifier = "==5.0.0" }, - { name = "pytest-split", specifier = "==0.11.0" }, { name = "pytest-timeout", specifier = "==2.4.0" }, { name = "pytest-xdist", specifier = "==3.8.0" }, { name = "ruff", specifier = "==0.16.8" }, @@ -3166,18 +3164,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/10/b4/47e939285caad9a623d021512912ac08dc92a467ad075d179f43729d2934/pytest_randomly-5.0.0-py3-none-any.whl", hash = "sha256:8a0d4703115c0c25b38b6e129fc16b1947b9643ff26a41bc1d185d7e5a7689c1", size = 8920, upload-time = "2026-09-01T22:34:19.227Z" }, ] -[[package]] -name = "pytest-split" -version = "0.11.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytest" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/2f/16/8af4c5f2ceb3640bb1f78dfdf5c184556b10dfe9369feaaad7ff1c13f329/pytest_split-0.11.0.tar.gz", hash = "sha256:8ebdb29cc72cc962e8eb1ec07db1eeb98ab25e215ed8e3216f6b9fc7ce0ec2b5", size = 13421, upload-time = "2026-02-03T09:14:31.469Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ae/a1/d4423657caaa8be9b31e491592b49cebdcfd434d3e74512ce71f6ec39905/pytest_split-0.11.0-py3-none-any.whl", hash = "sha256:899d7c0f5730da91e2daf283860eb73b503259cb416851a65599368849c7f382", size = 11911, upload-time = "2026-02-03T09:14:33.708Z" }, -] - [[package]] name = "pytest-timeout" version = "2.4.0"