Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,16 @@ jobs:
env:
DATABASE_URL: postgres://buzz:${{ env.BUZZ_TEST_POSTGRES_PASSWORD }}@localhost:5432/buzz
TEST_DATABASE_URL: postgres://buzz:${{ env.BUZZ_TEST_POSTGRES_PASSWORD }}@localhost:5432/buzz
- name: Workflow revision rollout PostgreSQL tests
# Keep mixed-version invalidation and atomic rebinding in the permanent
# Postgres gate; these cases are ignored by infrastructure-free units.
run: |
cargo nextest run \
--archive-file target/ci/backend-integration-tests.tar.zst \
-E 'package(buzz-db) and test(/^store::workflow::/)' \
--run-ignored ignored-only
env:
BUZZ_TEST_DATABASE_URL: postgres://buzz:${{ env.BUZZ_TEST_POSTGRES_PASSWORD }}@localhost:5432/buzz
- name: Database pressure observability PostgreSQL tests
# Explicit pool acquisition and advisory-lock metrics require real
# Postgres and are ignored by the infrastructure-free unit-test job.
Expand Down
31 changes: 30 additions & 1 deletion crates/buzz-db/src/runtime/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ mod tests {
let mut migrations: Vec<_> = MIGRATOR.iter().collect();
migrations.sort_by_key(|migration| migration.version);

assert_eq!(migrations.len(), 40);
assert_eq!(migrations.len(), 41);
assert_eq!(migrations[0].version, 1);
assert_eq!(&*migrations[0].description, "initial schema");
assert!(migrations[0]
Expand Down Expand Up @@ -1153,6 +1153,35 @@ mod tests {
assert!(heartbeat_vacuum.contains("vacuum_truncate = false"));
assert!(desired_schema.contains("vacuum_truncate = false"));

// Workflow revision capture is additive: nullable 32-byte event IDs on
// both the materialized definition and run, with identical fresh-schema
// constraints and no backfill hidden in startup migration state.
assert_eq!(migrations[40].version, 41);
let workflow_revision_binding = migrations[40].sql.as_str();
assert!(workflow_revision_binding.contains("ALTER TABLE workflows"));
assert!(workflow_revision_binding.contains("ALTER TABLE workflow_runs"));
assert!(workflow_revision_binding.contains("octet_length(definition_event_id) = 32"));
assert!(!workflow_revision_binding.contains("UPDATE workflows"));
let revision_guard = |sql: &str| {
let start = sql
.find("CREATE FUNCTION invalidate_workflow_revision()")
.unwrap();
let end = sql[start..]
.find("FOR EACH ROW EXECUTE FUNCTION invalidate_workflow_revision();")
.unwrap();
sql[start..start + end].to_owned()
};
assert_eq!(
revision_guard(workflow_revision_binding),
revision_guard(desired_schema)
);
assert_eq!(
desired_schema
.matches("octet_length(definition_event_id) = 32")
.count(),
2
);

// pgschema intentionally reconciles DDL, not seed DML or table storage
// parameters. Its post-apply reconciliation must restore and verify
// both parts of the live heartbeat contract for fresh bootstraps.
Expand Down
Loading