-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tests): faster smokes via process-compose #4324
Conversation
Containers are out, process orchestration is in. A while back we ditched using containers for the smoke tests, mostly because the caching on the container-build story was atrocious, so test re-runs took a really long time. And frankly, container ergonomics on dev workstations, particularly macOS, are not awesome. Instead, let's assume the dev env can run processes for cargo, pd, and cometbft. If so, that's all we need to wire up our integration testing. Enter process-compose [0]. The new smoke test setup ditches the bash script and delegates to process-compose for orchestrating processes. Benchmarking via hyperfine shows a decrease of over 2x in runtime. There's one substantive change to the integration test logic, in the pcli suite, that reduces the sleep time between tests, refining it to be more precisely the duration necessary for claiming an undelegation. [0] https://github.com/F1bonacc1/process-compose
Rerunning locally, I get super fast builds. I'm not going to drill into the caching story in this PR, because that's a bit of a rabbit hole, and a 2x speed-up is a big enough win that I want to merge this. It's worth exploring caching improvements because we'll likely have a lot of caching needs for #4323, too. |
This is awesome! I was wondering what makes process-compose a more friendly container orchestration tool than say standard docker-compose or kubernetes for our purposes? I ask because I haven't heard of it before! Also what's the scope of the information stored in the local hot cache? |
Simply because running containers locally has been a bit of a bear in the past. A prior version of the smoke test setup used docker-compose, and it was not pleasant to work with. We've since updated the container build story enough that it's worth revisiting, particularly in the context of upgrade testing, but this is a "good enough" solution for an immediate win, and leaves the door open to more robust devenvs via nix/devbox in the future.
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like an awesome extension of our smoke tests, great work @conorsch!
I really appreciate this work-stream for speeding up dev efficiency! |
Overview
A while back we ditched using containers for the smoke tests, mostly because the caching on the container-build story was atrocious, so test re-runs took a really long time. And frankly, container ergonomics on dev workstations, particularly macOS, are not awesome. Instead, let's assume the dev env can run processes for cargo, pd, and cometbft. If so, that's all we need to wire up our integration testing. Enter process-compose.
Implementation
The new smoke test setup ditches the bash script and delegates to process-compose for orchestrating processes:
cargo test
for each binary's integration testsThe wrapper script uses tty detection, so that running the smoke tests locally on your workstation displays a pleasant TUI:
Logging is currently a bit too aggregated, would be nice to have discrete info about what failed.
When running in CI, however, log output will be displayed:
Benchmarks
tl;dr running the smoke tests in CI now takes about ~10m, down from ~20m as in this recent run. With a warm cache locally, run times are as low as ~3m30s, although the CI caching setup isn't as complete as local context.
Testing the old script against the new invocation locally via hyperfine, results were:
hyperfine results
Actual run times on this PR: