Skip to content

test: add coverage for MCP mount/docker-arg warning propagation - #2114

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
test/mcp-validation-warning-coverage-833db1da7f272926
Draft

test: add coverage for MCP mount/docker-arg warning propagation#2114
github-actions[bot] wants to merge 1 commit into
mainfrom
test/mcp-validation-warning-coverage-833db1da7f272926

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Gap Fixes

Test suite snapshot: 3322 unit tests, ~700 integration tests, 40+ test fixtures (baseline cargo test run before this change)

Added Coverage

Module Function/Path Why It Matters Test Added
src/validate.rs validate_mount_source (docker.sock detection), surfaced via validate_stdio_mcp in src/compile/common.rs Detects a mount that grants full host Docker access / container escape; unit-tested in isolation but the full front-matter → compile → stderr path was never exercised test_compile_warns_on_docker_socket_mount
src/validate.rs validate_docker_args (--privileged flag detection) Detects privilege-escalating Docker args; only unit-tested against the raw function, not through the CLI test_compile_warns_on_privileged_docker_arg
src/validate.rs validate_docker_argsvalidate_mount_source delegation (-v/--volume smuggling a sensitive host path) Confirms args-based mount smuggling that bypasses the dedicated mounts: field still gets the delegated sensitive-path warning, end-to-end through compile test_compile_warns_on_volume_arg_smuggling_sensitive_mount

These three security-relevant validators (container escape via docker socket mounts, privilege escalation via docker args, and mounts-validation bypass) previously had only direct unit tests in src/compile/common.rs exercising the functions in isolation. Nothing asserted that the warnings actually reach the compiled CLI's stderr output when triggered through real front matter, so a regression in the validate_stdio_mcp wiring (e.g. dropping an eprintln! call or no longer iterating opts.mounts/opts.args) would have gone unnoticed by the existing suite.

Validation

  • cargo test (3322+ tests, all passing, including the 3 new tests)
  • cargo clippy --all-targets --all-features (no warnings)

This PR was created by the automated test gap finder. Modules audited this cycle: secure.rs, validate.rs (focus: MCP docker/mount validators), sanitize.rs, execute.rs, fuzzy_schedule.rs, compile/ado_bundle.rs, compile/pr_filters.rs, compile/filter_ir.rs.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Gap Finder · auto · 164.5 AIC · ⌖ 7.25 AIC · ⊞ 11.6K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants