Port the integration tests to Rust code - #969
Draft
bal-e wants to merge 14 commits into
Draft
Conversation
bal-e
force-pushed
the
rusty-integration-tests
branch
3 times, most recently
from
August 18, 2026 19:55
aa89e81 to
77d12c1
Compare
bal-e
force-pushed
the
rusty-integration-tests
branch
from
August 18, 2026 20:11
77d12c1 to
63daba9
Compare
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.
This introduces a new pure-Rust integration test infrastructure. Like the existing infrastructure, it relies on Docker; but it uses
bollardto control Docker from Rust. Tests are written as Rust code that starts and manipulates Docker containers. Tests run in parallel (using a shared multi-threaded Tokio runtime) and are very efficient. I have also optimized the Docker image, minimizing the Docker context and parallelizing some steps.Advantages:
sedto change config files.cargo test.It retains the advantages of the existing infrastructure (running tests in a clean and reproducible environment, exercising all the
dnst keysetcode, isolating dependency versions).Disadvantages:
cascadeCLI.bollardadds to our dependency tree, but only for development.A simple benchmark
Both are run with a hot cache.
Existing infrastructure:
This PR:
While the overall latency is not very different, there is an order-of-magnitude difference in the (userspace and kernelspace) CPU time. This suggests the new infrastructure will scale much better to a large number of tests.
Most of the new code is in
tests/integration/infra. A quick overview:image.rs-- building the Docker imagecontainer.rs-- managing and interacting with Docker containers (startup, shutdown, sending DNS queries, executing commands, changing files, dumping tarballs)cascade.rs-- programmatic control of Cascade (startup, shutdown, communication over HTTP API)services.rs-- managing Unbound, BIND, NSD, etc. (similar tomanage-test-environment.sh)test.rs-- defining tests, filtering names, multiplexing (filling in foract)runtime.rs-- helpers for async code (catching signals, async drop)tests/integration/main.rscontains the tests as well as the top-level runner code (including argument parsing, because it can't use the normal Rust test harness).