Skip to content

ci: run postgres + redis test suites with service containers#73

Merged
pratyush618 merged 4 commits intomasterfrom
ci/postgres-redis-tests
Apr 26, 2026
Merged

ci: run postgres + redis test suites with service containers#73
pratyush618 merged 4 commits intomasterfrom
ci/postgres-redis-tests

Conversation

@pratyush618
Copy link
Copy Markdown
Collaborator

Summary

  • Adds two new CI jobs — rust-test-postgres and rust-test-redis — that spin up postgres:16-alpine and redis:7-alpine as service containers and run cargo test --workspace --features <backend> against them.
  • Drops the redundant cargo check --features postgres|redis steps from the existing rust-test job (now covered by the dedicated test jobs).
  • Backend parity is now machine-verified on every PR instead of trust-based.

Why

The contract test suite at crates/taskito-core/tests/rust/storage_tests.rs is already wired to read TASKITO_POSTGRES_TEST_URL / TASKITO_REDIS_TEST_URL and runs the same run_storage_tests(&storage) block against all three backends. Until now CI only ran cargo check on those features — it compiled, but never executed a single Postgres or Redis test. This closes that gap.

Scope

Pure .github/workflows/ci.yml change. Zero code edits.

Test plan

  • PR triggers the new rust-test-postgres and rust-test-redis jobs and both go green
  • Existing rust-test, lint, and test (Python matrix) jobs continue to pass
  • If either backend job goes red, treat findings as real storage bugs and triage in a follow-up PR

@github-actions github-actions Bot added the ci label Apr 25, 2026
serde serializes JobStatus as the variant name ("Pending"/"Running"),
not the #[repr(i32)] discriminant. The Lua dup-check and race-guard
scripts compared against 0/1, so duplicate detection always missed,
the unique key got overwritten, and a fresh job was created.

Surfaced by enabling cargo test --features redis in CI (PR #73).
The Lua scripts in enqueue_unique no longer hardcode the JobStatus
variant names. They now receive the active-status values via ARGV
sourced from a new `JobStatus::wire_name()` helper — the single
source of truth for the Rust→JSON wire contract.

A unit test asserts that wire_name() matches what serde actually
emits for every variant, so any future serde rename or attribute
change breaks the build instead of silently corrupting the Redis
duplicate-detection path.
@pratyush618 pratyush618 merged commit 2f357d5 into master Apr 26, 2026
18 checks passed
@pratyush618 pratyush618 deleted the ci/postgres-redis-tests branch April 26, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant