Skip to content

Add integration and stability tests#20

Merged
maxmalkin merged 27 commits intomainfrom
add-integration-stability-tests
Mar 3, 2026
Merged

Add integration and stability tests#20
maxmalkin merged 27 commits intomainfrom
add-integration-stability-tests

Conversation

@maxmalkin
Copy link
Owner

@maxmalkin maxmalkin commented Mar 2, 2026

Summary

  • Add 19 integration tests covering happy path, token verification denials, revocation propagation, concurrency, audit log integrity, and idempotency
  • Add 7 stability tests (all #[ignore]) for throughput, memory soak, concurrent grants, dependency recovery, and audit hash chain integrity
  • Include test infrastructure: TestApp with in-process Axum routers, TestSigningBackend, factory functions, and assertion helpers
  • Update license to MIT in test crate Cargo.toml files

@maxmalkin maxmalkin changed the title Add integration and stability test suites Add integration and stability tests Mar 2, 2026
maxmalkin added 10 commits March 2, 2026 14:39
Serde's #[serde(default)] only handles missing fields, not null values.
Sending "allowed_time_windows": null fails deserialization into Vec<TimeWindow>,
causing 422 responses on grant requests.
The base migration only creates 2025-01 and 2025-02 partitions.
Tests running after 2025-02 fail silently on audit inserts because
no matching partition exists for the current date.
The Capability enum uses #[serde(tag = "type", rename_all = "snake_case")]
(internally tagged), so the correct JSON is {"type": "read", "resource": "..."}
not {"Read": {"resource": "..."}} (externally tagged). The wrong format caused
422 Unprocessable Entity on grant requests and token issuance.
PostgreSQL does not support IF NOT EXISTS for partition creation.
When multiple test processes race to create the same monthly partition,
catch the 42P07 (duplicate_table) error and ignore it.
The capability_grants table has a unique index on
(agent_id, service_provider_id, md5(capabilities)). Sending identical
grant requests produces constraint violations, not the 429 flood
rejection being tested. Use a distinct service provider per request
and send sequentially so the non-atomic count check is reliable.
@maxmalkin maxmalkin merged commit 6ecc104 into main Mar 3, 2026
6 checks passed
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