Skip to content

test: add --skip-pull integration test#1222

Open
Mossaka wants to merge 1 commit intomainfrom
fix/071-skip-pull-integration-test
Open

test: add --skip-pull integration test#1222
Mossaka wants to merge 1 commit intomainfrom
fix/071-skip-pull-integration-test

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Mar 11, 2026

Summary

  • Adds skipPull option to AwfRunner test fixture
  • Creates tests/integration/skip-pull.test.ts with 3 integration tests:
    • Success when images are pre-downloaded
    • Error when images not available locally
    • Rejection of --skip-pull with --build-local

Fixes #497

Test plan

  • Unit tests pass (839)
  • Lint passes
  • CI integration tests pass

🤖 Generated with Claude Code

Add integration tests for the --skip-pull flag covering:
- Success when images are pre-downloaded (build-local first, then skip-pull)
- Error when images are not available locally (non-existent tag)
- Rejection of --skip-pull with --build-local (incompatible flags)

Also adds skipPull option to AwfRunner in both run() and runWithSudo().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 11, 2026 01:24
@github-actions
Copy link
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.37% 82.51% 📈 +0.14%
Statements 82.27% 82.41% 📈 +0.14%
Functions 82.60% 82.60% ➡️ +0.00%
Branches 74.21% 74.30% 📈 +0.09%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/docker-manager.ts 83.4% → 84.0% (+0.54%) 82.8% → 83.3% (+0.52%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds integration coverage for the CLI --skip-pull behavior by extending the integration test runner fixture and introducing a dedicated integration test suite.

Changes:

  • Extend AwfRunner fixture to support a skipPull option that passes --skip-pull to the CLI.
  • Add tests/integration/skip-pull.test.ts covering: cached-image success, missing-image failure, and --skip-pull + --build-local incompatibility.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/integration/skip-pull.test.ts New integration tests validating --skip-pull behavior and error handling.
tests/fixtures/awf-runner.ts Adds skipPull to fixture options and wires it into CLI arg construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to +38
// First, ensure images exist locally by building them
const buildResult = await runner.runWithSudo(
'echo "images built"',
{
allowDomains: ['github.com'],
buildLocal: true,
logLevel: 'debug',
timeout: 120000,
}
);
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “pre-download” step uses buildLocal: true, but --build-local builds Compose services without an image: name (Compose auto-names them), while the subsequent --skip-pull run uses GHCR image: ${registry}/…:${tag}. This means the first run does not actually populate the local cache for the images that --skip-pull will try to start, so this test can fail even though the intent is to validate cached-pull behavior.

To make this deterministic, prime the cache by running once with the same GHCR image settings (i.e., without --skip-pull and without --build-local) or explicitly docker pull the expected ${registry}/{squid,agent,api-proxy}:<tag> images before running with --skip-pull.

Suggested change
// First, ensure images exist locally by building them
const buildResult = await runner.runWithSudo(
'echo "images built"',
{
allowDomains: ['github.com'],
buildLocal: true,
logLevel: 'debug',
timeout: 120000,
}
);
// First, ensure images exist locally by running once without --skip-pull or --build-local
const buildResult = await runner.runWithSudo(
'echo "images built"',
{
allowDomains: ['github.com'],
logLevel: 'debug',
timeout: 120000,
}
);

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

Smoke Test Results — Run #22932163743

✅ GitHub MCP — Last 2 merged PRs: fix(squid): block direct IP connections that bypass domain filtering (#1160), feat: combine all build-test workflows into single build-test.md (#1157)
✅ Playwright — github.com title contains "GitHub"
✅ File write — /tmp/gh-aw/agent/smoke-test-copilot-22932163743.txt created
✅ Bash — File verified via cat

Overall: PASS | Author: @Mossaka | No assignees

📰 BREAKING: Report filed by Smoke Copilot for issue #1222

@github-actions
Copy link
Contributor

Smoke Test Results — PASS

💥 [THE END] — Illustrated by Smoke Claude for issue #1222

@github-actions
Copy link
Contributor

Merged PRs: "fix(squid): block direct IP connections that bypass domain filtering"; "feat: combine all build-test workflows into single build-test.md"
GitHub MCP review last 2 merged PRs: ✅
safeinputs-gh PR list: ✅
Playwright github title contains "GitHub": ✅
Tavily web search: ❌ (Tavily MCP not available)
File write test: ✅
Bash cat verify: ✅
Discussion comment added: ✅
Build npm ci && npm run build: ✅
Overall status: FAIL

🔮 The oracle has spoken through Smoke Codex for issue #1222

@github-actions
Copy link
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #1222 ·

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.

Add integration test for --skip-pull flag

2 participants