|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ main ] |
| 6 | + push: |
| 7 | + branches: [ main ] # Only run on direct pushes to main |
| 8 | + |
| 9 | +jobs: |
| 10 | + fast-tests: |
| 11 | + name: Fast Tests (Unit + Lightweight) |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Set up Python 3.12 |
| 18 | + uses: actions/setup-python@v5 |
| 19 | + with: |
| 20 | + python-version: '3.12' |
| 21 | + |
| 22 | + - name: Install uv |
| 23 | + run: curl -LsSf https://astral.sh/uv/install.sh | sh |
| 24 | + |
| 25 | + - name: Create virtual environment |
| 26 | + run: uv venv |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + source .venv/bin/activate |
| 31 | + uv pip install -r requirements.txt |
| 32 | + |
| 33 | + - name: Run all fast tests |
| 34 | + run: | |
| 35 | + source .venv/bin/activate |
| 36 | + pytest tests/ -m "not slow and not e2e and not integration" -v --tb=short |
| 37 | +
|
| 38 | + e2e-tests: |
| 39 | + name: End-to-End Tests (API) |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 20 # Fail fast if tests hang |
| 42 | + # Run on main branch and e/* branches for testing |
| 43 | + if: | |
| 44 | + github.ref == 'refs/heads/main' || |
| 45 | + startsWith(github.ref, 'refs/heads/e/') || |
| 46 | + startsWith(github.head_ref, 'e/') |
| 47 | + |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Set up Node.js |
| 52 | + uses: actions/setup-node@v4 |
| 53 | + with: |
| 54 | + node-version: '20' |
| 55 | + |
| 56 | + - name: Install Claude CLI |
| 57 | + run: | |
| 58 | + npm install -g @anthropic-ai/claude-code |
| 59 | + echo "Claude CLI installed at: $(which claude)" |
| 60 | + claude --version |
| 61 | + |
| 62 | + - name: Set up Python 3.12 |
| 63 | + uses: actions/setup-python@v5 |
| 64 | + with: |
| 65 | + python-version: '3.12' |
| 66 | + |
| 67 | + - name: Install uv |
| 68 | + run: curl -LsSf https://astral.sh/uv/install.sh | sh |
| 69 | + |
| 70 | + - name: Create virtual environment |
| 71 | + run: uv venv |
| 72 | + |
| 73 | + - name: Install dependencies |
| 74 | + run: | |
| 75 | + source .venv/bin/activate |
| 76 | + uv pip install -r requirements.txt |
| 77 | + |
| 78 | + - name: Run E2E tests |
| 79 | + timeout-minutes: 15 # Per-step timeout |
| 80 | + env: |
| 81 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 82 | + PYTHONUNBUFFERED: "1" # Force immediate output |
| 83 | + run: | |
| 84 | + source .venv/bin/activate |
| 85 | + echo "Starting e2e tests at $(date)" |
| 86 | + pytest tests/ -m "e2e" -v --tb=short -s --log-cli-level=INFO |
| 87 | + echo "E2E tests completed at $(date)" |
| 88 | + |
| 89 | + - name: Upload logs on failure |
| 90 | + if: failure() |
| 91 | + uses: actions/upload-artifact@v4 |
| 92 | + with: |
| 93 | + name: e2e-test-logs |
| 94 | + path: | |
| 95 | + /tmp/fireteam-test-*/ |
| 96 | + tests/**/*.log |
| 97 | + retention-days: 7 |
| 98 | + |
| 99 | + integration-tests: |
| 100 | + name: Terminal-bench Integration |
| 101 | + runs-on: ubuntu-latest |
| 102 | + # Temporarily disabled - needs debugging |
| 103 | + if: false |
| 104 | + |
| 105 | + steps: |
| 106 | + - uses: actions/checkout@v4 |
| 107 | + |
| 108 | + - name: Set up Python 3.12 |
| 109 | + uses: actions/setup-python@v5 |
| 110 | + with: |
| 111 | + python-version: '3.12' |
| 112 | + |
| 113 | + - name: Set up Docker |
| 114 | + uses: docker/setup-buildx-action@v3 |
| 115 | + |
| 116 | + - name: Install uv |
| 117 | + run: curl -LsSf https://astral.sh/uv/install.sh | sh |
| 118 | + |
| 119 | + - name: Install terminal-bench |
| 120 | + run: uv tool install terminal-bench |
| 121 | + |
| 122 | + - name: Create virtual environment |
| 123 | + run: uv venv |
| 124 | + |
| 125 | + - name: Install dependencies |
| 126 | + run: | |
| 127 | + source .venv/bin/activate |
| 128 | + uv pip install -r requirements.txt |
| 129 | + |
| 130 | + - name: Install Fireteam adapter |
| 131 | + run: | |
| 132 | + source .venv/bin/activate |
| 133 | + cd benchmark |
| 134 | + uv pip install -e . |
| 135 | + |
| 136 | + - name: Run terminal-bench integration test |
| 137 | + env: |
| 138 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
| 139 | + run: | |
| 140 | + source .venv/bin/activate |
| 141 | + pytest tests/ -m "integration" -v --tb=short |
| 142 | +
|
0 commit comments