From 5fc3db7aa3ec94ec670367c198cdc6de354b9e99 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 17 Jun 2025 20:41:40 +0200 Subject: [PATCH] ci: update integration tests to use hi CLI tool Replace manual Docker command composition in GitHub Actions workflow with the new hi CLI tool for running integration tests. Changes: - Replace complex docker run command with simple 'go run ./cmd/hi run' - Remove manual environment variable setup (handled by hi tool) - Update artifact paths for new timestamped log directory structure - Simplify command from 15+ lines to 3 lines - Maintain all existing functionality (postgres/sqlite, timeout, test patterns) The hi tool automatically handles Docker context detection, container management, volume mounting, and environment variable setup that was previously done manually in the workflow. --- .github/workflows/test-integration.yaml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index b0e2daea..19020475 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -129,8 +129,6 @@ jobs: - name: Run Integration Test uses: Wandalen/wretry.action@master if: steps.changed-files.outputs.files == 'true' - env: - USE_POSTGRES: ${{ matrix.database == 'postgres' && '1' || '0' }} with: # Our integration tests are started like a thundering herd, often # hitting limits of the various external repositories we depend on @@ -144,30 +142,19 @@ jobs: attempt_delay: 300000 # 5 min attempt_limit: 10 command: | - nix develop --command -- docker run \ - --tty --rm \ - --volume ~/.cache/hs-integration-go:/go \ - --name headscale-test-suite \ - --volume $PWD:$PWD -w $PWD/integration \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - --volume $PWD/control_logs:/tmp/control \ - --env HEADSCALE_INTEGRATION_POSTGRES=${{env.USE_POSTGRES}} \ - golang:1 \ - go run gotest.tools/gotestsum@latest -- ./... \ - -failfast \ - -timeout 120m \ - -parallel 1 \ - -run "^${{ matrix.test }}$" + nix develop --command -- go run ./cmd/hi run "^${{ matrix.test }}$" \ + --timeout=120m \ + --postgres=${{ matrix.database == 'postgres' && 'true' || 'false' }} - uses: actions/upload-artifact@v4 if: always() && steps.changed-files.outputs.files == 'true' with: name: ${{ matrix.test }}-${{matrix.database}}-logs - path: "control_logs/*.log" + path: "control_logs/*/*.log" - uses: actions/upload-artifact@v4 if: always() && steps.changed-files.outputs.files == 'true' with: - name: ${{ matrix.test }}-${{matrix.database}}-pprof - path: "control_logs/*.pprof.tar" + name: ${{ matrix.test }}-${{matrix.database}}-archives + path: "control_logs/*/*.tar" - name: Setup a blocking tmux session if: ${{ env.HAS_TAILSCALE_SECRET }} uses: alexellis/block-with-tmux-action@master