-
Notifications
You must be signed in to change notification settings - Fork 79
perf(flagd): run all 3 e2e resolver modes concurrently via @TestFactory #1753
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
Open
aepfli
wants to merge
15
commits into
main
Choose a base branch
from
feat/parameterized-e2e-suite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cca921a
perf(flagd): parallelize e2e scenarios via container pool
aepfli 41f983c
perf(flagd): enable parallel Cucumber execution with resource locks
aepfli 551159a
ci: point test-harness submodule to feat/add-env-var-tag branch
aepfli f9e647c
chore(flagd): reduce e2e test output verbosity
aepfli 32940e9
perf(flagd): scale e2e parallelism dynamically with available CPUs
aepfli 6b334f5
fix(flagd): cap container pool size to avoid Docker overload
aepfli 1dcb453
perf(flagd): run e2e resolver modes in parallel via @TestFactory
aepfli 9cefe73
test(flagd): exclude @targetURI from inProcess parallel run
aepfli b6a61c2
fix(flagd): address Gemini code review feedback
aepfli c41be4a
Merge branch 'main' into feat/parameterized-e2e-suite
aepfli f61955d
test(flagd): fix e2e resolver contamination and fractional-v1 under v…
aepfli 2f8afcf
test(flagd): pre-warm Testcontainers Docker client before parallel po…
aepfli bd86a10
test(flagd): isolate @env-var scenarios from concurrent config reads
aepfli f08af93
test(flagd): address CodeRabbit review on e2e harness robustness
aepfli 5362405
style(flagd): apply spotless formatting to RunE2ETests
aepfli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
103 changes: 103 additions & 0 deletions
103
...agd/src/test/java/dev/openfeature/contrib/providers/flagd/e2e/CucumberResultListener.java
This file contains hidden or 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,103 @@ | ||
| package dev.openfeature.contrib.providers.flagd.e2e; | ||
|
|
||
| import java.util.Collections; | ||
| import java.util.Map; | ||
| import java.util.Set; | ||
| import java.util.concurrent.ConcurrentHashMap; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.junit.platform.engine.TestExecutionResult; | ||
| import org.junit.platform.engine.reporting.ReportEntry; | ||
| import org.junit.platform.launcher.TestExecutionListener; | ||
| import org.junit.platform.launcher.TestIdentifier; | ||
| import org.junit.platform.launcher.TestPlan; | ||
|
|
||
| /** | ||
| * Captures the full lifecycle of a JUnit Platform test execution, tracking start, finish, and skip | ||
| * events for every node in the test plan (both containers and tests). Results are later replayed as | ||
| * JUnit Jupiter {@link org.junit.jupiter.api.DynamicTest} instances to expose the Cucumber scenario | ||
| * tree in IDEs. | ||
| */ | ||
| @Slf4j | ||
| class CucumberResultListener implements TestExecutionListener { | ||
|
|
||
| private final Set<String> started = Collections.newSetFromMap(new ConcurrentHashMap<>()); | ||
| private final Map<String, TestExecutionResult> results = new ConcurrentHashMap<>(); | ||
| private final Map<String, String> skipped = new ConcurrentHashMap<>(); | ||
|
|
||
| @Override | ||
| public void testPlanExecutionStarted(TestPlan testPlan) { | ||
| log.debug("Cucumber execution started"); | ||
| } | ||
|
|
||
| @Override | ||
| public void testPlanExecutionFinished(TestPlan testPlan) { | ||
| log.debug( | ||
| "Cucumber execution finished — started={}, finished={}, skipped={}", | ||
| started.size(), | ||
| results.size(), | ||
| skipped.size()); | ||
| } | ||
|
|
||
| @Override | ||
| public void executionStarted(TestIdentifier id) { | ||
| log.debug(" START {}", id.getDisplayName()); | ||
| started.add(id.getUniqueId()); | ||
| } | ||
|
|
||
| @Override | ||
| public void executionFinished(TestIdentifier id, TestExecutionResult result) { | ||
| results.put(id.getUniqueId(), result); | ||
| if (result.getStatus() == TestExecutionResult.Status.FAILED) { | ||
| log.debug( | ||
| " FAIL {} — {}", | ||
| id.getDisplayName(), | ||
| result.getThrowable().map(Throwable::getMessage).orElse("(no message)")); | ||
| } else { | ||
| log.debug(" {} {}", result.getStatus(), id.getDisplayName()); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public void executionSkipped(TestIdentifier id, String reason) { | ||
| skipped.put(id.getUniqueId(), reason); | ||
| log.debug(" SKIP {} — {}", id.getDisplayName(), reason); | ||
| } | ||
|
|
||
| @Override | ||
| public void dynamicTestRegistered(TestIdentifier id) { | ||
| log.debug(" DYN {}", id.getDisplayName()); | ||
| } | ||
|
|
||
| @Override | ||
| public void reportingEntryPublished(TestIdentifier id, ReportEntry entry) { | ||
| log.debug(" REPORT {} — {}", id.getDisplayName(), entry); | ||
| } | ||
|
|
||
| /** Whether the node with the given unique ID had {@code executionStarted} called. */ | ||
| boolean wasStarted(String uniqueId) { | ||
| return started.contains(uniqueId); | ||
| } | ||
|
|
||
| /** Whether the node was skipped before starting. */ | ||
| boolean wasSkipped(String uniqueId) { | ||
| return skipped.containsKey(uniqueId); | ||
| } | ||
|
|
||
| /** The skip reason for a skipped node, or {@code null} if not skipped. */ | ||
| String getSkipReason(String uniqueId) { | ||
| return skipped.get(uniqueId); | ||
| } | ||
|
|
||
| /** Whether a finished result was recorded for the given node. */ | ||
| boolean hasResult(String uniqueId) { | ||
| return results.containsKey(uniqueId); | ||
| } | ||
|
|
||
| /** | ||
| * The recorded {@link TestExecutionResult}, or {@code null} if the node never finished. | ||
| * Use {@link #hasResult} to distinguish "finished with success" from "never finished". | ||
| */ | ||
| TestExecutionResult getResult(String uniqueId) { | ||
| return results.get(uniqueId); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.