Skip to content

Commit 91b9ac4

Browse files
author
Brain
committed
fix(test): honor desired-state schema in default-branch regressions
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
1 parent 7457bda commit 91b9ac4

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/workflows/_ci-relay.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ jobs:
486486
;"
487487
- name: Git default-branch route and clone regressions
488488
env:
489+
# The preceding step already applied and reconciled schema/schema.sql.
490+
BUZZ_TEST_SCHEMA_MODE: desired
489491
BUZZ_TEST_DATABASE_URL: postgres://buzz:${{ env.BUZZ_TEST_POSTGRES_PASSWORD }}@localhost:5432/buzz
490492
BUZZ_TEST_REDIS_URL: redis://localhost:6379
491493
BUZZ_TEST_S3_ENDPOINT: http://localhost:9000

‎crates/buzz-relay/src/api/git/settings_tests.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ mod external_infra {
4848
config.media.s3_secret_key = "buzz_dev_secret".into();
4949
let pool = sqlx::PgPool::connect(&config.database_url).await.unwrap();
5050
let db = buzz_db::Db::from_pool(pool.clone());
51-
db.migrate().await.unwrap();
51+
// CI provisions schema/schema.sql with pgschema before this suite.
52+
// Only migration-backed local fixtures own the migration lifecycle.
53+
if std::env::var("BUZZ_TEST_SCHEMA_MODE").as_deref() != Ok("desired") {
54+
db.migrate().await.unwrap();
55+
}
5256
let redis_pool = deadpool_redis::Config::from_url(&config.redis_url)
5357
.create_pool(Some(deadpool_redis::Runtime::Tokio1))
5458
.unwrap();

0 commit comments

Comments
 (0)