Skip to content

Commit

Permalink
Testing CI
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <[email protected]>
  • Loading branch information
thomaspoignant committed Mar 21, 2023
1 parent 48bc9aa commit 7c2547a
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Build"
on:
push:
branches:
- integration_test

jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18.0'
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.2
- run: make vendor
- run: make provider-tests
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ tmp/
goff-proxy.yaml
flags.yaml

# Java
*.class
openfeature/provider_tests/java-integration-tests/target
6 changes: 6 additions & 0 deletions openfeature/provider_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!flags.yaml
!goff-proxy.yaml

# Java
*.class
target/
134 changes: 134 additions & 0 deletions openfeature/provider_tests/flags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
bool_targeting_match:
variations:
Default: false
"False": false
"True": true
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
disabled_bool:
variations:
Default: false
"False": false
"True": true
defaultRule:
percentage:
"False": 0
"True": 100
disable: true
disabled_float:
variations:
Default: 103.25
"False": 101.25
"True": 100.25
defaultRule:
percentage:
"False": 0
"True": 100
disable: true
disabled_int:
variations:
Default: 103
"False": 101
"True": 100
defaultRule:
percentage:
"False": 0
"True": 100
disable: true
disabled_interface:
variations:
Default:
test: default
"False":
test: "false"
"True":
test: test1
test2: false
test3: 123.3
test4: 1
defaultRule:
percentage:
"False": 0
"True": 100
disable: true
disabled_string:
variations:
Default: CC0002
"False": CC0001
"True": CC0000
defaultRule:
percentage:
"False": 0
"True": 100
disable: true
double_key:
variations:
Default: 103.25
"False": 101.25
"True": 100.25
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
integer_key:
variations:
Default: 103
"False": 101
"True": 100
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
object_key:
variations:
Default:
test: default
"False":
test: "false"
"True":
test: test1
test2: false
test3: 123.3
test4: 1
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
string_key:
variations:
Default: CC0002
"False": CC0001
"True": CC0000
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
string_key_with_version:
variations:
Default: CC0002
"False": CC0001
"True": CC0000
targeting:
- query: email eq "[email protected]"
variation: "True"
defaultRule:
percentage:
"False": 0
"True": 100
9 changes: 9 additions & 0 deletions openfeature/provider_tests/goff-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
listen: 1031
pollingInterval: 1000
startWithRetrieverError: false
retriever:
kind: file
path: ./openfeature/provider_tests/flags.yaml
exporter:
kind: log
enableSwagger: true
5 changes: 2 additions & 3 deletions openfeature/provider_tests/integration_tests.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash


make build-relayproxy
./out/bin/relayproxy --config ./openfeature/provider_tests/goff-proxy.yaml &
./out/bin/relayproxy --config $(pwd)/openfeature/provider_tests/goff-proxy.yaml &

# Waiting for the relay proxy to be ready
NB_ITERATION=10
Expand All @@ -13,7 +12,7 @@ while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:1031/health)" !=
done

# Launch java integration tests
mvn -f ./openfeature/provider_tests/java-integration-tests/pom.xml test
mvn -f $(pwd)/openfeature/provider_tests/java-integration-tests/pom.xml install

# Kill all process launched by the script (here the relay-proxy)
kill -KILL %1
14 changes: 12 additions & 2 deletions openfeature/provider_tests/java-integration-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -32,4 +32,14 @@
<version>0.2.3</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 7c2547a

Please sign in to comment.