Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable caching tests in CI. documentation to run full suite. #169

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
9 changes: 7 additions & 2 deletions integration/caching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion test-harness