Skip to content

Handle missing Python tests in CI - #76

Merged
PeterWaIIace merged 3 commits into
mainfrom
copilot/fix-failing-github-actions-job
Jun 8, 2026
Merged

Handle missing Python tests in CI#76
PeterWaIIace merged 3 commits into
mainfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The build (3.11) GitHub Actions job was failing in make test, not in dependency installation or static analysis. The test target invoked unittest with a literal tests/test_* module path, which breaks when the repository has no matching Python test files.

  • Root cause

    • make test ran:
      uv run -m unittest tests/test_*
    • With no tests/test_*.py files present, unittest attempted to import tests/test_* as a module and failed with ModuleNotFoundError.
  • Change

    • Updated the Makefile test target to detect whether any tests/test_*.py files exist before invoking Python tests.
    • When tests are present, it now uses unittest discover.
    • When no matching files exist, it exits cleanly with an explicit skip message.
  • Behavior

    • Test execution remains unchanged for repositories that add tests/test_*.py files later.
    • Repositories without Python tests no longer fail CI on the test step.
@if [ -d tests ] && find tests -maxdepth 1 -type f -name 'test_*.py' -print -quit | grep -q .; then \
	${PYTHON} -m unittest discover -s tests -p 'test_*.py'; \
else \
	echo "No test files found in tests/; skipping test execution."; \
fi

Copilot AI changed the title Fix failing build (3.11) Actions job Handle missing Python tests in CI Jun 8, 2026
Copilot AI requested a review from PeterWaIIace June 8, 2026 22:49
@PeterWaIIace
PeterWaIIace marked this pull request as ready for review June 8, 2026 22:55
@PeterWaIIace
PeterWaIIace merged commit 5961d86 into main Jun 8, 2026
1 check passed
@PeterWaIIace
PeterWaIIace deleted the copilot/fix-failing-github-actions-job branch June 8, 2026 22:55
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.

2 participants