diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index c039fb6b2e..1ec9e7f338 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -66,10 +66,18 @@ jobs: if: always() && steps.install-extensions.outcome == 'success' timeout-minutes: 60 uses: ./.github/composite-actions/run-jdbc-tests + + - name: Drop and re-create Babelfish database + id: re-install-extensions-1 + if: always() && steps.install-extensions.outcome == 'success' + run: | + sudo ~/psql/bin/psql -d postgres -U runner -v user="jdbc_user" -v db="babelfish_db" -f .github/scripts/cleanup_babelfish_database.sql + sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d postgres -U runner -v user="jdbc_user" -v db="babelfish_db" -v migration_mode="multi-db" -v tsql_port=1433 -v parallel_query_mode=false -f .github/scripts/create_extension.sql + sqlcmd -S localhost -U "jdbc_user" -P 12345678 -Q "SELECT @@version GO" - name: Run Dotnet Tests id: install-and-run-dotnet - if: always() && steps.install-extensions.outcome == 'success' + if: always() && steps.re-install-extensions-1.outcome == 'success' uses: ./.github/composite-actions/install-and-run-dotnet - name: Run ODBC Tests @@ -78,7 +86,7 @@ jobs: uses: ./.github/composite-actions/install-and-run-odbc - name: Drop and re-create Babelfish database - id: re-install-extensions + id: re-install-extensions-2 if: always() && steps.install-extensions.outcome == 'success' run: | sudo ~/psql/bin/psql -d postgres -U runner -v user="jdbc_user" -v db="babelfish_db" -f .github/scripts/cleanup_babelfish_database.sql @@ -87,7 +95,7 @@ jobs: - name: Run Python Tests id: install-and-run-python - if: always() && steps.re-install-extensions.outcome == 'success' + if: always() && steps.re-install-extensions-2.outcome == 'success' uses: ./.github/composite-actions/install-and-run-python - name: Generate code coverage HTML report diff --git a/.github/workflows/jdbc-tests-pgaudit-enable.yml b/.github/workflows/jdbc-tests-pgaudit-enable.yml index 0591088460..49d338b6a5 100644 --- a/.github/workflows/jdbc-tests-pgaudit-enable.yml +++ b/.github/workflows/jdbc-tests-pgaudit-enable.yml @@ -129,9 +129,18 @@ jobs: timeout-minutes: 60 uses: ./.github/composite-actions/run-jdbc-tests + - name: Drop and re-create Babelfish database with pgaudit installed + id: re-install-extensions + if: always() && steps.install-extensions.outcome == 'success' + run: | + sudo ~/psql/bin/psql -d postgres -U runner -v user="jdbc_user" -v db="babelfish_db" -f .github/scripts/cleanup_babelfish_database.sql + sudo ~/psql/bin/psql -v ON_ERROR_STOP=1 -d postgres -U runner -v user="jdbc_user" -v db="babelfish_db" -v migration_mode="multi-db" -v tsql_port=1433 -v parallel_query_mode=false -f .github/scripts/create_extension.sql + sudo PGPASSWORD=12345678 ~/${{ env.INSTALL_DIR }}/bin/psql -v ON_ERROR_STOP=1 -h localhost -d babelfish_db -U jdbc_user -c "CREATE EXTENSION pgaudit;" + sqlcmd -S localhost -U "jdbc_user" -P 12345678 -Q "SELECT @@version GO" + - name: Run Dotnet Tests id: run-dotnet-tests - if: always() && steps.install-extensions.outcome == 'success' + if: always() && steps.re-install-extensions.outcome == 'success' uses: ./.github/composite-actions/install-and-run-dotnet - name: Start secondary server