Skip to content

Commit 3c8ca74

Browse files
aepflichrfwow
andauthored
test(flagd): use newest testbed launchpad (open-feature#1168)
Signed-off-by: Simon Schrottner <[email protected]> Signed-off-by: christian.lutnik <[email protected]> Co-authored-by: christian.lutnik <[email protected]>
1 parent d38e013 commit 3c8ca74

File tree

22 files changed

+121
-174
lines changed

22 files changed

+121
-174
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[submodule "providers/flagd/test-harness"]
55
path = providers/flagd/test-harness
66
url = https://github.com/open-feature/test-harness.git
7-
branch = v1.1.1
7+
branch = v1.3.3
88
[submodule "providers/flagd/spec"]
99
path = providers/flagd/spec
1010
url = https://github.com/open-feature/spec.git

providers/flagd/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,13 @@
150150
<scope>test</scope>
151151
</dependency>
152152
<dependency>
153-
<groupId>org.testcontainers</groupId>
154-
<artifactId>toxiproxy</artifactId>
155-
<version>1.20.4</version>
153+
<groupId>io.rest-assured</groupId>
154+
<artifactId>rest-assured</artifactId>
155+
<version>5.5.0</version>
156156
<scope>test</scope>
157157
</dependency>
158158
<!-- uncomment for logoutput during test runs -->
159-
160-
<dependency>
159+
<dependency>
161160
<groupId>org.slf4j</groupId>
162161
<artifactId>slf4j-simple</artifactId>
163162
<version>2.0.16</version>
@@ -254,7 +253,7 @@
254253
<configuration>
255254
<protocArtifact>com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}</protocArtifact>
256255
<pluginId>grpc-java</pluginId>
257-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.68.2:exe:${os.detected.classifier}</pluginArtifact>
256+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.69.1:exe:${os.detected.classifier}</pluginArtifact>
258257
<protoSourceRoot>${project.basedir}/schemas/protobuf/</protoSourceRoot>
259258
</configuration>
260259
<executions>

providers/flagd/schemas

providers/flagd/spec

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ EvaluationContext getEnrichedContext() {
209209
private void onProviderEvent(FlagdProviderEvent flagdProviderEvent) {
210210

211211
synchronized (eventsLock) {
212-
log.info("FlagdProviderEvent: {}", flagdProviderEvent);
212+
log.info("FlagdProviderEvent: {}", flagdProviderEvent.getEvent());
213213
eventsLock.syncMetadata = flagdProviderEvent.getSyncMetadata();
214214
if (flagdProviderEvent.getSyncMetadata() != null) {
215215
eventsLock.enrichedContext = contextEnricher.apply(flagdProviderEvent.getSyncMetadata());

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/ChannelMonitor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ public static void monitorChannelState(
4747
log.debug("onConnectionLost is null");
4848
}
4949
}
50-
// Re-register the state monitor to watch for the next state transition.
51-
monitorChannelState(currentState, channel, onConnectionReady, onConnectionLost);
50+
if (currentState != ConnectivityState.SHUTDOWN) {
51+
log.debug("shutting down grpc channel");
52+
// Re-register the state monitor to watch for the next state transition.
53+
monitorChannelState(currentState, channel, onConnectionReady, onConnectionLost);
54+
}
5255
});
5356
}
5457

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/grpc/EventStreamObserver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void onCompleted() {}
6464
* @param value the event stream response containing configuration change data
6565
*/
6666
private void handleConfigurationChangeEvent(EventStreamResponse value) {
67+
log.debug("Received provider change event");
6768
List<String> changedFlags = new ArrayList<>();
6869

6970
Map<String, Value> data = value.getData().getFieldsMap();
@@ -80,7 +81,7 @@ private void handleConfigurationChangeEvent(EventStreamResponse value) {
8081
* Handles provider readiness events by clearing the cache (if enabled) and notifying listeners of readiness.
8182
*/
8283
private void handleProviderReadyEvent() {
83-
log.info("Received provider ready event");
84+
log.debug("Received provider ready event");
8485
onReady.accept(new FlagdProviderEvent(ProviderEvent.PROVIDER_READY));
8586
}
8687
}

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/connector/grpc/GrpcStreamConnector.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ void observeEventStream(final BlockingQueue<QueuePayload> writeTo, final AtomicB
118118
metadataException = e;
119119
}
120120

121-
log.info("stream");
122121
while (!shutdown.get()) {
123122
final GrpcResponseModel response = streamReceiver.take();
124123
if (response.isComplete()) {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.org.slf4j.simpleLogger.defaultLogLevel=debug
2+
3+
io.grpc.level=trace
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dev.openfeature.contrib.providers.flagd.e2e;
1+
package dev.openfeature.contrib.providers.flagd;
22

33
import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME;
44
import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME;
@@ -18,5 +18,5 @@
1818
@IncludeEngines("cucumber")
1919
@SelectFile("test-harness/gherkin/config.feature")
2020
@ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty")
21-
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.steps")
22-
public class RunConfigCucumberTest {}
21+
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.steps.config")
22+
public class ConfigCucumberTest {}

0 commit comments

Comments
 (0)