Repository navigation
app tests: one test binary instead of 53 - #176
Open
ndbroadbent wants to merge 5 commits into
Open
ndbroadbent wants to merge 5 commits into
ndbroadbent wants to merge 5 commits into
Conversation
VisualCIdocspring/visualci · build #477 · 8 added, 392 unchanged · waiting for review This PR vs base: 10 changed, 8 added since #425, across 3 builds · 8 not approved yet docspring/visualci · journeys · build #499 · 42 unchanged · no changes This PR vs base: 6 changed, 12 added since #401, across 5 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
ci/app-tests-one-binary
branch
from
December 4, 2026 06:05
17b9fb7 to
6d3623b
Compare
Each file in app/tests was its own test binary: every run linked the whole app 53 times, then cargo ran the binaries one after another. They're now modules of tests/all.rs, linked once, with every test running in parallel (Laravel Rust gives each test its own application and database). live_limits, mcp_hosts and proxies say they need a process of their own, so they stay separate [[test]] targets. A test fails if a file in tests/ is in neither list, since autotests is off.
…binary; guard requires exactly one listing From the review: main gained three test files; live.rs must start the live-updates listener on its own runtime, which only alphabetical order guaranteed in the shared binary; and a file listed in both places would run twice.
The tests are bound by the runner after all, so more threads only meant more database copies.
ndbroadbent
force-pushed
the
ci/app-tests-one-binary
branch
from
December 4, 2026 07:08
03b283b to
2538f84
Compare
This branch has not been deployed
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.
The
appjob'scargo teststep took 145–233 s in recent runs: about 131 s compiling and linking, then about 74 s running 53 test binaries one after another (run 47272907438).app/tests/all.rsdeclares every test file as a module, andapp/Cargo.tomlsetsautotests = falsewith one[[test]]for it. The shared helpersgoldenandoauth_clientare declared once there, and the files that used themuse crate::…instead.live_limits,mcp_hostsandproxieskeep their own binaries: each says it needs its own process (a per-process counter, or the MCP service built from the first test's settings).every_test_file_is_listedfails if a file intests/is in neither list, so a new test file can't silently stop running.cargo test -p visualci-app <file>::. Nothing in the repo used--test <file>.I checked the other process-wide statics for problems across files: the
/mcpand admin MCP services, the Stripe catalog, the live hub and the gallery cache. Within each file they were already shared, and the only file that depends on host settings (mcp_hosts) stays separate.hosts.rsandsign_in.rsexpect only the host check's 404, which runs before the service is built.Checked on the build pool: clippy
--all-targets -D warningsis clean. The full app suite passed three times in a row, with 302 tests in the shared binary in 32–38 s (after the rebase), plus the three separate binaries.Before and after, measured on what this is for: a PR that changes
app/src. I ran the same one-line change twice with workflow_dispatch, once on main and once on this branch:cargo teststepOn a PR that doesn't touch
app/srcit changes little (149 s against 145–154 s), because rust-cache already has the test binaries. I also triedRUST_TEST_THREADS=12: the tests took 73 s against 75 s, so I reverted it.Also from the review:
mainhad gained three test files, now listed.live.rsgets its own binary, because its listener test needs to start first, which only alphabetical order guaranteed. The guard now fails if a file is listed twice.