Skip to content

Bug: sensor test fails on macOS; CI only runs on Ubuntu. Add macOS and Windows to the matrix and fix what breaks #113

Closed

Description

@vsn411

Problem: .github/workflows/ci.yml tests on ubuntu-latest only, for Python 3.10 and 3.12. secfoo ships binaries for macOS (arm64 and x64) and Windows, uses os.killpg in agents/base.py with a separate Windows branch, has a Windows-only codex -c windows.sandbox path, and the SARIF exporter special-cases Windows paths. None of that runs in CI. The first known break, reproduced on macOS 15 (Darwin 24.6) with Python 3.12, is deterministic, not flaky:

tests/test_sensor/test_python_probe.py::test_sensor_dying_mid_run_drops_events_without_blocking
>       assert results[-1] is False
E       assert True is False

(three consecutive runs, also on an untouched main checkout). The probe's send after the sensor dies still returns True on macOS, which suggests the socket error path differs from Linux (e.g. EPIPE vs ECONNRESET, or buffered sends succeeding before the RST arrives).

Build:

  1. Extend the CI matrix to macos-14 and windows-latest (keep both Python versions on Ubuntu; one version on the others is enough). Mark steps that are Linux-only (secfoo sensor conformance if it cannot run elsewhere) rather than skipping the whole job.
  2. Fix the macOS sensor failure in src/secfoo/sensor/probe.py (or the test, if the test's assumption is Linux-specific; say which and why).
  3. Fix whatever else fails. Likely candidates: path handling in fingerprints (_normalize_path, lstrip("./")), temp-dir cleanup of shallow clones on Windows (targets/), _kill_process_tree on Windows, console encoding of box-drawing characters on the Windows runner (PYTHONIOENCODING), and Path.as_uri() in report/sarif.py.
  4. Add skipif markers only with a comment naming the OS limitation; no blanket skips.

Where to look: .github/workflows/ci.yml, src/secfoo/sensor/probe.py, tests/test_sensor/test_python_probe.py, src/secfoo/agents/base.py (_kill_process_tree), src/secfoo/agents/codex.py, src/secfoo/targets/, src/secfoo/report/sarif.py.

Done when: CI is green on Ubuntu, macOS and Windows with no || true; the macOS sensor test passes for the right reason (explained in the PR); the skipif markers added are listed in the PR with a one-line reason each.

Activity

  1. added
    bug
    help wanted
    hackathon
    difficulty: medium
    on Nov 15, 2026
  2. aaas72 commented on Nov 21, 2026

    @aaas72
    Contributor

    Hi! I'd like to take this one. Plan: add macos-14 and windows-latest to the CI matrix (both Python versions stay on Ubuntu, one on the others), and mark the Linux-only steps instead of skipping whole jobs. Then work out why the probe's send still returns True after the sensor dies on macOS, and fix it in sensor/probe.py, or in the test if its assumption is Linux-specific, saying which and why. After that, fix whatever else breaks (path normalization in fingerprints, clone cleanup and _kill_process_tree on Windows, console encoding, Path.as_uri() in SARIF). Every skipif gets a one-line OS reason, listed in the PR.

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

    bugdifficulty: mediumhackathonhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions