Skip to content

Add integration tests for executables approval gate#1785

Merged
danielmeppiel merged 1 commit into
mainfrom
sergio-sisternes-epam/boost-executables-coverage
Jun 15, 2026
Merged

Add integration tests for executables approval gate#1785
danielmeppiel merged 1 commit into
mainfrom
sergio-sisternes-epam/boost-executables-coverage

Conversation

@sergio-sisternes-epam

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1723. Adds 71 integration tests covering the executable approval gate modules, boosting integration coverage:

  • security/executables.py: 15% -> 84%
  • install/exec_gate.py: -> 93%
  • commands/approve.py: 10% -> 90%

Tests cover

  • Real filesystem scanning (hooks, bin, MCP, symlinks)
  • Approval checking logic (approve/deny, partial, fallback keys)
  • parse_allow_executables / write_allow_executables roundtrip
  • check_executable_approval pipeline helper with context tracking
  • resolve_package_key with dep-ref and name#version fallback
  • log_bin_status message variants
  • apm approve / apm deny CLI commands via CliRunner
  • Non-interactive CI mode (SystemExit on unapproved)
  • --trust-all / --no-executables flags

Context

The merge queue fail-under=70 gate is a repo-wide issue (PRs #1772, #1689, #1766, #1767 also affected). This PR contributes +0.25% to the total, addressing the modules introduced by #1723.

Boost integration coverage for security/executables.py (15% -> 84%),
install/exec_gate.py (-> 93%), and commands/approve.py (10% -> 90%).

71 tests covering:
- Real filesystem scanning (hooks, bin, MCP, symlinks)
- Approval checking logic
- parse/write_allow_executables roundtrip
- check_executable_approval pipeline helper
- resolve_package_key with dep-ref and fallback
- log_bin_status message variants
- approve/deny CLI commands via CliRunner
- Non-interactive CI mode (SystemExit on unapproved)
- trust_all / no_executables flags

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new integration test suite to exercise the executable approval gate end-to-end at the helper/CLI level (filesystem scanning, allowExecutables parsing/writing, approval resolution, non-interactive CI behavior, and apm approve/apm deny Click commands), aiming to raise integration coverage for the gate modules introduced in #1723.

Changes:

  • Introduces tests/integration/test_executables_gate_integration.py with broad coverage across scanning, key resolution, approval checks, prompt behavior, and approve/deny CLI flows.
  • Exercises real filesystem layouts (.apm/hooks, hooks/, bin/, .apm/skills/*/bin/) and manifest roundtrips for allowExecutables.
  • Adds integration assertions around install-pipeline helpers (check_executable_approval, resolve_package_key, log_bin_status).

pkg_info = MagicMock()
dep_ref = MagicMock()
dep_ref.canonical_string.return_value = ""
dep_ref.__str__ = lambda self: "./local/path"
@danielmeppiel danielmeppiel merged commit 42b8df1 into main Jun 15, 2026
21 checks passed
@danielmeppiel danielmeppiel deleted the sergio-sisternes-epam/boost-executables-coverage branch June 15, 2026 19:48
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.

3 participants