-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add FeatureEnabled to Variant and fix spec testing (#166)
* feat: add FeatureEnabled to Variant and fix spec testing FeatureEnabled is similar to Enabled except in the case where the feature is enabled but there are no variants defined. This follows the client specification case [1]. Fixes #159 [1] https://github.com/Unleash/client-specification/blob/c0169d7ace35db66cdf41a7b1b4e390a4a843c3b/specifications/08-variants.json#L448 * fix: add workflow to build PRs --------- Co-authored-by: Fredrik Oseberg <[email protected]>
- Loading branch information
1 parent
c42351c
commit a9f89ed
Showing
8 changed files
with
182 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build PRs | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
version: [1.13, 1.15, 1.16] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout code | ||
- uses: actions/checkout@v2 | ||
name: Checkout client specifications | ||
with: | ||
repository: Unleash/client-specification | ||
ref: refs/tags/v5.1.0 | ||
path: testdata/client-specification | ||
- uses: actions/setup-go@v2 | ||
name: Setup go | ||
with: | ||
go-version: ${{ matrix.version }} | ||
- name: Get deps | ||
run: go get -t -v ./... | ||
- name: Go vet | ||
run: go vet ./... | ||
- name: Run spec tests | ||
run: go test -v ./... -tags='norace' | ||
- name: Run all tests with race detection | ||
timeout-minutes: 1 | ||
run: go test -race -covermode atomic -coverprofile=profile.cov -v ./... -tags='!norace' | ||
- name: Send coverage | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: profile.cov | ||
flag-name: Go-${{ matrix.version }} | ||
parallel: true | ||
finish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
parallel-finished: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: Build | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters