Closed rsearls closed 4 years ago
Quarkus 1.2.0 now requires testng.
Can you expand on that? Because we are not supposed to use TestNG in Quarkus.
The pom.xml provided in the sample project contains the minimum archives required to compile and run the tests. Each one of the archives was added because of a compiler or test run issue in which a needed class was not present.
Comment out the archive for testng lines 65-69. Running the test "mvn test" displays the following msg. [ERROR] org.jboss.resteasy.test.core.basic.ByeTest Time elapsed: 1.082 s <<< ERROR! java.lang.reflect.InvocationTargetException Caused by: java.lang.NoClassDefFoundError: org/testng/annotations/BeforeClass
To resolve this I had to add the testng archive.
My test code has not changed between quarkus 1.1.1.Final and 1.2.0.Final
Updating to version 1.2.0.Final this issue occurred.
And none of my tests classes use or import any org/testng/* classes
Here is the stacktrace. The failure appears to be comming from at io.quarkus.arquillian.QuarkusTestNgCallbacks.invokeTestNgBeforeClasses(QuarkusTestNgCal lbacks.java:31)
"main@1" prio=5 tid=0x1 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at java.lang.NoClassDefFoundError.
The Arquillian adapter supports JUnit and TestNG, as the MicroProfile TCKs use one or the other depending on which spec it is.
I wonder if the issue is because the reproducer has the Arquillian TestNG container as a dependency instead of the JUnit one, which is triggering the TestNG methods in the Quarkus Arquillian adapter to be called?
The Aquillian adaptor supports TestNG but it is an optional dependency, and is invoked via reflection. You can only get this error if you include the TestNG arquillian support, but exclude TestNG itself. If you are not using TestNG make sure you don't have the testng arquillian support present.
Quarkus 1.2.0 now requires testng. This has introduced the following 2 issues. There are 2 issues.
Expected behavior
Actual behavior
The following msg is printed when 2 or more tests are in the testsuite.
[INFO] Running TestSuite
[TestNG] [ERROR] No test suite found. Nothing to run
Usage: [options] The XML suite files to run
Options: -configfailurepolicy Configuration failure policy (skip or continue) -d Output directory -dataproviderthreadcount Number of threads to use when running data providers -excludegroups Comma-separated list of group names to exclude -groups Comma-separated list of group names to be run -junit JUnit mode Default: false -listener List of .class files or list of class names implementing ITestListener or ISuiteListener -methods Comma separated of test methods Default: [] -methodselectors List of .class files or list of class names implementing IMethodSelector -mixed Mixed mode - autodetect the type of current test and run it with appropriate runner Default: false -objectfactory List of .class files or list of class names implementing ITestRunnerFactory -parallel Parallel mode (methods, tests or classes) Possible Values: [tests, methods, classes, instances, none, true, false] -port The port -reporter Extended configuration for custom report listener -suitename Default name of test suite, if not specified in suite definition file or source code -suitethreadpoolsize Size of the thread pool to use to run suites Default: 1 -testclass The list of test classes -testjar A jar file containing the tests -testname Default name of test, if not specified in suitedefinition file or source code -testnames The list of test names to run -testrunfactory, -testRunFactory The factory used to create tests -threadcount Number of threads to use when running tests in parallel -usedefaultlisteners Whether to use the default listeners Default: true -log, -verbose Level of verbosity -xmlpathinjar The full path to the xml file inside the jar file (only valid if -testjar was specified) Default: testng.xml
To Reproduce This project reproduces the issue, https://github.com/rsearls/quarkus-testng Follow the directions in the README file to setup the test properly.
Environment (please complete the following information):