From 3f4c94025787bee4bdc77387e36572d10c18fa20 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Fri, 8 Sep 2023 14:30:28 -0700 Subject: [PATCH 01/10] setup test matrix. --- .github/workflows/run-tests.yml | 29 ++++++----- .github/workflows/test-collection-named.yml | 54 --------------------- .github/workflows/test-gql-mutations.yml | 48 ------------------ 3 files changed, 18 insertions(+), 113 deletions(-) delete mode 100644 .github/workflows/test-collection-named.yml delete mode 100644 .github/workflows/test-gql-mutations.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bfa696a283..89ed78a158 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,10 +20,24 @@ on: jobs: run-tests: - name: Run tests job + name: Run tests job matrix runs-on: ubuntu-latest + strategy: + matrix: + client-type: [go, http] + database-type: [badger-file, badger-memory] + mutation-type: [gql, collection-named, collection-save] + tests: [names, lens, cli] + + env: + DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }} + DEFRA_CLIENT_HTTP: ${{ matrix.client-type == 'http' }} + DEFRA_BADGER_MEMORY: ${{ matrix.database-type == 'badger-memory' }} + DEFRA_BADGER_FILE: ${{ matrix.database-type == 'badger-file' }} + DEFRA_MUTATION_TYPE: ${{ matrix.mutation-type }} + steps: - name: Checkout code into the directory uses: actions/checkout@v3 @@ -38,13 +52,6 @@ jobs: run: | make deps:modules make deps:test - - - name: Build binary - run: make build - - # This is to ensure tests pass with a running server. - - name: Start server from binary - run: ./build/defradb start & - - - name: Run the tests, showing name of each test - run: make test:ci + + - name: Run the tests + run: make test:${{ matrix.tests }} diff --git a/.github/workflows/test-collection-named.yml b/.github/workflows/test-collection-named.yml deleted file mode 100644 index 5adabe4fdf..0000000000 --- a/.github/workflows/test-collection-named.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2023 Democratized Data Foundation -# -# Use of this software is governed by the Business Source License -# included in the file licenses/BSL.txt. -# -# As of the Change Date specified in that file, in accordance with -# the Business Source License, use of this software will be governed -# by the Apache License, Version 2.0, included in the file -# licenses/APL.txt. - -name: Run Collection Named Mutations Tests Workflow - -# This workflow runs the test suite with any supporting mutation test actions -# running their mutations via their corresponding named [Collection] call. -# -# For example, CreateDoc will call [Collection.Create], and -# UpdateDoc will call [Collection.Update]. - -on: - pull_request: - branches: - - master - - develop - - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - branches: - - master - - develop - -jobs: - test-collection-named-mutations: - name: Test Collection Named Mutations job - - runs-on: ubuntu-latest - - steps: - - name: Checkout code into the directory - uses: actions/checkout@v3 - - - name: Setup Go environment explicitly - uses: actions/setup-go@v3 - with: - go-version: "1.20" - check-latest: true - - - name: Build dependencies - run: | - make deps:modules - make deps:test - - - name: Run tests with Collection Named mutations - run: make test:ci-col-named-mutations diff --git a/.github/workflows/test-gql-mutations.yml b/.github/workflows/test-gql-mutations.yml deleted file mode 100644 index 827dd22098..0000000000 --- a/.github/workflows/test-gql-mutations.yml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2022 Democratized Data Foundation -# -# Use of this software is governed by the Business Source License -# included in the file licenses/BSL.txt. -# -# As of the Change Date specified in that file, in accordance with -# the Business Source License, use of this software will be governed -# by the Apache License, Version 2.0, included in the file -# licenses/APL.txt. - -name: Run GQL Mutations Tests Workflow - -on: - pull_request: - branches: - - master - - develop - - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - branches: - - master - - develop - -jobs: - test-gql-mutations: - name: Test GQL mutations job - - runs-on: ubuntu-latest - - steps: - - name: Checkout code into the directory - uses: actions/checkout@v3 - - - name: Setup Go environment explicitly - uses: actions/setup-go@v3 - with: - go-version: "1.20" - check-latest: true - - - name: Build dependencies - run: | - make deps:modules - make deps:test - - - name: Run tests with gql mutations - run: make test:ci-gql-mutations From 25eb1cc5c3e36a27531b6cf61d767cf00580c6bf Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Mon, 11 Sep 2023 09:24:24 -0700 Subject: [PATCH 02/10] add code coverage to run-tests workflow. remove code-test-coverage workflow. replace Makefile actions with standard actions. --- .github/workflows/code-test-coverage.yml | 76 ------------------------ .github/workflows/run-tests.yml | 51 ++++++++++++++-- 2 files changed, 45 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/code-test-coverage.yml diff --git a/.github/workflows/code-test-coverage.yml b/.github/workflows/code-test-coverage.yml deleted file mode 100644 index 65c0a92f1f..0000000000 --- a/.github/workflows/code-test-coverage.yml +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2022 Democratized Data Foundation -# -# Use of this software is governed by the Business Source License -# included in the file licenses/BSL.txt. -# -# As of the Change Date specified in that file, in accordance with -# the Business Source License, use of this software will be governed -# by the Apache License, Version 2.0, included in the file -# licenses/APL.txt. - -name: Code Test Coverage Workflow - -on: - pull_request: - branches: - - master - - develop - - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - branches: - - master - - develop - -jobs: - code-test-coverage: - name: Code test coverage job - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup Go environment explicitly - uses: actions/setup-go@v3 - with: - go-version: "1.20" - check-latest: true - - - name: Generate full test coverage report using go-acc - run: make test:coverage - - - name: Upload coverage to Codecov without token, retry on failure - env: - codecov_secret: ${{ secrets.CODECOV_TOKEN }} - if: env.codecov_secret == '' - uses: Wandalen/wretry.action@v1.0.36 - with: - attempt_limit: 5 - attempt_delay: 10000 - action: codecov/codecov-action@v3 - with: | - name: defradb-codecov - files: ./coverage.txt - flags: all-tests - os: 'linux' - fail_ci_if_error: true - verbose: true - - - name: Upload coverage to Codecov with token - env: - codecov_secret: ${{ secrets.CODECOV_TOKEN }} - if: env.codecov_secret != '' - uses: codecov/codecov-action@v3 - with: - token: ${{ env.codecov_secret }} - name: defradb-codecov - files: ./coverage.txt - flags: all-tests - os: 'linux' - fail_ci_if_error: true - verbose: true - # path_to_write_report: ./coverage/codecov_report.txt - # directory: ./coverage/reports/ diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 89ed78a158..e893e9169a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,7 +29,6 @@ jobs: client-type: [go, http] database-type: [badger-file, badger-memory] mutation-type: [gql, collection-named, collection-save] - tests: [names, lens, cli] env: DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }} @@ -48,10 +47,50 @@ jobs: go-version: "1.20" check-latest: true - - name: Build dependencies + - name: Install Go dependencies run: | - make deps:modules - make deps:test - + go mod download + go install gotest.tools/gotestsum@latest + go install github.com/ory/go-acc@latest + + - name: Build Lens dependencies + run: | + rustup target add wasm32-unknown-unknown + cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_set_default/Cargo.toml" + cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_remove/Cargo.toml" + cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_copy/Cargo.toml" + - name: Run the tests - run: make test:${{ matrix.tests }} + run: gotestsum ./... --format testname -- -race -shuffle=on -timeout 300s + + - name: Generate test coverage + run: go-acc ./... --output=coverage.txt --covermode=atomic -- -failfast + + - name: Upload coverage to Codecov without token, retry on failure + env: + codecov_secret: ${{ secrets.CODECOV_TOKEN }} + if: env.codecov_secret == '' + uses: Wandalen/wretry.action@v1.0.36 + with: + attempt_limit: 5 + attempt_delay: 10000 + action: codecov/codecov-action@v3 + with: | + name: defradb-codecov + files: ./coverage.txt + os: 'linux' + fail_ci_if_error: true + verbose: true + + - name: Upload coverage to Codecov with token + env: + codecov_secret: ${{ secrets.CODECOV_TOKEN }} + if: env.codecov_secret != '' + uses: codecov/codecov-action@v3 + with: + token: ${{ env.codecov_secret }} + name: defradb-codecov + files: ./coverage.txt + os: 'linux' + fail_ci_if_error: true + verbose: true From 95200e6f6dfb81893fd6ec02c564da7380390963 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Tue, 12 Sep 2023 14:32:06 -0700 Subject: [PATCH 03/10] use makefile for run-tests workflow. use a single step for codecov upload --- .github/workflows/run-tests.yml | 56 +++++++++++++-------------------- Makefile | 6 ++++ 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e893e9169a..029f18cfd4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -47,50 +47,36 @@ jobs: go-version: "1.20" check-latest: true - - name: Install Go dependencies + - name: Build dependencies run: | - go mod download - go install gotest.tools/gotestsum@latest - go install github.com/ory/go-acc@latest - - - name: Build Lens dependencies - run: | - rustup target add wasm32-unknown-unknown - cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_set_default/Cargo.toml" - cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_remove/Cargo.toml" - cargo build --target wasm32-unknown-unknown --manifest-path "./tests/lenses/rust_wasm32_copy/Cargo.toml" + make deps:modules + make deps:test - name: Run the tests - run: gotestsum ./... --format testname -- -race -shuffle=on -timeout 300s - - - name: Generate test coverage - run: go-acc ./... --output=coverage.txt --covermode=atomic -- -failfast + run: make test:ci-matrix - - name: Upload coverage to Codecov without token, retry on failure - env: - codecov_secret: ${{ secrets.CODECOV_TOKEN }} - if: env.codecov_secret == '' - uses: Wandalen/wretry.action@v1.0.36 + - name: Upload coverage artifact + uses: actions/upload-artifact@v3 with: - attempt_limit: 5 - attempt_delay: 10000 - action: codecov/codecov-action@v3 - with: | - name: defradb-codecov - files: ./coverage.txt - os: 'linux' - fail_ci_if_error: true - verbose: true + name: ${{ matrix.client-type }}_${{ matrix.database-type }}_${{ matrix.mutation-type }} + path: coverage.txt + if-no-files-found: error + + upload-coverage: + name: Upload test code coverage + + needs: run-tests + + steps: + - name: Download coverage reports + uses: actions/download-artifact@v3 - - name: Upload coverage to Codecov with token - env: - codecov_secret: ${{ secrets.CODECOV_TOKEN }} - if: env.codecov_secret != '' + - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - token: ${{ env.codecov_secret }} + token: ${{ secrets.CODECOV_TOKEN }} name: defradb-codecov - files: ./coverage.txt + flags: all-tests os: 'linux' fail_ci_if_error: true verbose: true diff --git a/Makefile b/Makefile index 6eb3456fcc..754c6738b3 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ BUILD_FLAGS+=-tags $(BUILD_TAGS) endif TEST_FLAGS=-race -shuffle=on -timeout 300s +COVER_FLAGS=-covermode=atomic -coverprofile=coverage.txt PLAYGROUND_DIRECTORY=playground LENS_TEST_DIRECTORY=tests/integration/schema/migrations @@ -191,6 +192,11 @@ test\:ci: DEFRA_CLIENT_GO=true DEFRA_CLIENT_HTTP=true \ $(MAKE) test:all +.PHONY: test\:ci-matrix +test\:ci-matrix: + @$(MAKE) deps:lens + gotestsum --format testname -- ./... $(COVER_FLAGS) $(TEST_FLAGS) + .PHONY: test\:ci-gql-mutations test\:ci-gql-mutations: DEFRA_MUTATION_TYPE=gql DEFRA_BADGER_MEMORY=true \ From a6c6876936b572345602a11e41dd312625d6c022 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Tue, 12 Sep 2023 14:35:05 -0700 Subject: [PATCH 04/10] add missing runs-on property to run-tests workflow --- .github/workflows/run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 029f18cfd4..02519608a5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -64,6 +64,8 @@ jobs: upload-coverage: name: Upload test code coverage + + runs-on: ubuntu-latest needs: run-tests From 4f4bb35501079dee3e6feaa7cd4d9c44ac756788 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Tue, 12 Sep 2023 15:52:24 -0700 Subject: [PATCH 05/10] set retention for coverage files. add coverpkg flag to test:ci Make target --- .github/workflows/run-tests.yml | 1 + Makefile | 20 +------------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 02519608a5..dda8e1e41e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -61,6 +61,7 @@ jobs: name: ${{ matrix.client-type }}_${{ matrix.database-type }}_${{ matrix.mutation-type }} path: coverage.txt if-no-files-found: error + retention-days: 1 upload-coverage: name: Upload test code coverage diff --git a/Makefile b/Makefile index 754c6738b3..cb96937219 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ BUILD_FLAGS+=-tags $(BUILD_TAGS) endif TEST_FLAGS=-race -shuffle=on -timeout 300s -COVER_FLAGS=-covermode=atomic -coverprofile=coverage.txt +COVER_FLAGS=-covermode=atomic -coverprofile=coverage.txt -coverpkg=./... PLAYGROUND_DIRECTORY=playground LENS_TEST_DIRECTORY=tests/integration/schema/migrations @@ -188,21 +188,9 @@ test\:build: .PHONY: test\:ci test\:ci: - DEFRA_BADGER_MEMORY=true DEFRA_BADGER_FILE=true \ - DEFRA_CLIENT_GO=true DEFRA_CLIENT_HTTP=true \ - $(MAKE) test:all - -.PHONY: test\:ci-matrix -test\:ci-matrix: @$(MAKE) deps:lens gotestsum --format testname -- ./... $(COVER_FLAGS) $(TEST_FLAGS) -.PHONY: test\:ci-gql-mutations -test\:ci-gql-mutations: - DEFRA_MUTATION_TYPE=gql DEFRA_BADGER_MEMORY=true \ - DEFRA_CLIENT_GO=true DEFRA_CLIENT_HTTP=true \ - $(MAKE) test:all - .PHONY: test\:gql-mutations test\:gql-mutations: DEFRA_MUTATION_TYPE=gql DEFRA_BADGER_MEMORY=true gotestsum --format pkgname -- $(DEFAULT_TEST_DIRECTORIES) @@ -212,12 +200,6 @@ test\:gql-mutations: # # For example, CreateDoc will call [Collection.Create], and # UpdateDoc will call [Collection.Update]. -.PHONY: test\:ci-col-named-mutations -test\:ci-col-named-mutations: - DEFRA_MUTATION_TYPE=collection-named DEFRA_BADGER_MEMORY=true \ - DEFRA_CLIENT_GO=true DEFRA_CLIENT_HTTP=true \ - $(MAKE) test:all - .PHONY: test\:col-named-mutations test\:col-named-mutations: DEFRA_MUTATION_TYPE=collection-named DEFRA_BADGER_MEMORY=true gotestsum --format pkgname -- $(DEFAULT_TEST_DIRECTORIES) From 9cfbbb7c9fa220d3b776b9eba182536580704f8f Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Tue, 12 Sep 2023 15:55:31 -0700 Subject: [PATCH 06/10] fix incorrect make command in run-tests workflow --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index dda8e1e41e..11a87cde9f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -53,7 +53,7 @@ jobs: make deps:test - name: Run the tests - run: make test:ci-matrix + run: make test:ci - name: Upload coverage artifact uses: actions/upload-artifact@v3 From a34956140ffea01b617edf3723ce358e339aa5f4 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 20 Sep 2023 11:49:12 -0700 Subject: [PATCH 07/10] replace go-acc with go 1.20 aggregate test coverage. add change detector to matrix workflow --- .github/workflows/run-tests.yml | 12 ++++++++- .gitignore | 1 + Makefile | 47 +++++++++++++++------------------ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 11a87cde9f..4a7a408631 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,6 +29,11 @@ jobs: client-type: [go, http] database-type: [badger-file, badger-memory] mutation-type: [gql, collection-named, collection-save] + include: + - client-type: go + database-type: badger-memory + mutation-type: collection-save + detect-changes: true env: DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }} @@ -52,9 +57,14 @@ jobs: make deps:modules make deps:test - - name: Run the tests + - name: Run integration tests + if: ${{ !matrix.detect-changes }} run: make test:ci + - name: Run change detector tests + if: ${{ matrix.detect-changes }} + run: make test:changes + - name: Upload coverage artifact uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index b19a6d9259..81c1a16d62 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ cmd/defradb/defradb cmd/genclidocs/genclidocs cmd/genmanpages/genmanpages coverage.txt +coverage tests/bench/*.log tests/bench/*.svg diff --git a/Makefile b/Makefile index 060819d248..473d2312b7 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,10 @@ BUILD_FLAGS+=-tags $(BUILD_TAGS) endif TEST_FLAGS=-race -shuffle=on -timeout 300s -COVER_FLAGS=-covermode=atomic -coverprofile=coverage.txt -coverpkg=./... + +COVERAGE_DIRECTORY=$(PWD)/coverage +COVERAGE_FILE=coverage.txt +COVERAGE_FLAGS=-covermode=atomic -coverpkg=./... -args -test.gocoverdir=$(COVERAGE_DIRECTORY) PLAYGROUND_DIRECTORY=playground LENS_TEST_DIRECTORY=tests/integration/schema/migrations @@ -89,11 +92,6 @@ deps\:lens: rustup target add wasm32-unknown-unknown @$(MAKE) -C ./tests/lenses build -.PHONY: deps\:coverage -deps\:coverage: - go install github.com/ory/go-acc@latest - @$(MAKE) deps:lens - .PHONY: deps\:bench deps\:bench: go install golang.org/x/perf/cmd/benchstat@latest @@ -162,6 +160,11 @@ clean: clean\:test: go clean -testcache +.PHONY: clean\:coverage +clean\:coverage: + rm -rf $(COVERAGE_DIRECTORY) + rm -f $(COVERAGE_FILE) + # Example: `make tls-certs path="~/.defradb/certs"` .PHONY: tls-certs tls-certs: @@ -190,7 +193,10 @@ test\:build: .PHONY: test\:ci test\:ci: @$(MAKE) deps:lens - gotestsum --format testname -- ./... $(COVER_FLAGS) $(TEST_FLAGS) + @$(MAKE) clean:coverage + mkdir $(COVERAGE_DIRECTORY) + gotestsum --format testname -- ./... $(TEST_FLAGS) $(COVERAGE_FLAGS) + go tool covdata textfmt -i=$(COVERAGE_DIRECTORY) -o $(COVERAGE_FILE) .PHONY: test\:gql-mutations test\:gql-mutations: @@ -257,29 +263,20 @@ test\:cli: @$(MAKE) deps:lens gotestsum --format testname -- ./$(CLI_TEST_DIRECTORY)/... $(TEST_FLAGS) -# Using go-acc to ensure integration tests are included. -# Usage: `make test:coverage` or `make test:coverage path="{pathToPackage}"` -# Example: `make test:coverage path="./api/..."` + .PHONY: test\:coverage test\:coverage: - @$(MAKE) deps:coverage -ifeq ($(path),) - go-acc ./... --output=coverage.txt --covermode=atomic -- -failfast -coverpkg=./... - @echo "Show coverage information for each function in ./..." -else - go-acc $(path) --output=coverage.txt --covermode=atomic -- -failfast -coverpkg=$(path) - @echo "Show coverage information for each function in" path=$(path) -endif - go tool cover -func coverage.txt | grep total | awk '{print $$3}' + @$(MAKE) deps:lens + @$(MAKE) clean:coverage + mkdir $(COVERAGE_DIRECTORY) + go test ./... $(TEST_FLAGS) $(COVERAGE_FLAGS) + go tool covdata textfmt -i=$(COVERAGE_DIRECTORY) -o $(COVERAGE_FILE) + go tool cover -func $(COVERAGE_FILE) -# Usage: `make test:coverage-html` or `make test:coverage-html path="{pathToPackage}"` -# Example: `make test:coverage-html path="./api/..."` .PHONY: test\:coverage-html test\:coverage-html: - @$(MAKE) test:coverage path=$(path) - @echo "Generate coverage information in HTML" - go tool cover -html=coverage.txt - rm ./coverage.txt + @$(MAKE) test:coverage + go tool cover -html=$(COVERAGE_FILE) .PHONY: test\:changes test\:changes: From 6662cf3c26afefd9b10bced5d3a97400301f0196 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 20 Sep 2023 11:58:38 -0700 Subject: [PATCH 08/10] fix missing Makefile target --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 473d2312b7..628d21596a 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,6 @@ deps: @$(MAKE) deps:modules && \ $(MAKE) deps:bench && \ $(MAKE) deps:chglog && \ - $(MAKE) deps:coverage && \ $(MAKE) deps:lint && \ $(MAKE) deps:test && \ $(MAKE) deps:mock From 80784f6e5024429d0cbed9fb0205c1a2185f28d5 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 20 Sep 2023 12:05:10 -0700 Subject: [PATCH 09/10] remove detect-change workflow. update run-tests matrix to include change detector and non change detector runs --- .github/workflows/detect-change.yml | 55 ----------------------------- .github/workflows/run-tests.yml | 6 ++++ 2 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/detect-change.yml diff --git a/.github/workflows/detect-change.yml b/.github/workflows/detect-change.yml deleted file mode 100644 index b6272c21cd..0000000000 --- a/.github/workflows/detect-change.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2022 Democratized Data Foundation -# -# Use of this software is governed by the Business Source License -# included in the file licenses/BSL.txt. -# -# As of the Change Date specified in that file, in accordance with -# the Business Source License, use of this software will be governed -# by the Apache License, Version 2.0, included in the file -# licenses/APL.txt. - -name: Detect Change Workflow - -on: - pull_request: - branches: - - master - - develop - - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - branches: - - master - - develop - -jobs: - detect-change: - name: Detect change job - - runs-on: ubuntu-latest - - steps: - - name: Checkout code into the directory - uses: actions/checkout@v3 - - - name: Setup Go environment explicitly - uses: actions/setup-go@v3 - with: - go-version: "1.20" - check-latest: true - - - name: Build dependencies - run: | - make deps:modules - make deps:test - - - name: Run detection for changes - run: make test:changes - - ## Uncomment to enable ability to SSH into the runner. - #- name: Setup upterm ssh session for debugging - # uses: lhotari/action-upterm@v1 - # with: - # limit-access-to-actor: true - # limit-access-to-users: shahzadlone diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4a7a408631..37b139b742 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -30,10 +30,16 @@ jobs: database-type: [badger-file, badger-memory] mutation-type: [gql, collection-named, collection-save] include: + # one runs with detect changes - client-type: go database-type: badger-memory mutation-type: collection-save detect-changes: true + # one runs without detect changes + - client-type: go + database-type: badger-memory + mutation-type: collection-save + detect-changes: false env: DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }} From d9be82dc8a450541f9050c95bed1ccb2ebb7ad9b Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 20 Sep 2023 12:14:43 -0700 Subject: [PATCH 10/10] add change-detector matrix variable to run-tests workflow --- .github/workflows/run-tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 37b139b742..6e32af1730 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,17 +29,12 @@ jobs: client-type: [go, http] database-type: [badger-file, badger-memory] mutation-type: [gql, collection-named, collection-save] + detect-changes: [false] include: - # one runs with detect changes - client-type: go database-type: badger-memory mutation-type: collection-save detect-changes: true - # one runs without detect changes - - client-type: go - database-type: badger-memory - mutation-type: collection-save - detect-changes: false env: DEFRA_CLIENT_GO: ${{ matrix.client-type == 'go' }}