-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simon Schrottner <[email protected]> Co-authored-by: Todd Baert <[email protected]>
- Loading branch information
Showing
9 changed files
with
237 additions
and
29 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
27 changes: 27 additions & 0 deletions
27
...st/java/dev/openfeature/contrib/providers/flagd/e2e/RunFlagdInProcessSSLCucumberTest.java
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,27 @@ | ||
package dev.openfeature.contrib.providers.flagd.e2e; | ||
|
||
import org.apache.logging.log4j.core.config.Order; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
||
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; | ||
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; | ||
|
||
/** | ||
* Class for running the reconnection tests for the RPC provider | ||
*/ | ||
@Order(value = Integer.MAX_VALUE) | ||
@Suite(failIfNoTests = false) | ||
@IncludeEngines("cucumber") | ||
//@SelectClasspathResource("features/evaluation.feature") | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.ssl.process,dev.openfeature.contrib.providers.flagd.e2e.steps") | ||
@Testcontainers | ||
public class RunFlagdInProcessSSLCucumberTest { | ||
|
||
} | ||
|
26 changes: 26 additions & 0 deletions
26
...src/test/java/dev/openfeature/contrib/providers/flagd/e2e/RunFlagdRpcSSLCucumberTest.java
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,26 @@ | ||
package dev.openfeature.contrib.providers.flagd.e2e; | ||
|
||
import org.apache.logging.log4j.core.config.Order; | ||
import org.junit.platform.suite.api.ConfigurationParameter; | ||
import org.junit.platform.suite.api.IncludeEngines; | ||
import org.junit.platform.suite.api.SelectClasspathResource; | ||
import org.junit.platform.suite.api.Suite; | ||
import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
||
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; | ||
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; | ||
|
||
/** | ||
* Class for running the reconnection tests for the RPC provider | ||
*/ | ||
@Order(value = Integer.MAX_VALUE) | ||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features/evaluation.feature") | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") | ||
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.ssl.rpc,dev.openfeature.contrib.providers.flagd.e2e.steps") | ||
@Testcontainers | ||
public class RunFlagdRpcSSLCucumberTest { | ||
|
||
} | ||
|
57 changes: 57 additions & 0 deletions
57
...est/java/dev/openfeature/contrib/providers/flagd/e2e/ssl/process/FlagdInProcessSetup.java
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,57 @@ | ||
package dev.openfeature.contrib.providers.flagd.e2e.ssl.process; | ||
|
||
import dev.openfeature.contrib.providers.flagd.Config; | ||
import dev.openfeature.contrib.providers.flagd.FlagdOptions; | ||
import dev.openfeature.contrib.providers.flagd.FlagdProvider; | ||
import dev.openfeature.contrib.providers.flagd.e2e.ContainerConfig; | ||
import dev.openfeature.contrib.providers.flagd.e2e.steps.StepDefinitions; | ||
import dev.openfeature.contrib.providers.flagd.resolver.grpc.cache.CacheType; | ||
import dev.openfeature.sdk.FeatureProvider; | ||
import io.cucumber.java.AfterAll; | ||
import io.cucumber.java.Before; | ||
import io.cucumber.java.BeforeAll; | ||
import org.junit.jupiter.api.Order; | ||
import org.junit.jupiter.api.parallel.Isolated; | ||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
import java.io.File; | ||
|
||
@Isolated() | ||
@Order(value = Integer.MAX_VALUE) | ||
public class FlagdInProcessSetup { | ||
private static final GenericContainer flagdContainer = | ||
new GenericContainer( | ||
DockerImageName.parse( | ||
ContainerConfig.generateContainerName("flagd", "ssl") | ||
) | ||
).withExposedPorts(8015); | ||
|
||
@BeforeAll() | ||
public static void setups() throws InterruptedException { | ||
flagdContainer.start(); | ||
} | ||
|
||
@Before() | ||
public static void setupTest() throws InterruptedException { | ||
String path = "test-harness/ssl/custom-root-cert.crt"; | ||
|
||
File file = new File(path); | ||
String absolutePath = file.getAbsolutePath(); | ||
FeatureProvider workingProvider = new FlagdProvider(FlagdOptions.builder() | ||
.resolverType(Config.Resolver.IN_PROCESS) | ||
.port(flagdContainer.getFirstMappedPort()) | ||
.deadline(10000) | ||
.streamDeadlineMs(0) // this makes reconnect tests more predictable | ||
.tls(true) | ||
.certPath(absolutePath) | ||
.build()); | ||
StepDefinitions.setProvider(workingProvider); | ||
|
||
} | ||
|
||
@AfterAll | ||
public static void tearDown() { | ||
flagdContainer.stop(); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...lagd/src/test/java/dev/openfeature/contrib/providers/flagd/e2e/ssl/rpc/FlagdRpcSetup.java
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,57 @@ | ||
package dev.openfeature.contrib.providers.flagd.e2e.ssl.rpc; | ||
|
||
import dev.openfeature.contrib.providers.flagd.Config; | ||
import dev.openfeature.contrib.providers.flagd.FlagdOptions; | ||
import dev.openfeature.contrib.providers.flagd.FlagdProvider; | ||
import dev.openfeature.contrib.providers.flagd.e2e.ContainerConfig; | ||
import dev.openfeature.contrib.providers.flagd.e2e.steps.StepDefinitions; | ||
import dev.openfeature.contrib.providers.flagd.resolver.grpc.cache.CacheType; | ||
import dev.openfeature.sdk.FeatureProvider; | ||
import io.cucumber.java.AfterAll; | ||
import io.cucumber.java.Before; | ||
import io.cucumber.java.BeforeAll; | ||
import org.junit.jupiter.api.Order; | ||
import org.junit.jupiter.api.parallel.Isolated; | ||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
import java.io.File; | ||
|
||
@Isolated() | ||
@Order(value = Integer.MAX_VALUE) | ||
public class FlagdRpcSetup { | ||
private static final GenericContainer flagdContainer = | ||
new GenericContainer( | ||
DockerImageName.parse( | ||
ContainerConfig.generateContainerName("flagd", "ssl") | ||
) | ||
).withExposedPorts(8013); | ||
|
||
@BeforeAll() | ||
public static void setups() throws InterruptedException { | ||
flagdContainer.start(); | ||
} | ||
|
||
@Before() | ||
public static void setupTest() throws InterruptedException { | ||
String path = "test-harness/ssl/custom-root-cert.crt"; | ||
|
||
File file = new File(path); | ||
String absolutePath = file.getAbsolutePath(); | ||
FeatureProvider workingProvider = new FlagdProvider(FlagdOptions.builder() | ||
.resolverType(Config.Resolver.RPC) | ||
.port(flagdContainer.getFirstMappedPort()) | ||
.deadline(10000) | ||
.streamDeadlineMs(0) // this makes reconnect tests more predictable | ||
.tls(true) | ||
.certPath(absolutePath) | ||
.build()); | ||
StepDefinitions.setProvider(workingProvider); | ||
|
||
} | ||
|
||
@AfterAll | ||
public static void tearDown() { | ||
flagdContainer.stop(); | ||
} | ||
} |
Oops, something went wrong.