Skip to content

fix(ci): fix E2E tests and docker network isolation#53

Merged
poyrazK merged 4 commits intofeature/elastic-ipfrom
feature/test-isolation-fixes
Feb 12, 2026
Merged

fix(ci): fix E2E tests and docker network isolation#53
poyrazK merged 4 commits intofeature/elastic-ipfrom
feature/test-isolation-fixes

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Feb 12, 2026

Description

This PR fixes the E2E test failures in CI by ensuring proper network isolation and configuration.

Changes

  • Configured dynamic using to prevent conflicts in parallel runs.
  • Propagated to the API container so it knows which network to attach instances to.
  • Updated to respect the configured docker network instead of hardcoding .
  • Standardized test utilities () to use environment variable.
  • Cleaned up to support dynamic network names via env vars.

Verification

  • E2E tests pass in CI (Run ID: 21940937128)
  • Local docker-compose workflow remains supported

Copilot AI review requested due to automatic review settings February 12, 2026 09:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes E2E test failures in CI by implementing proper Docker network isolation for parallel test runs. The changes enable multiple test runs to execute simultaneously without network conflicts by using dynamic network names based on GitHub run IDs.

Changes:

  • Configured dynamic network isolation using COMPOSE_PROJECT_NAME with GitHub run IDs
  • Propagated DOCKER_DEFAULT_NETWORK configuration from environment to the API service
  • Standardized test utilities to use environment variables for Docker network configuration

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/helpers/helpers_test.go Updated test assertions to use dynamic test base URL from testutil
tests/chaos_test.go Changed from direct docker commands to docker compose commands for better container management
pkg/testutil/constants.go Converted constants to variables with environment variable support for dynamic configuration
internal/core/services/instance_test.go Added support for dynamic Docker network and test port configuration
internal/core/services/instance.go Added dockerNetwork field and logic to use configured network instead of hardcoded value
internal/platform/config.go Added DockerDefaultNetwork configuration field
internal/api/setup/dependencies.go Passed DockerDefaultNetwork config to InstanceService initialization
docker-compose.yml Removed static container names and added dynamic port/network configuration
.github/workflows/e2e.yml Added COMPOSE_PROJECT_NAME and DOCKER_DEFAULT_NETWORK with run ID for isolation
.github/workflows/ci.yml Added TEST_DOCKER_NETWORK environment variable and removed duplicate image tags

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/testutil/constants.go
Comment on lines +15 to 17
var (
// TestIPLocalhost is the loopback address used in tests.
TestIPLocalhost = "127.0.0.1"
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converting exported constants to variables reduces their immutability guarantees and could lead to unintended modifications during test execution. Consider keeping these as constants and only making the truly dynamic values (TestBaseURL, TestDatabaseURL, TestPort, TestProdPort, TestDockerNetwork) into variables, or use a function-based approach that returns computed values at call time.

Copilot uses AI. Check for mistakes.
Comment thread docker-compose.yml
networks:
cloud-network:
name: cloud-network
cloud-network: # name: cloud-network
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment # name: cloud-network appears to be leftover from removing the explicit name configuration. This comment should be removed or clarified to explain why the network name is not explicitly set.

Suggested change
cloud-network: # name: cloud-network
cloud-network: # Use implicit network name; explicit "name:" omitted intentionally

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines 323 to 324
ghcr.io/${{ steps.repo_name.outputs.REPO_LC }}:staging
ghcr.io/${{ steps.repo_name.outputs.REPO_LC }}:${{ github.ref_name }}
ghcr.io/${{ steps.repo_name.outputs.REPO_LC }}:${{ github.sha }}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the ${{ github.ref_name }} tag is inconsistent with the stated purpose of this PR (fixing E2E tests and Docker network isolation). If this tag removal is intentional, it should be documented in the PR description or split into a separate commit/PR for clarity.

Copilot uses AI. Check for mistakes.
@poyrazK poyrazK merged commit 0eb0073 into feature/elastic-ip Feb 12, 2026
39 of 40 checks passed
@poyrazK poyrazK deleted the feature/test-isolation-fixes branch April 12, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants