feat(dev): run_all.py --container runs the checks with CI's tools #2319
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2319
Loading…
Reference in a new issue
No description provided.
Delete branch "pepe999/Longshot:feat/checks-container"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
mise run testis asked of every pull request, and its result is what the author's PC has installed: a check whose tool is missing (clang, spirv-val, glslang, .NET, a sanitizer library) fails with--strictor is skipped without it. On one Linux PC that was 62 skipped with g++ alone and 39 with clang, and CI doesn't fill the gap for now (ci.ymlruns these checks by hand).mise run test --container(tests/run_all.py --container) runs the same checks, on Linux, in a container with the tools and versions ofci.yml's job: Ubuntu 24.04, its packages, the pinned Python packages, glslang and headers. Podman or Docker;scripts/linux/checks.shbuilds the image once (checks.Dockerfile) and passes the other arguments on. A--junitpath is resolved relative to the caller's directory and must be inside the checkout. The checks run as the caller, with no network, and can write the checkout alone; a git worktree's repository is mounted read-only. No new mise task.CCandCXXare passed on, soCXX=g++ mise run test --container ub_runs some with the other compiler.It doesn't run the website's checks (node), nor the checks that need the game or a GPU.
Read first:
scripts/linux/checks.sh, thenin_containerintests/run_all.py.Testing
Tested: Linux (Fedora, SELinux enforcing, rootless Podman 6.1.3), in a git worktree, through
mise run test --container: 937 passed, 3 failed, 18 skipped (Windows, a GPU, the dump). Two of the 3 fail onmain(test_dev_packs, test_pipeline_state_computes: #2311). The third, test_longshot_saves, passes as root, as in CI, and fails as the caller: a bug it finds inlongshot_saves.py, fixed in a pull request of its own. Nothing the caller doesn't own is left in the checkout, andgit statusis clean after.tests/test_checks_container.py, game-free, with a stand-in for podman and docker: the versions areci.yml's andmise.toml's, no network, the mounts, the user under Podman, Docker and rootless Docker, the arguments, the exit status, no engine. Six broken versions of the script each fail it. ShellCheck passes.Still to test:
mise run test --container ub_, expecting the checks to run and no file of root's in the checkout (by hand)Measurements
Verdict: the whole
--strictsuite in about 3 minutes on a PC that can't run it otherwise.Setup: Linux, 28 threads, rootless Podman,
main@753fb5afand this branch; the PC was not reserved for timing.753fb5af023d5970run_all.py, g++ alone (not--strict)Risks
The image's versions could fall behind CI's: the check compares them. Ubuntu's packages are as its archive has them that day, as CI's are. Without
--containernothing changes. Players notice nothing; a revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
WIP: feat(dev): run_all.py --container runs the checks with CI's toolsto feat(dev): run_all.py --container runs the checks with CI's tools@review
Recommendation: Approve. Rootless Docker runs the checks as container root, so permission-sensitive checks can pass when they fail for the caller. The container also changes where JUnit output can be written, despite forwarding that option unchanged. Nothing blocking is left. Recommend approval; not approved on the forge.
Adds an opt-in Linux container for running game-free checks with CI-like tools. It reduces missing-tool skips at the cost of an image build and storage; the Podman run reported 937 passes and 18 skips, with three failures.
Should fix (2): not blocking, but worth doing before merging.
scripts/linux/checks.sh:31: Rootless Docker runs the checks as UID 0 inside the container, which changes permission-sensitive test results. (more on the line) Do: Run the checks under a non-root container identity that maps to the caller's writable checkout, and add a permission-sensitive check for rootless Docker.scripts/linux/checks.sh:23: The checkout-only mount and changed working directory break forwarded --junit paths outside the checkout. (more on the line) Do: Preserve the caller's output-path semantics by resolving and mounting the requested report destination, or reject unsupported destinations before starting the suite and document the restriction.@fixcan do L1 and L2.Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the reported Fedora Podman run reduced skips from 39–62 to 18. The reported suite time was 193 seconds, versus 143–146 seconds with more checks skipped; the image used 2.25 GB.
Other systems: The ordinary test path and game code are unchanged. Podman was tested on Fedora; Docker with rootful and rootless daemons remains untested. The image uses an x86-64 glslang release.
Switches: --container is opt-in and defaults off. DOCKER selects an engine, defaulting to Podman then Docker; LONGSHOT_CHECKS_IMAGE defaults to longshot-checks. CC and CXX are forwarded when set.
Reviewed:
023d59709eagainst753fb5af68: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the diff, commit and trailers, checks.sh, checks.Dockerfile, test_checks_container.py, run_all.py and fetch_commit.sh. Skimmed developing.md, standards references, mise.toml and CI configuration. No review checklist file or adjacent Tooling checkout was present.; nothing run (a code review).Checked and fine:
Testing: No commands from the change or tests were run. The author reports a Fedora rootless Podman run; Docker runs and several CI checks are still pending.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -0,0 +20,4 @@"$DOCKER" build -t "$IMAGE" -f scripts/linux/checks.Dockerfile scripts >&2RUN=(run --rm --init --network none -v "$ROOT:$ROOT" -w "$ROOT")L2 (should fix): The checkout-only mount and changed working directory break forwarded --junit paths outside the checkout.
When: For example, --container --junit /home/user/results/report.xml reaches run_all.py, but the host directory is not mounted, so writing the report fails after the checks finish. A relative path supplied from another working directory is resolved under the checkout instead.
Do: Preserve the caller's output-path semantics by resolving and mounting the requested report destination, or reject unsupported destinations before starting the suite and document the restriction.
@ -0,0 +28,4 @@# (the user: as docker.sh, beside this, says)if "$DOCKER" --version 2>/dev/null | grep -qi podman; thenRUN+=(--userns=keep-id)elif "$DOCKER" info --format '{{.SecurityOptions}}' 2>/dev/null | grep -q rootless; thenL1 (should fix): Rootless Docker runs the checks as UID 0 inside the container, which changes permission-sensitive test results.
When: With a rootless Docker daemon, this branch adds no --user option. The reported longshot_saves test passes as root but fails as the caller, so this path can report a pass for the very failure the Podman run found.
Do: Run the checks under a non-root container identity that maps to the caller's writable checkout, and add a permission-sensitive check for rootless Docker.
@fix
023d59709e8ec8a0cc7bRecommendation: Approve. The container runs the checks with CI’s tools on the tested Podman setup. The two remaining limitations are minor and do not prevent the feature from being useful. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
8ec8a0cc7b. I rebased it ontomain(21d5bdf9bc). I edited its description to match the change.Changed
Not done
Nothing was built or run: the checks run again on the new head.
Developers can run more of the game-free suite in a Linux container without installing its tools locally. The image costs 2.25 GB and an initial build; the reported suite took 193 seconds.
Should fix (2): not blocking, but worth doing before merging.
scripts/linux/checks.sh:31: Rootless Docker runs the checks as UID 0 inside the container, which changes permission-sensitive test results. When: With a rootless Docker daemon, this branch adds no --user option. The reported longshot_saves test passes as root but fails as the caller, so this path can report a pass for the very failure the Podman run found. Do: Run the checks under a non-root container identity that maps to the caller's writable checkout, and add a permission-sensitive check for rootless Docker.scripts/linux/checks.sh:23: JUnit destinations outside the checkout are rejected rather than supported. When: A caller requesting --junit /tmp/results.xml receives exit status 2 before the checks run instead of a report at that path. Do: Support writing the requested external report, for example by writing it inside the container and copying it to the caller’s destination after the run.@fixcan do L1 and L2.Checks: they run again on this head; a failure shows on the pull request.
Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports 18 skipped checks in the container versus 62 with g++ alone on the same PC; the recorded run had 937 passes, three failures and 18 skips. This is a tooling feature, not a player performance change.
Other systems: The reported run covers rootless Podman on SELinux-enforcing Fedora and a git worktree. Rootful and rootless Docker remain untested with real engines; the stand-in checks inspect their arguments. The game and Windows execution are unaffected.
Switches: Adds --container, off by default; LONGSHOT_CHECKS_IMAGE defaults to longshot-checks; DOCKER defaults to the first available engine, preferring Podman. CC and CXX are passed through when set. These defaults fit the feature.
Reviewed:
8ec8a0cc7bagainst21d5bdf9bc: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the fix diff, scripts/linux/checks.sh, scripts/linux/checks.Dockerfile and tests/test_checks_container.py. Read the runner’s container and JUnit paths and skimmed the remaining runner and base diff. The stated base diff also contains unrelated merged changes, which were not reviewed in full. Tooling’s AGENTS.md and docs/review-checklist.md were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run during this read-only review. The author reports a real Podman run and stand-in engine checks; Docker runs remain listed as still to test.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.