Skip to content

Commit

Permalink
fix: update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pradeep <[email protected]>
  • Loading branch information
pradeepbbl committed Nov 15, 2024
1 parent ab358fa commit 2b51a65
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/integration/evaluation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,9 @@ func TestEvaluationUsingEnvoy(t *testing.T) {

flag.Parse()

var providerOptions []flagd.ProviderOption
name := "evaluation.feature"

if tls == "true" {
name = "evaluation_tls.feature"
providerOptions = []flagd.ProviderOption{
flagd.WithTLS(certPath),
flagd.WithTargetUri("envoy://localhost:9211/flagd-sync.service"),
}
name := "evaluation_envoy.feature"
providerOptions := []flagd.ProviderOption{
flagd.WithTargetUri("envoy://localhost:9211/flagd-sync.service"),
}

testSuite := godog.TestSuite{
Expand Down
31 changes: 31 additions & 0 deletions test/integration/json_evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,34 @@ func TestJsonEvaluator(t *testing.T) {
t.Fatal("non-zero status returned, failed to run evaluation tests")
}
}

func TestJsonEvaluatorUsingEnvoy(t *testing.T) {
if testing.Short() {
t.Skip()
}

flag.Parse()

name := "flagd-json-evaluator-envoy.feature"
providerOptions := []flagd.ProviderOption{
flagd.WithTargetUri("envoy://localhost:9211/flagd-sync.service"),
}

testSuite := godog.TestSuite{
Name: name,
TestSuiteInitializer: integration.InitializeFlagdJsonTestSuite(func() openfeature.FeatureProvider {
return flagd.NewProvider(providerOptions...)
}),
ScenarioInitializer: integration.InitializeFlagdJsonScenario,
Options: &godog.Options{
Format: "pretty",
Paths: []string{"../../test-harness/gherkin/flagd-json-evaluator.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")
}
}

0 comments on commit 2b51a65

Please sign in to comment.