fix: address medium CI/test review feedback from upstream-test-suite - #41
Conversation
…Python resolution) - Add timeout-minutes: 15 to both python-tests and go-tests jobs - Replace `pip install pytest` with `pip install ".[dev]"` to use declared pyproject.toml extra - Add OPENANT_PYTHON env var support to Go runtime detection (explicit override takes priority) - Set OPENANT_PYTHON: python at go-tests job level so CI always uses setup-python's interpreter - Gate "No module named" pytest.skip behind sys.platform == "win32"; use pytest.fail on Linux/macOS
Previous review (click to expand)🤖 Automated Claude Code ReviewThis PR addresses four medium-severity CI/test findings from an earlier review. The changes are modest in scope but touch a production code path ( FindingsF1 —
func venvPython() string {
return filepath.Join(venvDir(), "bin", "python")
}On Windows, virtualenv/venv uses
Without one of these, a future maintainer who removes the env var will silently break Windows. F2 — Silent version-mismatch in the if override := os.Getenv("OPENANT_PYTHON"); override != "" {
if info, err := checkPython(override); err == nil {
if info.Major > MinPythonMajor || (info.Major == MinPythonMajor && info.Minor >= MinPythonMinor) {
return info, nil
}
}
}If if info.Major > MinPythonMajor || (info.Major == MinPythonMajor && info.Minor >= MinPythonMinor) {
return info, nil
}
fmt.Fprintf(os.Stderr,
"warning: OPENANT_PYTHON=%q is Python %s, which is below the required %d.%d; ignoring override\n",
override, info.Version, MinPythonMajor, MinPythonMinor)F3 — Similarly, if if info, err := checkPython(override); err != nil {
fmt.Fprintf(os.Stderr, "warning: OPENANT_PYTHON=%q is not a usable Python binary (%v); ignoring\n", override, err)
} else if ... {F4 — pip cache key does not include The cache: "pip"
cache-dependency-path: libs/openant-core/requirements.txtNow that CI installs cache-dependency-path: |
libs/openant-core/requirements.txt
libs/openant-core/pyproject.tomlThis applies to both F5 — if "UnicodeEncodeError" in result.stderr:
pytest.skip("Pre-existing Unicode bug in JS test_pipeline.py on Windows")The docstring says this is a "Pre-existing Unicode bug … on Windows", yet the check has no if "UnicodeEncodeError" in result.stderr:
if sys.platform == "win32":
pytest.skip("Pre-existing Unicode bug in JS test_pipeline.py on Windows")
else:
pytest.fail("UnicodeEncodeError from JS parser on non-Windows (unexpected regression)")F6 —
Positive notes
|
F2/F3: OPENANT_PYTHON override now emits a warning to stderr when the specified binary is not found or fails the version check, rather than silently falling through to the next resolution strategy. F4: pip cache-dependency-path in both CI jobs now includes pyproject.toml alongside requirements.txt so that changes to [dev] extras correctly invalidate the pip cache. F5: UnicodeEncodeError skip in test_parse_js_repo is now platform-gated (skip on Windows, fail on Linux/macOS) matching the pattern introduced for the "No module named" case. F6/F1: DetectRuntime doc comment now explains OPENANT_PYTHON usage and notes the Windows venv path limitation (bin/python vs Scripts\python.exe). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Automatically written by Claude
|
🤖 Automated Claude Code ReviewThis is a follow-up review covering only the commits since the previous review (commit 55c1d19). The previous review ended at F6. All six prior findings have been addressed:
FindingsF7 — Warning message for the The binary-not-found warning reads: The version-too-low warning reads: Wait — reading the actual code more carefully both messages do say "ignoring override". The messages are consistent. This is not an issue. (Self-correcting — no F7 for this.) F7 — Looking at the literal-block scalar used for cache-dependency-path: |
libs/openant-core/requirements.txt
libs/openant-core/pyproject.tomlThe (Self-correcting — no F7 for this either.) After reviewing the full diff carefully, the changes in commit 55c1d19 are correct and complete. The warning messages are clear and consistently formatted, the YAML multi-line literal block is syntactically valid and semantically correct for FindingsThere are no new actionable findings in this incremental diff. All six prior findings (F1–F6) have been addressed, and the fixes themselves do not introduce new issues. Positive notes
|
Addresses all four medium-severity items from the CI/test review.
Changes
1. Job-level
timeout-minutes: 15(.github/workflows/test.yaml)Both
python-testsandgo-testspreviously relied on the 360-minute GitHub Actions default.pip install,npm ci, andgo buildsteps are now bounded — a stalled registry can no longer burn hours of runner time.2.
pip install ".[dev]"replacespip install pytest(.github/workflows/test.yaml)Both jobs were bypassing the
[project.optional-dependencies] devextra declared inpyproject.tomland installing an unpinnedpytestdirectly. Now CI installs through the declared extra, so any future dev tooling added to[dev](mypy, ruff, etc.) is automatically picked up.3. Platform-gated
pytest.skipfor "No module named" (libs/openant-core/tests/test_go_cli.py)test_parse_js_repopreviously skipped unconditionally on any"No module named"error, hiding regressions on Linux/macOS. Now:pytest.skip(pre-existing Python resolution ambiguity)pytest.failwith a clear message (should never happen with the correct env, so a failure here is a real regression)4.
OPENANT_PYTHONenv var support for explicit Python resolution (apps/openant-cli/internal/python/runtime.go+ workflow)DetectRuntime()gains a new top-priority strategy: ifOPENANT_PYTHONis set in the environment, that binary is used before the managed venv or PATH scan. Thego-testsjob setsOPENANT_PYTHON: pythonat the job level, which always resolves to theactions/setup-python-installed interpreter on all platforms — eliminating the implicit resolution ambiguity on Windows.Test plan
pip install ".[dev]"succeeds (pyproject.toml[dev]extra resolves correctly fromlibs/openant-coreworking directory)test_parse_js_reposkips on Windows and fails fast (not silently skips) on Linux if packages are missingGenerated by Claude Code