Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Add integration tests verifying Docker CLI and daemon are unavailable in agent containers after PR #205 removed Docker-in-Docker support.

Test Coverage

  • docker command not found (which docker fails)
  • docker run fails with "command not found" error
  • docker-compose not installed
  • Docker socket not mounted at /var/run/docker.sock

Implementation

Created tests/integration/no-docker.test.ts following existing test patterns:

test('docker command should not be available', async () => {
  const result = await runner.runWithSudo('which docker', {
    allowDomains: ['github.com'],
    logLevel: 'debug',
    timeout: 30000,
  });

  expect(result).toFail();
  expect(result.exitCode).not.toBe(0);
}, 120000);

Known Issue

Tests currently fail against pre-built registry images (ghcr.io/githubnext/gh-aw-firewall/agent:latest), which were built before PR #205 and still contain Docker CLI. Tests will pass once new images are published from commit 8d81fe4 or later.

Workaround: Use buildLocal: true test option (currently blocked by NodeSource Node.js 22 installation issues).

Verification

  • Confirmed no existing integration tests depend on Docker-in-Docker functionality
  • All 549 unit tests pass
Original prompt

Add regression tests for Docker-in-Docker removal

Task Description

Add integration tests to verify that Docker commands fail gracefully after Docker-in-Docker support was removed in v0.9.1 (PR #205).

Requirements

Create new test file: tests/integration/no-docker.test.ts

Test Cases

import { runAwf } from './helpers';

describe('Docker-in-Docker removal (PR #205)', () => {
  test('docker command should not be available', async () => {
    const result = await runAwf(
      ['--allow-domains', 'github.com'],
      'which docker'
    );
    
    expect(result.exitCode).not.toBe(0);
    // Should fail because docker-cli is not installed
  });

  test('docker run should fail gracefully', async () => {
    const result = await runAwf(
      ['--allow-domains', 'github.com'],
      'docker run alpine echo hello'
    );
    
    expect(result.exitCode).not.toBe(0);
    expect(result.stderr).toContain('docker');
    // Should show helpful error if Task #2 (runtime warning) is implemented
  });

  test('docker-compose should not be available', async () => {
    const result = await runAwf(
      ['--allow-domains', 'github.com'],
      'which docker-compose'
    );
    
    expect(result.exitCode).not.toBe(0);
  });

  test('verify docker socket is not mounted', async () => {
    const result = await runAwf(
      ['--allow-domains', 'github.com'],
      'test -S /var/run/docker.sock && echo "mounted" || echo "not mounted"'
    );
    
    expect(result.exitCode).toBe(0);
    expect(result.stdout).toContain('not mounted');
  });
});

Additional Verification

Update existing integration tests to ensure they don't depend on Docker functionality.

Expected Behavior

All tests should pass, confirming that:

  1. docker-cli is not installed in agent container
  2. Docker socket is not mounted
  3. Commands fail with appropriate error codes
  4. Helpful error messages are shown (if Task Secret proxying #2 is implemented)

References


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add regression tests for Docker-in-Docker removal test: add regression tests for Docker-in-Docker removal Jan 15, 2026
Copilot AI requested a review from Mossaka January 15, 2026 23:44
@Mossaka Mossaka marked this pull request as ready for review January 15, 2026 23:47
@github-actions
Copy link

Test Coverage Report

Metric Coverage Covered/Total
Lines 77.19% 1300/1684
Statements 77.27% 1333/1725
Functions 77.17% 142/184
Branches 69.76% 450/645
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

Copilot AI and others added 2 commits January 16, 2026 00:03
Add tests to verify Docker CLI is not available in agent container after
PR #205 removed Docker-in-Docker support. Tests verify:
- docker command not available
- docker run fails gracefully
- docker-compose not available
- docker socket not mounted

Note: Tests currently fail against pre-built registry images which still
have Docker installed. Tests will pass once new images are built from
current code, or when using buildLocal (pending NodeSource fix).

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
@Mossaka Mossaka force-pushed the copilot/add-regression-tests-docker-removal branch from 0d3caec to 1b09009 Compare January 16, 2026 00:03
@github-actions
Copy link

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link

Smoke Test Results

Last 2 Merged PRs:

  • fix(deps): resolve docs npm audit
  • chore: remove security fix status file

Test Results:

  • ✅ GitHub MCP: Successfully retrieved PR data
  • ✅ File Writing: Created /tmp/gh-aw/agent/smoke-test-copilot-21050689031.txt
  • ✅ Bash Tool: Verified file content

Status: PASS

📰 BREAKING: Report filed by Smoke Copilot fer issue #223 🗺️

@Mossaka Mossaka merged commit 0e2fe3c into main Jan 16, 2026
37 of 38 checks passed
@Mossaka Mossaka deleted the copilot/add-regression-tests-docker-removal branch January 16, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants