From 6f37cac43f6febb26ce736d0ca9daecc17d347b3 Mon Sep 17 00:00:00 2001 From: Skye Gill Date: Mon, 6 Mar 2023 14:47:25 +0000 Subject: [PATCH] chore: disable caching tests in CI. documentation to run full suite. Signed-off-by: Skye Gill --- .github/workflows/pr-checks.yml | 10 ++++++---- Makefile | 4 ++-- README.md | 6 +++--- go.mod | 2 +- go.sum | 2 ++ integration/caching_test.go | 9 +++++++-- test-harness | 2 +- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index d559482d..4ae0c84b 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -32,7 +32,7 @@ jobs: - name: Run linter run: make lint - test: + test: # caching tests are disabled due to slow file I/O in github actions runs-on: ubuntu-latest steps: @@ -45,7 +45,7 @@ jobs: with: submodules: recursive - name: Run flagd-testbed - run: docker run -d -p 8013:8013 -v ${{ github.workspace }}/test-harness/testing-flags.json:/testing-flags.json ghcr.io/open-feature/flagd-testbed:v0.2.2 + run: docker run -d -p 8013:8013 ghcr.io/open-feature/flagd-testbed:v0.2.2 - name: Setup Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -57,7 +57,9 @@ jobs: with: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - - name: Run tests - run: go test -race -coverprofile=coverage.out -covermode=atomic ./... + - name: Run unit tests + run: go test -short -race -coverprofile=coverage.out -covermode=atomic ./... - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 + - name: Run evaluation integration tests + run: go test -cover ./integration -run TestEvaluation diff --git a/Makefile b/Makefile index 21b97b91..8b8178a0 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ mockgen: mockgen -source=pkg/openfeature/mutex.go -destination=pkg/openfeature/mutex_mock_test.go -package=openfeature test: go test --short -cover ./... -integration-test: # dependent on: docker run -p 8013:8013 -v $PWD/test-harness/testing-flags.json:/testing-flags.json ghcr.io/open-feature/flagd-testbed:latest - go test -cover ./... +integration-test: # dependent on: flagd start -f file:test-harness/symlink_testing-flags.json + go test -cover ./integration/... cd test-harness; git restore testing-flags.json; cd .. # reset testing-flags.json lint: diff --git a/README.md b/README.md index 08aff40e..0cf91699 100644 --- a/README.md +++ b/README.md @@ -108,11 +108,11 @@ Run unit tests with `make test`. The continuous integration runs a set of [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features) using the [flagd provider](https://github.com/open-feature/go-sdk-contrib/tree/main/providers/flagd), [flagd](https://github.com/open-feature/flagd) and [the flagd test module](https://github.com/open-feature/go-sdk-contrib/tree/main/tests/flagd). If you'd like to run them locally, first pull the `test-harness` git submodule ``` -git submodule update --init --recursive +git pull --recurse-submodules origin main ``` -then start the flagd testbed with +then start the flagd binary (installation instructions [here](https://github.com/open-feature/flagd/blob/main/docs/usage/getting_started.md#go-binary)) with ``` -docker run -p 8013:8013 -v $PWD/test-harness/testing-flags.json:/testing-flags.json ghcr.io/open-feature/flagd-testbed:latest +flagd start -f file:test-harness/symlink_testing-flags.json ``` and finally run ``` diff --git a/go.mod b/go.mod index e70d59fd..8dce6b38 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/go-logr/logr v1.2.3 github.com/golang/mock v1.6.0 github.com/open-feature/go-sdk-contrib/providers/flagd v0.1.7 - github.com/open-feature/go-sdk-contrib/tests/flagd v1.1.0 + github.com/open-feature/go-sdk-contrib/tests/flagd v1.2.1 golang.org/x/text v0.8.0 ) diff --git a/go.sum b/go.sum index 153b86d3..3fefcc03 100644 --- a/go.sum +++ b/go.sum @@ -217,6 +217,8 @@ github.com/open-feature/go-sdk-contrib/tests/flagd v1.0.1 h1:FATKM2T7O4OBeVF7pjJ github.com/open-feature/go-sdk-contrib/tests/flagd v1.0.1/go.mod h1:Oo6p7XjTcMHbiWrU/UwxN6Uguo0lHGfMsTYksEs/cKE= github.com/open-feature/go-sdk-contrib/tests/flagd v1.1.0 h1:lM+7hfFVwUxQPOyJ9rXn2UR4sCAfOQJKtCU29pU/B+4= github.com/open-feature/go-sdk-contrib/tests/flagd v1.1.0/go.mod h1:zw/xpuDy9ziBEKVA1t4VoQtzFc80btAAQCiZkX6y9oQ= +github.com/open-feature/go-sdk-contrib/tests/flagd v1.2.1 h1:Tg712Egcqb5dsYxOGEaQbfD3g1mqPFdV4tSmKKKxDPk= +github.com/open-feature/go-sdk-contrib/tests/flagd v1.2.1/go.mod h1:zw/xpuDy9ziBEKVA1t4VoQtzFc80btAAQCiZkX6y9oQ= github.com/open-feature/schemas v0.2.8 h1:oA75hJXpOd9SFgmNI2IAxWZkwzQPUDm7Jyyh3q489wM= github.com/open-feature/schemas v0.2.8/go.mod h1:vj+rfTsOLlh5PtGGkAbitnJmFPYuTHXTjOy13kzNgKQ= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/integration/caching_test.go b/integration/caching_test.go index 2e2b43df..47799080 100644 --- a/integration/caching_test.go +++ b/integration/caching_test.go @@ -8,14 +8,19 @@ import ( "github.com/cucumber/godog" ) -const flagConfigurationPath = "../test-harness/testing-flags.json" +const ( + flagConfigurationPath = "../test-harness/symlink_testing-flags.json" + flagConfigurationTargetFilePath = "../test-harness/testing-flags.json" + flagConfigurationMutatedPath = "../test-harness/mutated-testing-flags.json" +) func TestCaching(t *testing.T) { if testing.Short() { t.Skip() } - initializeCachingScenario, err := integration.InitializeCachingScenario(flagConfigurationPath) + initializeCachingScenario, err := integration.InitializeCachingScenario( + flagConfigurationTargetFilePath, flagConfigurationPath, flagConfigurationMutatedPath) if err != nil { t.Fatal(err) } diff --git a/test-harness b/test-harness index f925ee8d..48c56d13 160000 --- a/test-harness +++ b/test-harness @@ -1 +1 @@ -Subproject commit f925ee8d288319109cf9891e964aa8b5011331c2 +Subproject commit 48c56d1314ba89f6d1fdc2c17a8e4ac42e6b1981