-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error handing, add e2e tests (#334)
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
- Loading branch information
Showing
12 changed files
with
165 additions
and
75 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
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,3 +1,6 @@ | ||
[submodule "spec"] | ||
path = spec | ||
url = https://github.com/open-feature/spec | ||
[submodule "flagd-testbed"] | ||
path = flagd-testbed | ||
url = https://github.com/open-feature/flagd-testbed.git |
Submodule flagd-testbed
added at
6493d0
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,42 @@ | ||
//go:build e2e | ||
|
||
package e2e | ||
|
||
import ( | ||
"context" | ||
"flag" | ||
"testing" | ||
|
||
"github.com/cucumber/godog" | ||
in_process "github.com/open-feature/go-sdk-contrib/providers/flagd-in-process/pkg" | ||
"github.com/open-feature/go-sdk-contrib/tests/flagd/pkg/integration" | ||
"github.com/open-feature/go-sdk/pkg/openfeature" | ||
) | ||
|
||
func TestEvaluationFlagdInProcess(t *testing.T) { | ||
if testing.Short() { | ||
// skip e2e if testing -short | ||
t.Skip() | ||
} | ||
|
||
flag.Parse() | ||
|
||
name := "evaluation.feature" | ||
|
||
testSuite := godog.TestSuite{ | ||
Name: name, | ||
ScenarioInitializer: integration.InitializeEvaluationScenario(func() openfeature.FeatureProvider { | ||
return in_process.NewProvider(context.Background(), in_process.WithSourceURI("localhost:9090"), in_process.WithSourceType(in_process.SourceTypeGrpc)) | ||
}), | ||
Options: &godog.Options{ | ||
Format: "pretty", | ||
Paths: []string{"../../../spec/specification/assets/gherkin/evaluation.feature"}, | ||
TestingT: t, // Testing instance that will run subtests. | ||
Strict: true, | ||
}, | ||
} | ||
|
||
if testSuite.Run() != 0 { | ||
t.Fatal("non-zero status returned, failed to run evaluation tests") | ||
} | ||
} |
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
Oops, something went wrong.