Browse Source

Provision a postgres db for tests

Cesar Rodas 3 months ago
parent
commit
6378434c6d
2 changed files with 3 additions and 6 deletions
  1. 2 0
      .github/workflows/ci.yml
  2. 1 6
      crates/cdk-postgres/src/db.rs

+ 2 - 0
.github/workflows/ci.yml

@@ -262,6 +262,8 @@ jobs:
           shared-key: "stable"
       - name: Test fake mint
         run: nix develop -i -L .#stable --command just test-pure ${{ matrix.database }}
+      - name: Install Postgres
+        run: bash -x crates/cdk-postgres/start_db_for_test.sh
       - name: Test mint
         run: nix develop -i -L .#stable --command just test
 

+ 1 - 6
crates/cdk-postgres/src/db.rs

@@ -23,12 +23,7 @@ fn to_pgsql_error(err: PgError) -> Error {
 pub async fn pg_batch(conn: &Client, statement: Statement) -> Result<(), Error> {
     let (sql, _placeholder_values) = statement.to_sql()?;
 
-    run_db_operation(
-        &sql,
-        async { conn.batch_execute(&sql).await },
-        to_pgsql_error,
-    )
-    .await
+    run_db_operation(&sql, conn.batch_execute(&sql), to_pgsql_error).await
 }
 
 #[inline(always)]