Skip to content

test(cli): live marks sit on the tests that start a program, not on whole modules #2170

Closed

Description

@dan-petty

What happened

Five test modules set a live mark for the whole module with pytestmark. The mark tells the hermetic floor to let the named programs start, so every test in the module may start them, also the tests that should start nothing. A test that starts one of these programs by mistake then passes, and the floor does not report it.

Module live programs Tests in the module
tests/test_ci.py:55-58 devops, bash, python, ruff 89
tests/test_process.py:26-29 true, sh, false, sleep, echo, python, pwd 24
tests/test_subprocess_env_boundary.py:31 python 24
tests/test_isolation_tripwire.py:35 python 23
tests/test_cli_startup_imports.py:38 python 12

For example, the test-suite audit of 2026-10-24 at df8e2ee saw 4 of the 24 tests in tests/test_subprocess_env_boundary.py start python. In tests/test_ci.py it saw 10 test items start devops, bash or python, from 6 of its 89 test functions, and none start ruff.

What should happen

Each live mark sits on the tests that start the program, and names only the programs that each one starts. The floor refuses every program in the other tests of the module. When #2143 and the issues that follow it remove a real program from a test, its mark goes with it.

Evidence

At b170358:

  • The five pytestmark lines in the table.
  • tests/conftest.py:533-541 and :1375: the floor reads the live marks of each test.
  • .data/agent/scratch/audit/full_list.txt of the 2026-10-24 audit, sections 1.python, 1.sh and 1.live-mark.

Acceptance criteria

  • None of the five modules sets live in pytestmark.
  • Each test that starts a program carries its own live mark with only the programs it starts.
  • A test in these modules that starts a program it does not name fails at the floor. The pull request shows one such failure on a scratch change.
  • uv run devops ci passes.

Follows ADR 0007 as #2143 amends it. Related: #2069 (the second-signal test of devops ci test).

Source: #2143

Proposed design

Problem statement

Five test modules set a live mark at the module level with pytestmark. This grants every test in the module permission to start the named programs. A test that starts a forbidden program by mistake then passes, because the floor sees the module-level mark. The fix moves each live mark to the individual test that starts the program. It names only the programs that test starts.

Acceptance criteria

  • Criterion 1: None of the five modules sets live in pytestmark.
    Verification: Grep the five test files for pytestmark and confirm no live marker is present in any of them.
  • Criterion 2: Each test that starts a program carries its own live mark naming only the programs it starts.
    Verification: Run the full test suite and confirm the floor allows only the programs named on each test.
  • Criterion 3: A test that starts a program it does not name fails at the floor.
    Verification: Apply a scratch change that makes one test start an unlisted program. Confirm the test fails at the floor.
  • Criterion 4: uv run devops ci passes.
    Verification: Run uv run devops ci and confirm all checks report a passing status.

Key questions

Open questions

  • Which tests in test_ci.py start which programs? (missing verified source)
  • Which tests in test_subprocess_env_boundary.py start which programs? (missing verified source)
  • Does any test in test_ci.py start ruff? (missing verified source)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#2143

Activity

  1. added
    source/agent
    type/test
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/test. The change affects how tests are marked and executed.
    • Priority: P1-High. The change fixes a correctness issue in test execution and hermeticity.
    • Value: High. The change ensures accurate test behavior and prevents false positives in test results.
    • Effort: Medium. It requires updating marks in multiple test modules and verifying the changes.
    • Related: ci(gate): checks of committed files and tool configuration run as devops ci rows, not as pytest tests that start the tool #2164, which asks for a different change. Both items deal with test execution and program starting, but the candidate focuses on live marks placement while #2164 addresses checks in committed files.
  3. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    Refine cannot set this item to Ready at 0abf552 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Which tests in test_ci.py start which programs? (missing verified source)
    • Which tests in test_subprocess_env_boundary.py start which programs? (missing verified source)
    • Does any test in test_ci.py start ruff? (missing verified source)
  4. added
    priority/p1-high
    status/new
    effort/medium
    value/high
    scope/cli
    status/in-review
    and removed
    status/new
    on Oct 28, 2026
  5. removed
    status/in-review
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p1-highscope/clisource/agenttype/testvalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions