diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8d07733..9f4d668 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -60,6 +60,7 @@ jobs: NEXUS_SERVER=nexus_server NEXUS_MINION_PORT=11972 NEXUS_CONSOLE_PORT=11973 + NEXUS_WEB_PORT=8086 DBHOST=localhost DBPORT=5432 DBUSER=postgres @@ -77,7 +78,7 @@ jobs: EOF - name: Build all binaries - run: make build + run: make build-test - name: Run unit tests run: make test @@ -87,8 +88,8 @@ jobs: - name: Start Docker services for integration tests run: | + MINEXUS_ENV=test make compose-run echo "Starting Docker services with healthchecks..." - docker compose up -d nexus_server minion echo "Waiting for services to be healthy..." timeout 120 bash -c 'until docker compose ps --format json | grep -q "nexus_server.*healthy"; do @@ -102,7 +103,7 @@ jobs: run: docker compose ps - name: Run integration tests - run: make test-integration + run: MINEXUS_ENV=test make test-integration - name: Upload coverage reports uses: actions/upload-artifact@v4 diff --git a/docker-compose.yml b/docker-compose.yml index 6e15093..2be6b59 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,11 +55,12 @@ services: networks: - default healthcheck: - test: ["CMD-SHELL", "sleep 1 && nc -z localhost ${NEXUS_MINION_PORT:-11972} && nc -z localhost ${NEXUS_CONSOLE_PORT:-11973} && nc -z localhost ${NEXUS_WEB_PORT:-8086} && echo 'All three ports accessible' || exit 1"] + #test: ["CMD-SHELL", "nc -z nexus_server ${NEXUS_MINION_PORT:-11972} && nc -z nexus_server ${NEXUS_CONSOLE_PORT:-11973} && nc -z nexus_server ${NEXUS_WEB_PORT:-8086} && echo 'All three ports accessible' || exit 1"] + test: ["CMD-SHELL", "nc -z nexus_server ${NEXUS_MINION_PORT:-11972} && nc -z nexus_server ${NEXUS_CONSOLE_PORT:-11973} && echo 'All three ports accessible' || exit 1"] interval: 3s - timeout: 15s + timeout: 5s retries: 10 - start_period: 10s + start_period: 11s # Minion client - depends on nexus server being healthy minion: