-
Notifications
You must be signed in to change notification settings - Fork 39
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: add integration tests #77
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "test-harness"] | ||
path = test-harness | ||
url = https://github.com/open-feature/test-harness |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target> | ||
<junit.jupiter.version>5.8.1</junit.jupiter.version> | ||
<!-- exclusion expression for integration tests --> | ||
<testExclusions>**/integration/*.java</testExclusions> | ||
</properties> | ||
|
||
<name>OpenFeature Java SDK</name> | ||
|
@@ -46,7 +48,6 @@ | |
<scope>provided</scope> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<!-- used so that lombok can generate suppressions for spotbugs. It needs to find it on the relevant classpath --> | ||
<groupId>com.github.spotbugs</groupId> | ||
|
@@ -96,29 +97,81 @@ | |
<version>${junit.jupiter.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<version>${junit.jupiter.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-params</artifactId> | ||
<version>${junit.jupiter.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-suite</artifactId> | ||
<version>1.8.1</version> | ||
<version>1.9.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-java</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-junit-platform-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<version>31.1-jre</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>dev.openfeature.contrib.providers</groupId> | ||
<artifactId>flagd</artifactId> | ||
<version>0.3.2</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the plan to keep this up to date? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure it's necessary to automate updates. The purpose is to test the SDK, not flagd, so as long as the tests are working, we can have confidence the SDK is functioning at least in terms of it's provider interfaces. If there was some breaking change in the SDK itself that impacted flagd, this version of the flagd provider might throw, then we'd have to absorb the changes in there. There will be similar tests in flagd itself that will run with the latest version of flagd. I'm sure we can use a plugin or some github action to automate this update, but honestly I think that would just be adding an unhelpful variable. |
||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>io.cucumber</groupId> | ||
<artifactId>cucumber-bom</artifactId> | ||
<version>7.5.0</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit</groupId> | ||
<artifactId>junit-bom</artifactId> | ||
<version>5.9.0</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
|
||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>3.3.0</version> | ||
|
@@ -137,16 +190,21 @@ | |
<ignoredUnusedDeclaredDependency>org.junit*</ignoredUnusedDeclaredDependency> | ||
</ignoredUnusedDeclaredDependencies> | ||
<ignoredDependencies> | ||
<ignoredDependency>com.google.guava*</ignoredDependency> | ||
<ignoredDependency>io.cucumber*</ignoredDependency> | ||
<ignoredDependency>org.junit*</ignoredDependency> | ||
<ignoredDependency>com.google.code.findbugs*</ignoredDependency> | ||
<ignoredDependency>com.github.spotbugs*</ignoredDependency> | ||
<ignoredDependency>uk.org.lidalia:lidalia-slf4j-ext:*</ignoredDependency> | ||
</ignoredDependencies> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
|
@@ -155,6 +213,10 @@ | |
<argLine> | ||
${surefireArgLine} | ||
</argLine> | ||
<excludes> | ||
<!-- tests to exclude --> | ||
<exclude>${testExclusions}</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
|
||
|
@@ -224,7 +286,7 @@ | |
</rule> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</execution> | ||
|
||
</executions> | ||
</plugin> | ||
|
@@ -257,6 +319,7 @@ | |
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
|
@@ -372,6 +435,61 @@ | |
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<!-- this profile handles running the flagd integration tests --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pulls the test-harness gherkin repo, and copies it into place. |
||
<id>integration-test</id> | ||
<properties> | ||
<!-- run the integration tests by clearing the exclusions --> | ||
<testExclusions></testExclusions> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<!-- pull the gherkin tests as a git submodule --> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<executions> | ||
<execution> | ||
<id>update-test-harness-submodule</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<!-- run: git submodule update \-\-init \-\-recursive --> | ||
<executable>git</executable> | ||
<arguments> | ||
<argument>submodule</argument> | ||
<argument>update</argument> | ||
<argument>--init</argument> | ||
<argument>--recursive</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>copy-gherkin-tests</id> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<!-- run: cp test-harness/features/evaluation.feature src/test/resources/features/ --> | ||
<executable>cp</executable> | ||
<arguments> | ||
<argument>test-harness/features/evaluation.feature</argument> | ||
<argument>src/test/resources/features/</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
<distributionManagement> | ||
<snapshotRepository> | ||
<id>ossrh</id> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package dev.openfeature.javasdk.integration; | ||
|
||
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 static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; | ||
|
||
@Suite | ||
@IncludeEngines("cucumber") | ||
@SelectClasspathResource("features") | ||
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") | ||
public class RunCucumberTest { | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run flagd in the CI.