Add a wrapper script that runs every test suite - #466
Conversation
Add bin/run-all-tests, exposed as `devbox run test`, which runs the builder-api and library-api JVM tests and then delegates to bin/run-e2e-tests for the full-stack Bruno and Playwright suites. The JVM suites run first because they need nothing but Maven, while the e2e leg takes exclusive ownership of the local service ports and swaps the root emulator-data directory for the e2e fixtures. By default every suite runs even after a failure so a single invocation reports the complete picture; --fail-fast stops at the first failure and suite names can be passed to run a subset. Invoking the script from outside Devbox re-enters it, seeding the root .env first because `devbox run` cannot load an env_from file that does not exist yet. Closes #417 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Setup previously verified the local environment with bin/run-e2e-tests, which covered only the Playwright and Bruno suites. Run the full wrapper instead so the builder-api and library-api JVM suites are part of the verification gate. --fail-fast keeps a failing JVM suite from paying for the several-minute e2e run that swaps the root emulator-data directory. Package the backends with -DskipTests: the wrapper now owns the test run, so `mvn clean package` would otherwise run both JVM suites twice per setup. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
heyoub
left a comment
There was a problem hiding this comment.
One other thing I ran into: my first library-api run failed because port 8081 was already occupied by the local service graph. The subsequent e2e runner stopped process-compose, after which the library tests passed. Since the wrapper intentionally runs the JVM suites before e2e, should it preflight/handle an already-running dev stack before starting those suites?
There was a problem hiding this comment.
I think the Devbox entrypoint is dropping arguments here. I ran devbox run test -- builder-api, but the wrapper reported Test suites selected: builder-api library-api e2e and ran all three suites. Running the wrapper directly with suite arguments appears to be the intended interface, so I think this needs to forward $@ through the Devbox script. This would also affect the documented devbox run test -- --fail-fast form.
There was a problem hiding this comment.
I hit a failure-path issue here as well. When Playwright fails, the HTML reporter starts its report server and waits at Press Ctrl+C to quit, so bin/run-e2e-tests never returns to this wrapper. That means run-all-tests never records the e2e failure or prints the promised final summary. I had to Ctrl+C manually. Should this invoke Playwright with the HTML reporter configured not to open/serve on failure?
Closes #417.
What
Adds
bin/run-all-tests, a single entry point for every automated test suite in the repository, wired up asdevbox run test.Suites run in this order:
builder-api— JVM tests (mvn test)library-api— JVM tests (mvn test)e2e—bin/run-e2e-tests, which boots the dev stack, runs the library-api Bruno collection, then the Playwright suiteThe JVM suites go first because they need nothing but Maven, while the e2e suite takes exclusive ownership of the local service ports and swaps the root
emulator-datadirectory for the e2e fixtures.By default every selected suite runs even when an earlier one fails, so one invocation reports the complete picture.
--fail-faststops at the first failure. Individual suites can be selected by name. The script re-enters the Devbox environment on its own when invoked from outside it.Every run ends with a summary table of per-suite status and duration, and exits non-zero if any suite failed.
Setup now verifies through the wrapper
bin/setuppreviously verified the local environment withbin/run-e2e-tests, covering only the Playwright and Bruno suites. It now runsbin/run-all-tests --fail-fast, so the JVM suites are part of the verification gate too — and a failing JVM suite no longer costs you the several-minute e2e run.Setup's
mvn clean packagesteps gained-DskipTests. The wrapper owns the test run now, so without that change setup would run both JVM suites twice.Testing
bin/run-all-testswas run end to end against a clean local stack; all three suites pass.bin/setupwas also re-run end to end for the follow-up change.🤖 Generated with Claude Code