Migrates Consul tests to use Testcontainers#9707
Merged
ReubenBond merged 2 commits intodotnet:mainfrom Feb 15, 2026
Merged
Conversation
Meir017
commented
Oct 5, 2025
13 tasks
Contributor
Author
|
@ReubenBond I think the two github-actions that failed are unstable, all actions passed |
Member
|
@Meir017 they look like Consul failures, based on the output: |
Contributor
Author
|
hmm, wer'e getting the error seems to be related to this https://github.com/testcontainers/testcontainers-dotnet/blob/4a72cb31f51206eb9f5d710fc6621650fdab89ee/src/Testcontainers.Consul/ConsulBuilder.cs#L50C27-L50C28 I'll check this out |
be841ae to
c45c6b3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Consul provider test setup from CI-managed Docker containers to an in-test Testcontainers-managed Consul instance, aiming to improve isolation and make Consul tests run without manual local setup.
Changes:
- Introduces a Testcontainers-based Consul lifecycle in
ConsulTestUtilsand derives the connection string from the running container. - Adds
Testcontainers.Consulas a test dependency via central package management. - Removes the explicit Consul
docker run/cleanup steps and related env var wiring from the CI workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Extensions/Consul.Tests/ConsulTestUtils.cs | Starts a Consul Testcontainer and exposes its base address to tests. |
| test/Extensions/Consul.Tests/Consul.Tests.csproj | Adds the Testcontainers.Consul package reference to the Consul test project. |
| Directory.Packages.props | Centralizes the Testcontainers.Consul package version. |
| .github/workflows/ci.yml | Removes manual Consul container management from the Consul CI job. |
c39c8c8 to
a7e9b09
Compare
ReubenBond
approved these changes
Feb 15, 2026
Replaces manual Docker container management in CI workflows with Testcontainers library for better test isolation and reliability. Removes hardcoded Consul setup from GitHub Actions workflow and updates test utilities to programmatically manage container lifecycle. Updates Testcontainers dependency to latest version for improved compatibility.
Normalize Consul testcontainer capability override to IPC_LOCK and exclude Consul from the core Functional suite so it runs only in the dedicated Consul provider job. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a7e9b09 to
82aff6c
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.
just saw #9701 and realized we can further simplify the tests by using testcontainers
Replaces manual Docker container management in CI workflows with Testcontainers library for better test isolation and reliability.
Removes hardcoded Consul setup from GitHub Actions workflow and updates test utilities to programmatically manage container lifecycle.
Updates Testcontainers dependency to latest version for improved compatibility.
no setup on my machine, tests just work -

Microsoft Reviewers: Open in CodeFlow