From 6551ee24090f6d815ecf8ecb833187eee248cc21 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 6 Jun 2022 12:30:37 +0100 Subject: [PATCH 1/4] Add a matrix strategy to Complement tests. This reverts commit 5f1efa4483384033c90fb0cba7a6dad6e440c2eb. --- .github/workflows/tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83ab7273785a..f072d5da620f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -310,6 +310,12 @@ jobs: needs: linting-done runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - _: monolith + steps: # The path is set via a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on the path to run Complement. # See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path @@ -337,7 +343,7 @@ jobs: - run: | set -o pipefail - COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt + WORKERS=${{ matrix.workers && 1 }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt shell: bash name: Run Complement Tests From 660c8fd11df779568fa68fcc00b9a2ba0945b0a9 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 6 Jun 2022 12:32:35 +0100 Subject: [PATCH 2/4] Add a job for Complement with Postgres --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f072d5da620f..6bff5cd7c0fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -315,6 +315,10 @@ jobs: matrix: include: - _: monolith + _db: SQLite + + - _: monolith + postgres: Postgres steps: # The path is set via a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on the path to run Complement. @@ -343,7 +347,7 @@ jobs: - run: | set -o pipefail - WORKERS=${{ matrix.workers && 1 }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt + POSTGRES=${{ matrix.postgres && 1 }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt shell: bash name: Run Complement Tests From e19b114ac39006051f49935f138bde32c702936b Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Mon, 6 Jun 2022 12:33:40 +0100 Subject: [PATCH 3/4] Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) --- changelog.d/12965.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12965.misc diff --git a/changelog.d/12965.misc b/changelog.d/12965.misc new file mode 100644 index 000000000000..cc2823e12b77 --- /dev/null +++ b/changelog.d/12965.misc @@ -0,0 +1 @@ +Enable testing against PostgreSQL databases in Complement CI. \ No newline at end of file From 27e1dc53af8044c942552cb130f30caac30e78e6 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Thu, 9 Jun 2022 11:29:16 +0100 Subject: [PATCH 4/4] Avoid using dummy matrix variables --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6bff5cd7c0fa..0b70ffc643b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -314,11 +314,11 @@ jobs: fail-fast: false matrix: include: - - _: monolith - _db: SQLite + - arrangement: monolith + database: SQLite - - _: monolith - postgres: Postgres + - arrangement: monolith + database: Postgres steps: # The path is set via a file given by $GITHUB_PATH. We need both Go 1.17 and GOPATH on the path to run Complement. @@ -347,7 +347,7 @@ jobs: - run: | set -o pipefail - POSTGRES=${{ matrix.postgres && 1 }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt + POSTGRES=${{ (matrix.database == 'Postgres') && 1 }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | gotestfmt shell: bash name: Run Complement Tests