Skip to content

Add CI workflow and infra-free unit-test tier - #439

Merged
kthare10 merged 1 commit into
rel-2.0.1from
chore/ci-and-unit-tests
Jul 23, 2026
Merged

kthare10 merged 1 commit into
rel-2.0.1from
chore/ci-and-unit-tests

Conversation

@kthare10

Copy link
Copy Markdown
Collaborator

Summary

The repo had no CI, and every existing test requires live infrastructure (Kafka/Postgres/Neo4j/Schema Registry), so nothing ran on a pull request. This adds automated checks plus the first tier of infrastructure-free tests.

Changes

  • .github/workflows/ci.yml — runs on PRs and pushes to main/rel-2.0.1:
    • unit job (Python 3.12 & 3.13): pip install . pytest, byte-compile fabric_cf, run pytest fabric_cf/actor/test/unit -m "not integration".
    • pip-audit job (advisory / continue-on-error): dependency vulnerability scan.
  • fabric_cf/actor/test/unit/ — new unit-test tier that mocks all external dependencies (no infra needed). First tests cover PdpAuth.check_access: disabled-path short-circuit, permit, deny (with reason), non-JSON response, and wrapped HTTP error.
  • pyproject.toml — register the integration pytest marker so infra-dependent tests can be marked and excluded from the unit tier.

Verification

  • pytest fabric_cf/actor/test/unit -m "not integration"6 passed locally, no marker warnings.
  • The CI intentionally installs the package directly (pip install .) rather than the [test] extra, which still pins the unmaintained nose.

Targets rel-2.0.1 (theme 5 of the improvement sweep). This gives the other rel-2.0.1 PRs an automated check to run against.

Follow-ups (separate PRs)

  • Mark the existing infrastructure tests with @pytest.mark.integration and add a compose-backed integration job.
  • Expand the unit tier (e.g. token_validator, allocation helpers).

There was no CI in the repo; all existing tests require live infrastructure
(Kafka/Postgres/Neo4j/Schema Registry), so nothing ran on a pull request.

- Add a GitHub Actions workflow (.github/workflows/ci.yml) that installs the
  package + pytest on Python 3.12/3.13, byte-compiles fabric_cf, runs the unit
  tier with -m 'not integration', and runs pip-audit (advisory).
- Add fabric_cf/actor/test/unit/ with mocked unit tests for PdpAuth.check_access
  (disabled path, permit, deny, non-JSON, HTTP error) that need no infrastructure.
- Register the 'integration' pytest marker in pyproject so infra tests can be
  marked and excluded from the unit tier.
@kthare10
kthare10 merged commit b9eb8ed into rel-2.0.1 Jul 23, 2026
6 checks passed
@kthare10
kthare10 deleted the chore/ci-and-unit-tests branch July 23, 2026 21:50
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.

1 participant