From ac1c02c51cb3a6358ed7793053e6f0d1cb706272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Tue, 27 Feb 2024 09:35:17 +0100 Subject: [PATCH] fix(code-coverage): Correctly set up testing schema --- .github/workflows/code-coverage-v0.3.yaml | 6 ++---- .github/workflows/code-coverage-v0.4.yaml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/code-coverage-v0.3.yaml b/.github/workflows/code-coverage-v0.3.yaml index 1afa25dc..958b5aa4 100644 --- a/.github/workflows/code-coverage-v0.3.yaml +++ b/.github/workflows/code-coverage-v0.3.yaml @@ -117,10 +117,9 @@ jobs: steps: - name: Setup testing schemata in PostgreSQL - if: ${{ inputs.schemas != 'none' }} run: | set -o xtrace - IFS=',' read -ra schemas <<< "${{ inputs.schemas }}" + IFS=',' read -ra schemas <<< "test_ds,not_test_ds" for schema in "${schemas[@]}"; do psql test -c "CREATE SCHEMA \"$schema\";" done @@ -222,13 +221,12 @@ jobs: show-log: true - name: Setup testing schemata in SQL server - if: ${{ inputs.schemas != 'none' }} run: | set -o xtrace sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -Q "ALTER LOGIN SA WITH DEFAULT_DATABASE = master;" - IFS=',' read -ra schemas <<< "${{ inputs.schemas }}" + IFS=',' read -ra schemas <<< "test_ds,not_test_ds" for schema in "${schemas[@]}"; do sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "CREATE SCHEMA [$schema];" sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "GO" diff --git a/.github/workflows/code-coverage-v0.4.yaml b/.github/workflows/code-coverage-v0.4.yaml index 9556354b..da0b8c64 100644 --- a/.github/workflows/code-coverage-v0.4.yaml +++ b/.github/workflows/code-coverage-v0.4.yaml @@ -194,10 +194,9 @@ jobs: steps: - name: Setup testing schemata in PostgreSQL - if: ${{ inputs.schemas != 'none' }} run: | set -o xtrace - IFS=',' read -ra schemas <<< "${{ inputs.schemas }}" + IFS=',' read -ra schemas <<< "test_ds,not_test_ds" for schema in "${schemas[@]}"; do psql test -c "CREATE SCHEMA \"$schema\";" done @@ -303,13 +302,12 @@ jobs: show-log: true - name: Setup testing schemata in SQL server - if: ${{ inputs.schemas != 'none' }} run: | set -o xtrace sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -Q "ALTER LOGIN SA WITH DEFAULT_DATABASE = master;" - IFS=',' read -ra schemas <<< "${{ inputs.schemas }}" + IFS=',' read -ra schemas <<< "test_ds,not_test_ds" for schema in "${schemas[@]}"; do sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "CREATE SCHEMA [$schema];" sqlcmd -V 10 -S localhost -U SA -P dbatools.I0 -d master -Q "GO"