Skip to content

Add pytest CI workflow#79

Merged
realmarcin merged 1 commit into
mainfrom
pytest-ci-workflow
May 26, 2026
Merged

Add pytest CI workflow#79
realmarcin merged 1 commit into
mainfrom
pytest-ci-workflow

Conversation

@realmarcin
Copy link
Copy Markdown
Contributor

Summary

#71 added 43 unit tests across 4 files locking in idempotency, header validation, and other pipeline contracts — but none of them run in CI. validate-strict.yaml only checks per-record schema validity; it can't catch a regression that, say, breaks grounded_keys propagation in ground_causal_nodes.py or removes self-suppression from audit_writers.py.

This adds .github/workflows/pytest.yaml mirroring validate-strict.yaml's shape.

Behavior

  • Triggers: pull_request and push to main (path-filtered), plus workflow_dispatch.
  • Paths watched: scripts/**, src/traitmech/**, tests/**, pyproject.toml, the workflow file itself.
  • Runner: ubuntu-latest, Python 3.12 via astral-sh/setup-uv@v3.
  • uv sync --extra dev (pytest is in the dev extra per pyproject.toml).
  • uv run pytest tests/ -v --tb=short for readable failures in the run page.

Verified locally

$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/pytest.yaml'))"
yaml ok

$ uv run pytest tests/ -q
56 passed in 2.72s

Test plan

  • Workflow YAML parses
  • Tests pass locally
  • First CI run on this PR exercises the workflow (it touches .github/workflows/pytest.yaml, which is in its own path filter)

🤖 Generated with Claude Code

#71 added 43 unit tests across 4 files locking in idempotency,
header validation, and other pipeline contracts — but none of
them run in CI. validate-strict.yaml only checks per-record schema
validity; it can't catch a regression that, say, breaks
grounded_keys propagation in ground_causal_nodes.py or removes
self-suppression from audit_writers.py.

This workflow mirrors validate-strict.yaml's shape:
- Triggers on PRs and pushes-to-main that touch scripts/**,
  src/traitmech/**, tests/**, pyproject.toml, or this workflow.
- Uses astral-sh/setup-uv@v3 + Python 3.12 + uv sync --extra dev
  (pytest is in the dev extra per pyproject.toml).
- Runs uv run pytest tests/ with -v --tb=short for readable
  failures in the GitHub Actions log.

Verified locally:
  - python3 -c "import yaml; yaml.safe_load(open(...))" → yaml ok
  - uv run pytest tests/ → 56 passed

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 02:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to run the repository’s Python unit tests in CI so that the existing tests/ suite is enforced on pull requests and main-branch pushes (complementing the existing schema/validation workflows).

Changes:

  • Introduces a new .github/workflows/pytest.yaml workflow triggered on PRs and pushes to main with path filters.
  • Uses astral-sh/setup-uv@v3 + Python 3.12 and installs dev extras (uv sync --extra dev) before running pytest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@realmarcin realmarcin merged commit b0b9712 into main May 26, 2026
2 checks passed
@realmarcin realmarcin deleted the pytest-ci-workflow branch May 26, 2026 04:58
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