Repository navigation
Run selected checks once per project (shared-run method) - #15
Merged
Merged
Conversation
The `.batch` collection form is no longer supported. Collection-level checks and generators become plain helpers, so each check lives on a leaf only. pytest checks each top-level test: a module-level test function or a test class, under its test file, under its project. Every test check of a project takes the engine-filtered test file collection as its selection and builds the same pytest command from it, so the engine runs pytest once per project. A bundled plugin records each report as a JSON line, and an indexer writes one bounded result per check, which each check reads. This follows the go module's runTests and assertPassed. ruff, mypy, ty and uv keep the project as the leaf: their reports list only diagnostics, so a per-file check could not tell a pass from a file never read. The modules now need engine v1.0.0-beta.22, for selected collection arguments on checks. The e2e suite drops `.batch` and adds CLI-driven selection checks, a check that a project runs pytest once, and a check that listing runs no tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tiborvass
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.batchis gone: the engine no longer supports it. Every leaf check now calls one byte-identical shared command per dedup unit, so the engine runs the tool once and each check reads its own result. This follows github.com/dagger/go (go.dangrunTests/assertPassed).Dimensions
pytest-project(the dedup unit) →pytest-test-file(project-relative path) →pytest-test(a top-level test: a module-leveltest*function with all its parameters, or aTest*class with all its tests). The@checkisPytestTest.test(ws, selection: PytestTestFiles!). The engine passes in the project's filtered file collection, with each file's test collection filtered too.<tool>-project. The project is both the leaf and the dedup unit, as for golangci-lint and staticcheck in dagger/go. These tools take files, but their machine output lists only diagnostics, so a per-file check could not tell a pass from a file the tool never read. mypy and ty also check a whole program, and a file list on the command line overrides the project's ownfilesconfig.Behaviour and API changes for callers
engineVersionis nowv1.0.0-beta.22in every module, for selected collection arguments on checks.Collection-level
@check/@generatefunctions are now plain functions:lint,format,fixtypeCheckaudit,lock,buildprojects(...).test,tests(...).testWrite
projects(ws).lint(ws)where you wroterun(projects(ws).batch.lint(ws)). They returnVoidand raise on failure. The README spells this out for each function.New pytest flag
--pytest-test.--pytest-test-fileis unchanged.PytestTestFile.testis removed. Usetests(ws).subset(keys: [file]).test(ws), or call a test's check withselection:.pytest discovery reads top-level declarations only. It skips pytest's default
norecursedirs(build,dist,venv,node_modules,*.egg, dot-directories).The shared pytest run adds
--continue-on-collection-errorsand loads a bundled reporter plugin with-p.The indexer runs in a digest-pinned
python:3.14-slim.No cache busters: results are keyed by content.
Library additions:
attempt,ownedMatches,searchMatches,ownMatchesand aPythonMatchtype. Base image argument types are unchanged.Attribution
-m,-koraddopts-xor--maxfailnever reached after a reported failureTesting
dagger check: 46/46 passed, covering e2e, dagger-pytest-otel and the dang-sdk stale check. The new checks run the engine's CLI against fixture workspaces:selected-*:-n 2selected-one-run-check: each test draws a random token once per pytest session. Every failing check of a project must show the same token, and the two projects must show different ones.listing-check: lists all five modules over a project whose dependency doesn't exist, whoseuv.lockandruff.tomlare garbage and whose imports fail, with base images that hold no tool.Overlap with open PRs
pytest/main.dang. This PR removesrunFilesandtestExec(files), which Cache dependency bytecode and tools in the project environment #14 edits. They combine without rework of the caching: the shared run usesenvanduvRun, which work with Cache dependency bytecode and tools in the project environment #14's in-environment tool installs. Cache dependency bytecode and tools in the project environment #14'scheckInputscould also supplyrunTestswith the version and nested projects. This PR doesn't touch caching or sync.@checkfromPyreflyProjects.typeCheck.engineVersiontov1.0.0-beta.22..batch.typeCheckwith.typeCheckin its e2e checks.Known limitations
python_files,python_functionsortestpaths, tests declared inside anif, and runtime-built tests are not checks. Under a whole-project run their failures fail every check of the project. A test discovery lists that pytest skips fails as "did not run".🤖 Generated with Claude Code