Skip to content

fix(ci): unbreak the Windows and macOS unit-test smoke jobs on every PR - #4562

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:kalin/fix-smoke-tests
Oct 2, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
kovtcharov:kalin/fix-smoke-tests

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

Every open PR fails the Windows and macOS unit-test smoke jobs on code that is already on main. Those jobs only run on PRs, so main looks green while each PR inherits two red checks. After this, the smoke jobs only fail on what a PR actually changed.

  • macOS: the edit-impact check (feat(tools): an edit to a Python function lists the project code it reaches #4535) found no callers of a changed function, because macOS git grep -E has no \b or \s. The patterns now use POSIX classes, so this is a real bug fix for macOS users, not just a test fix.
  • Windows: a store test asserted POSIX file mode 0600. Windows has no mode bits, and the store's Windows ACL is already tested in the same file.

Test plan

  • CI: "Unit Tests (macOS smoke)" passes, including tests/unit/agents/test_edit_impact.py
  • CI: "Unit Tests (Windows smoke)" passes, including tests/unit/engineering/test_store.py
  • Locally on Windows: both files pass (25 tests); the new patterns match levels( and def levels ( and skip alevels
  • python util/lint.py --black --isort

Every open PR failed "Unit Tests (Windows smoke)" and "(macOS smoke)" on
code already on main. Those jobs run only on PRs, so main stayed green.

- macOS: edit_impact searched callers with `\b` and `\s` in git grep -E,
  which macOS's regex does not support, so it found no callers there. It
  now uses POSIX classes, which every git grep accepts.
- Windows: test_store asserted POSIX mode 0600; Windows has no mode bits,
  and the store's ACL is tested separately in the same file.
@github-actions github-actions Bot added tests Test changes agents labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve

This fixes the two smoke-job failures every PR inherits from main, and the macOS half is a real bug fix: the edit-impact check could not find callers there, because macOS git grep doesn't understand the word-boundary and whitespace shortcuts the old patterns used. The new patterns stick to standard POSIX syntax and behave the same as before. The Windows change only skips a file-permission assertion that has no meaning on Windows. Nothing blocks the merge.

Real-world evidence

N/A: no evidence bundle was produced. This PR touches CI and an internal tool helper, with no CLI, API, MCP or Agent UI surface. I ran both new patterns through a real git grep -E on Linux, and they behaved as the PR describes (output below). The macOS and Windows results still depend on the CI smoke jobs listed in the test plan.

$ git grep -n -E '(^|[^[:alnum:]_])levels([^[:alnum:]_]|$)' -- '*.py'
a.py:1:x = levels(1)
a.py:3:def  levels (a):
a.py:5:z=levels            # `alevels(2)` on line 2 correctly not matched
$ git grep -n -E 'def[[:space:]]+levels[[:space:]]*\(' -- '*.py'
a.py:3:def  levels (a):
🔍 Technical details

Issues found

🟢 No unit test pins the boundary semantics (tests/unit/agents/test_edit_impact.py): the existing tests cover "callers are found", but none of them checks that a name used as a substring (alevels) is skipped, or that def name ( with extra spaces counts as a definition. You verified both by hand. A small case in the existing repo fixture would stop a later edit from bringing back \b or \s without anyone noticing.

🟢 Comment slightly overstates coverage (tests/unit/engineering/test_store.py:56): the ACL tests below lock down the store directory through private_directory. They don't check the job file's own permissions. Consider "Windows has no mode bits; the store directory's ACL is tested below."

Strengths

  • The regex is safe as written: re.escape on a Python identifier adds no backslashes, so the ERE that reaches git grep is plain POSIX on every platform.
  • (^|[^[:alnum:]_])…([^[:alnum:]_]|$) is the right portable replacement for \b. Lines are matched one at a time, so the anchors behave correctly.
  • The Windows guard skips only the assertion that cannot hold there. It doesn't skip the whole test, so the concurrency checks still run on Windows.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 2, 2026
Merged via the queue into amd:main with commit 842d014 Oct 2, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/fix-smoke-tests branch October 2, 2026 06:24
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Oct 4, 2026
…md#4662)

Every open PR shows these two failures; this clears them. The macOS one
is fixed here; the Windows one is fixed by amd#4585, so the smoke jobs go
green once both merge.

- **macOS, `test_memory_turn_recall`:** an audio test imported the
Whisper ASR module, and that import loaded torch. Once torch is loaded,
macOS has two OpenMP runtimes in the process (torch's and faiss's), so
memory recall refuses every faiss search for the rest of the run. torch
and whisper are now imported only when an ASR is actually created. The
recall test runs and passes; it isn't skipped. amd#4580 handles this
failure by skipping the test, so drop that half of amd#4580 when this
merges.
- **Windows, `test_resolves_direct_shebang_posix`:** the test faked
Linux by patching `sys.platform` for the whole process. pyfakefs
teardown then took the POSIX path and called `os.getuid`, which doesn't
exist on Windows. amd#4585 now patches only the uninstall module's view of
the platform, so this PR doesn't touch it.

The macOS failure dates from amd#4061 (Sep 28), which added the recall test
after the torch-loading audio test from amd#3616. The smoke job runs with
`-x`, so earlier failures hid it until amd#4562 fixed those on Oct 2.

## Test plan
- [x] New `test_importing_whisper_asr_does_not_load_torch` fails on main
and passes here
- [x] Locally on macOS, all audio and memory tests in CI order: 433
passed, `test_memory_turn_recall` included
- [x] Locally on macOS, every unit test up to and including the recall
test: torch never loads, and recall passes. The 13 failures are local
env noise (CLI binaries not on PATH, pip frontends); none import the
audio module
- [ ] CI: "Unit Tests (macOS smoke)" passes `test_memory_turn_recall.py`

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants