ingwarsw / arquillian-suite-extension

Arquillian extension that will force single deployment for all tests
Apache License 2.0
67 stars 20 forks source link

Using JUnit 4 Jupiter Vintage engine prevents suite extension from working #69

Closed lprimak closed 3 years ago

lprimak commented 3 years ago

Currently, both JUnit 5 and 4 with suite extension works great! However, when I try to combine both types of tests using JUnit4 vintage engine, the suite stops working correctly, yielding multiple deployments where should only be one.

Reproducer: https://github.com/flowlogix/test-arq-suite/tree/JUnit4-Vintage Logs:

mvn -Ppayara-local clean verify
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< com.flowlogix:test-arq-suite >--------------------
[INFO] Building test-arq-suite 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ test-arq-suite ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.flowlogix.arqsuite.DeploymentOneTest
Dec 19, 2020 2:14:36 PM org.reflections.Reflections scan
INFO: Reflections took 32 ms to scan 1 urls, producing 4 keys and 5 values 
Dec 19, 2020 2:14:36 PM org.eu.ingwar.tools.arquillian.extension.suite.DeploymentClassFinder getDeploymentClassFromAnnotation
INFO: arquillian-suite-deployment: Found class annotated with @ArquillianSuiteDeployment: com.flowlogix.arqsuite.Deployments
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.766 s - in com.flowlogix.arqsuite.DeploymentOneTest
[INFO] Running com.flowlogix.arqsuite.DeploymentTwoTest
Dec 19, 2020 2:14:40 PM org.reflections.Reflections scan
INFO: Reflections took 1 ms to scan 1 urls, producing 4 keys and 5 values 
Dec 19, 2020 2:14:40 PM org.eu.ingwar.tools.arquillian.extension.suite.DeploymentClassFinder getDeploymentClassFromAnnotation
INFO: arquillian-suite-deployment: Found class annotated with @ArquillianSuiteDeployment: com.flowlogix.arqsuite.Deployments
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.723 s - in com.flowlogix.arqsuite.DeploymentTwoTest
[INFO] Running com.flowlogix.arqsuite.NumberOfDeploymentsTest
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.006 s <<< FAILURE! - in com.flowlogix.arqsuite.NumberOfDeploymentsTest
[ERROR] com.flowlogix.arqsuite.NumberOfDeploymentsTest  Time elapsed: 0.006 s  <<< FAILURE!
java.lang.AssertionError: Should only be one deployment expected:<1> but was:<2>
    at com.flowlogix.arqsuite.NumberOfDeploymentsTest.checkDeployments(NumberOfDeploymentsTest.java:19)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   NumberOfDeploymentsTest.checkDeployments:19 Should only be one deployment expected:<1> but was:<2>
[INFO] 
[ERROR] Tests run: 6, Failures: 1, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
lprimak commented 3 years ago

Hmmm... test containers listener doesn't work either, perhaps there is a deeper issue here...

lprimak commented 3 years ago

Other problems prevent stuff like this from running at all, so no need to worry about this I think JUnit 4 listeners don't work preventing test containers and other integrations running with the vintage engine at all