Migrates Consul tests to use Testcontainers#9707
Conversation
|
@ReubenBond I think the two github-actions that failed are unstable, all actions passed |
|
@Meir017 they look like Consul failures, based on the output: |
|
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
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
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
* Migrates Consul tests to use 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. * Fix Consul container capability and CI test routing 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> --------- Co-authored-by: Reuben Bond <reuben.bond@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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