Skip to content

Add trace log level using debug npm package for flexible verbosity control #45

Add trace log level using debug npm package for flexible verbosity control

Add trace log level using debug npm package for flexible verbosity control #45

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
id: run-tests
run: |
sudo -E npm run test:integration -- basic-firewall.test.ts 2>&1 | tee test-output.log
continue-on-error: true
- name: Generate test summary
if: always()
run: |
npx tsx scripts/ci/generate-test-summary.ts "basic-firewall.test.ts" "Basic Firewall Tests" test-output.log
- name: Check test results
if: steps.run-tests.outcome == 'failure'
run: exit 1
- 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
id: run-tests
run: |
sudo -E npm run test:integration -- robustness.test.ts 2>&1 | tee test-output.log
continue-on-error: true
- name: Generate test summary
if: always()
run: |
npx tsx scripts/ci/generate-test-summary.ts "robustness.test.ts" "Robustness Tests" test-output.log
- name: Check test results
if: steps.run-tests.outcome == 'failure'
run: exit 1
- 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
id: run-tests
run: |
sudo -E npm run test:integration -- docker-egress.test.ts 2>&1 | tee test-output.log
continue-on-error: true
- name: Generate test summary
if: always()
run: |
npx tsx scripts/ci/generate-test-summary.ts "docker-egress.test.ts" "Docker Egress Tests" test-output.log
- name: Check test results
if: steps.run-tests.outcome == 'failure'
run: exit 1
- 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