Add test coverage infrastructure with logger tests and comprehensive documentation #18
Workflow file for this run
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Run unit tests | |
| run: npm test | |
| test-basic-firewall: | |
| name: Basic Firewall Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Pre-test cleanup | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Run basic firewall tests | |
| run: sudo -E npm run test:integration -- basic-firewall.test.ts | |
| - name: Post-test cleanup | |
| if: always() | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Upload test logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: basic-firewall-test-logs | |
| path: | | |
| /tmp/*-test.log | |
| /tmp/awf-*/ | |
| /tmp/copilot-logs-*/ | |
| /tmp/squid-logs-*/ | |
| retention-days: 7 | |
| test-robustness: | |
| name: Robustness Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Pre-test cleanup | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Run robustness tests | |
| run: sudo -E npm run test:integration -- robustness.test.ts | |
| - name: Post-test cleanup | |
| if: always() | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Upload test logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: robustness-test-logs | |
| path: | | |
| /tmp/*-test.log | |
| /tmp/awf-*/ | |
| /tmp/copilot-logs-*/ | |
| /tmp/squid-logs-*/ | |
| retention-days: 7 | |
| test-docker-egress: | |
| name: Docker Egress Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Pre-test cleanup | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Run docker egress tests | |
| run: sudo -E npm run test:integration -- docker-egress.test.ts | |
| - name: Post-test cleanup | |
| if: always() | |
| run: sudo ./scripts/ci/cleanup.sh | |
| - name: Upload test logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: docker-egress-test-logs | |
| path: | | |
| /tmp/*-test.log | |
| /tmp/awf-*/ | |
| /tmp/copilot-logs-*/ | |
| /tmp/squid-logs-*/ | |
| retention-days: 7 |