add basic integration tests #2
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
| --- | |
| name: "Integration Tests" | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "*" | |
| merge_group: | |
| types: | |
| - "checks_requested" | |
| workflow_dispatch: # Allow manual triggering | |
| env: | |
| GO_VERSION: "~1.24.0" | |
| jobs: | |
| # Matrix job for individual integration tests | |
| integration-tests: | |
| name: "${{ matrix.test.name }}" | |
| runs-on: "depot-ubuntu-24.04" | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: true # Cancel remaining tests if one fails | |
| matrix: | |
| test: | |
| - name: "Cluster Creation" | |
| command: "test:integrationRun" | |
| pattern: "TestMultiNodeClusterCreation" | |
| timeout: "15m" | |
| - name: "Cluster Health" | |
| command: "test:integrationRun" | |
| pattern: "TestMultiNodeClusterHealth" | |
| timeout: "20m" | |
| - name: "Pool Functionality" | |
| command: "test:integrationRun" | |
| pattern: "TestMultiNodePoolFunctionality" | |
| timeout: "25m" | |
| - name: "Connection Balancing" | |
| command: "test:integrationRun" | |
| pattern: "TestMultiNodeConnectionBalancing" | |
| timeout: "20m" | |
| - name: "Error Handling" | |
| command: "test:integrationRun" | |
| pattern: "TestMultiNodeErrorHandling" | |
| timeout: "15m" | |
| steps: | |
| - uses: "actions/checkout@v4" | |
| - uses: "authzed/actions/setup-go@main" | |
| with: | |
| go-version: "${{ env.GO_VERSION }}" | |
| - name: "Run ${{ matrix.test.name }} Test" | |
| run: | | |
| echo "Running integration test: ${{ matrix.test.name }}" | |
| echo "Command: go run mage.go ${{ matrix.test.command }} \"${{ matrix.test.pattern }}\"" | |
| timeout ${{ matrix.test.timeout }} go run mage.go ${{ matrix.test.command }} "${{ matrix.test.pattern }}" | |
| - name: "Collect container logs on failure" | |
| if: failure() | |
| run: | | |
| echo "=== Docker System Info ===" | |
| docker system df || true | |
| echo "=== Running Containers ===" | |
| docker ps -a || true | |
| echo "=== Docker Networks ===" | |
| docker network ls || true | |
| echo "=== Recent Container Logs ===" | |
| docker ps -a --format "table {{.Names}}\t{{.Status}}" | grep -E "(crdb|cockroach|testcontainers)" | head -5 || true | |
| continue-on-error: true |