Skip to content
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

parallel data provider does not work correctly with injected stages #198

Open
adrian-herscu opened this issue Sep 26, 2023 · 5 comments · Fixed by #201
Open

parallel data provider does not work correctly with injected stages #198

adrian-herscu opened this issue Sep 26, 2023 · 5 comments · Fixed by #201
Assignees
Labels
blocked Blocked due to some external issue enhancement New feature or request
Milestone

Comments

@adrian-herscu
Copy link
Collaborator

Current State
Parallel data provider does not work correctly with injected stages.

How to make it better
Per documentation it seems parallel issues were fixed in JGiven 1.3.0.
However, this requires dropping support of JDK 8 and reworking part of the report generators since the model was changed a bit.

@adrian-herscu adrian-herscu added the enhancement New feature or request label Sep 26, 2023
@adrian-herscu adrian-herscu self-assigned this Sep 26, 2023
@adrian-herscu
Copy link
Collaborator Author

TNG/JGiven#829

@adrian-herscu
Copy link
Collaborator Author

TNG/JGiven#883

@adrian-herscu adrian-herscu changed the title migrate to jgiven 1.3.0 and testng 7.8.0 drop jdk8 support and migrate to jgiven 1.3.0 and testng 7.8.0 Oct 10, 2023
@adrian-herscu
Copy link
Collaborator Author

There are dependencies which are still not modularized in JDK 11 sense, causing qa-jgiven-commons to fail building:

03:06:52 [INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ qa-jgiven-commons ---
03:06:52 [WARNING] Can't extract module name from batik-script-1.14.jar: Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in module
03:06:52 [WARNING] Can't extract module name from json-path-assert-2.5.0.jar: json.path.assert: Invalid module name: 'assert' is not a Java identifier
03:06:52 [WARNING] Can't extract module name from java-8-matchers-1.9.jar: java.8.matchers: Invalid module name: '8' is not a Java identifier
03:06:52 [WARNING] Can't extract module name from xalan-2.7.2.jar: Provider class org.apache.bsf.BSFManager not in module
03:06:52 [INFO] Compiling 15 source files with javac [debug release 11 module-path] to target\test-classes
03:06:53 [INFO] -------------------------------------------------------------
03:06:53 [ERROR] COMPILATION ERROR :
03:06:53 [INFO] -------------------------------------------------------------
03:06:53 [ERROR] module not found: org.openqa.selenium.core
03:06:53 [ERROR] module not found: httpcore
03:06:53 [ERROR] module not found: httpclient

https://stackoverflow.com/questions/67588895/porting-maven-project-from-jdk-8-to-higher
https://issues.apache.org/jira/projects/MCOMPILER/issues/MCOMPILER-464

@adrian-herscu
Copy link
Collaborator Author

Parallel data providers not supported in 1.3.0
TNG/JGiven#829 (comment)

@adrian-herscu adrian-herscu changed the title drop jdk8 support and migrate to jgiven 1.3.0 and testng 7.8.0 parallel data provider does not work correctly with injected stages Nov 9, 2023
@adrian-herscu adrian-herscu linked a pull request Nov 9, 2023 that will close this issue
@adrian-herscu
Copy link
Collaborator Author

adrian-herscu commented Dec 4, 2023

JGiven stage injection does not work well when activated via multiple threads.

TNG/JGiven#829
TNG/JGiven#491

The only workaround so far is to use dynamic stages.

In the base scenario class there should be protected methods returning each of required stages, like this:

    protected XxxxxElasticSearchActions<?> elasticSearchActions() {
        return addStage(XxxxxElasticSearchActions.class);
    }

Note that JGiven's before/after annotations will not work, hence must call these methods directly on returned stage. See TNG/JGiven#1447

Then, in scenario code:

        elasticSearchVerifications().then()
            .the_xxxx(testData.request.id,
                is(Xxxxx.from(testData.request)));

@adrian-herscu adrian-herscu added the blocked Blocked due to some external issue label Dec 4, 2023
@adrian-herscu adrian-herscu reopened this Dec 4, 2023
@adrian-herscu adrian-herscu removed a link to a pull request Dec 4, 2023
@adrian-herscu adrian-herscu modified the milestones: 1.0.0, 2.0.0 Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked due to some external issue enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant