Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test-chroot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ jobs:
name: Test Chroot Package Managers
runs-on: ubuntu-latest
timeout-minutes: 45
needs: test-chroot-languages # Run after language tests pass
# Package Manager tests install their own runtimes via setup actions
# and do not depend on the Languages job output

steps:
- name: Checkout repository
Expand Down
69 changes: 63 additions & 6 deletions .github/workflows/test-integration-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ permissions:
contents: read

jobs:
test-domain-network:
name: Domain & Network Tests
test-domain:
name: Domain Tests
runs-on: ubuntu-latest
timeout-minutes: 45

Expand Down Expand Up @@ -45,11 +45,68 @@ jobs:
echo "=== Pre-test cleanup ==="
./scripts/ci/cleanup.sh || true

- name: Run domain & network tests
- name: Run domain tests
run: |
echo "=== Running domain & network tests ==="
echo "=== Running domain tests ==="
npm run test:integration -- \
--testPathPatterns="(blocked-domains|dns-servers|empty-domains|wildcard-patterns|ipv6|localhost-access|network-security)" \
--testPathPatterns="(blocked-domains|dns-servers|empty-domains|wildcard-patterns)" \
--verbose
env:
JEST_TIMEOUT: 180000

- name: Post-test cleanup
if: always()
run: |
echo "=== Post-test cleanup ==="
./scripts/ci/cleanup.sh || true

- name: Collect logs on failure
if: failure()
run: |
echo "=== Collecting failure logs ==="
docker ps -a || true
docker logs awf-squid 2>&1 || true
docker logs awf-agent 2>&1 || true
ls -la /tmp/awf-* 2>/dev/null || true
sudo cat /tmp/awf-*/squid-logs/access.log 2>/dev/null || true

test-network:
name: Network Tests
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4

- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '22'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Build local containers
run: |
echo "=== Building local containers ==="
docker build -t ghcr.io/github/gh-aw-firewall/squid:latest containers/squid/
docker build -t ghcr.io/github/gh-aw-firewall/agent:latest containers/agent/

- name: Pre-test cleanup
run: |
echo "=== Pre-test cleanup ==="
./scripts/ci/cleanup.sh || true

- name: Run network tests
run: |
echo "=== Running network tests ==="
npm run test:integration -- \
--testPathPatterns="(ipv6|localhost-access|network-security)" \
--verbose
env:
JEST_TIMEOUT: 180000
Expand Down Expand Up @@ -163,7 +220,7 @@ jobs:
run: |
echo "=== Running container & ops tests ==="
npm run test:integration -- \
--testPathPatterns="(container-workdir|environment-variables|error-handling|exit-code-propagation|log-commands|no-docker|volume-mounts)" \
--testPathPatterns="(container-workdir|environment-variables|error-handling|exit-code-propagation|log-commands|no-docker|volume-mounts|skip-pull)" \
--verbose
env:
JEST_TIMEOUT: 180000
Expand Down
2 changes: 1 addition & 1 deletion src/docker-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ describe('docker-manager', () => {

expect(mockExecaFn).toHaveBeenCalledWith(
'docker',
['compose', 'down', '-v'],
['compose', 'down', '-v', '-t', '1'],
{ cwd: testDir, stdout: process.stderr, stderr: 'inherit' }
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/docker-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ export async function stopContainers(workDir: string, keepContainers: boolean):
logger.info('Stopping containers...');

try {
await execa('docker', ['compose', 'down', '-v'], {
await execa('docker', ['compose', 'down', '-v', '-t', '1'], {
cwd: workDir,
stdout: process.stderr,
stderr: 'inherit',
Expand Down
Loading