Segregate Docker-dependent tests to GitHub Actions workflow#49481
Open
rujche wants to merge 2 commits into
Open
Segregate Docker-dependent tests to GitHub Actions workflow#49481rujche wants to merge 2 commits into
rujche wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent Docker/image-pull constraints in Azure DevOps CI (MCR blocked) from breaking Spring module test runs by tagging Docker-dependent tests and moving their execution to a dedicated GitHub Actions workflow that runs on a Docker-capable runner.
Changes:
- Tagged Docker-dependent JUnit 5 test classes with
@Tag("docker")in the Spring test modules. - Updated module POMs to exclude
docker-tagged tests by default and add adocker-testsMaven profile to run only those tests when desired. - Added a GitHub Actions workflow to build the Spring modules and execute the
docker-tagged tests onubuntu-24.04.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/spring/spring-cloud-azure-testcontainers/src/test/java/com/azure/spring/cloud/testcontainers/implementation/service/connection/storage/StorageQueueContainerConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Testcontainers-based queue test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-testcontainers/src/test/java/com/azure/spring/cloud/testcontainers/implementation/service/connection/storage/StorageBlobContainerConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Testcontainers-based blob test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-testcontainers/src/test/java/com/azure/spring/cloud/testcontainers/implementation/service/connection/hubs/EventHubsContainerConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Event Hubs emulator Testcontainers test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-testcontainers/src/test/java/com/azure/spring/cloud/testcontainers/implementation/service/connection/cosmos/CosmosContainerConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Cosmos emulator Testcontainers test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-testcontainers/src/test/java/com/azure/spring/cloud/testcontainers/implementation/service/connection/bus/ServiceBusContainerConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Service Bus emulator Testcontainers test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-testcontainers/pom.xml | Configures Surefire to exclude docker-tagged tests by default and introduces docker-tests profile to include them. |
| sdk/spring/spring-cloud-azure-docker-compose/src/test/java/com/azure/spring/cloud/docker/compose/implementation/service/connection/storage/StorageQueueDockerComposeConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Docker Compose-based queue test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-docker-compose/src/test/java/com/azure/spring/cloud/docker/compose/implementation/service/connection/storage/StorageBlobDockerComposeConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Docker Compose-based blob test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-docker-compose/src/test/java/com/azure/spring/cloud/docker/compose/implementation/service/connection/hubs/EventHubsDockerComposeConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Docker Compose-based Event Hubs test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-docker-compose/src/test/java/com/azure/spring/cloud/docker/compose/implementation/service/connection/bus/ServiceBusDockerComposeConnectionDetailsFactoryTests.java | Adds @Tag("docker") to mark Docker Compose-based Service Bus test for Docker-only runs. |
| sdk/spring/spring-cloud-azure-docker-compose/pom.xml | Configures Surefire to exclude docker-tagged tests by default and introduces docker-tests profile to include them. |
| .github/workflows/spring-docker-tests.yml | Adds a GitHub Actions workflow to run docker-tagged Spring tests on Ubuntu with Docker available. |
## Problem Azure DevOps network policies block Microsoft Container Registry (MCR) image pulls, causing Docker-dependent tests to fail in the default CI pipeline. ## Solution - Tag Docker-dependent tests with @tag("docker") in JUnit 5 - Configure Maven surefire to exclude docker-tagged tests from default CI - Create dedicated GitHub Actions workflow on ubuntu-24.04 with Docker support - Use docker-tests Maven profile to selectively run only tagged tests in GitHub Actions ## Changes 1. Add @tag("docker") to 9 Docker-dependent test classes: - 5 in spring-cloud-azure-testcontainers module - 4 in spring-cloud-azure-docker-compose module 2. Update pom.xml in both modules: - Configure surefire excludedGroups for docker tag - Add docker-tests Maven profile to override exclusion 3. Create .github/workflows/spring-docker-tests.yml: - Runs on ubuntu-24.04 with Docker pre-installed - Triggered by changes to spring modules and workflow file - Two-phase build: install deps, then run docker-tests profile - Triggered by pull_request and workflow_dispatch events ## Impact - Docker tests no longer block PR merges in ADO - Docker tests run independently in GitHub Actions on Linux - Default local Maven build excludes docker tests - Developers can opt-in with: mvn test -Pdocker-tests
c482169 to
500493f
Compare
raych1
reviewed
Jun 13, 2026
| @@ -0,0 +1,54 @@ | |||
| name: Spring Docker Tests | |||
Member
There was a problem hiding this comment.
Would this workflow be required check for pull requests?
Member
|
@mikeharder could you review this PR? This is a workflow to run spring service tests. |
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.
Description
Problem
Azure DevOps network policies block Microsoft Container Registry (MCR) image pulls, causing Docker-dependent tests to fail in the default CI pipeline.
Solution
Changes
Add @tag("docker") to 9 Docker-dependent test classes:
Update pom.xml in both modules:
Create .github/workflows/spring-docker-tests.yml:
Impact
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines