Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-15167

Force JUnit 4 provider for Surefire

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.9.6-SNAPSHOT
    • Fix Version/s: 6.0
    • Component/s: Tests
    • Sprint:
      DevOps Sprint 6
    • Story Points:
      1

      Description

      The maven-surefire-plugin switches to TestNG if org.testng:testng:test is in its classpath.
      Since we want to use JUnit and may have an unexpected testng inherited dependency, the JUnit provider must be explicitly set on Surefire.

      Issue looks like this:

      [INFO] --- maven-surefire-plugin:2.17:test (default-test) @ nuxeo-drive-operations ---
      [INFO] Surefire report directory: /opt/jenkins/workspace/addons_nuxeo-drive-master/nuxeo-drive-server/nuxeo-drive-operations/target/surefire-reports
      
      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running TestSuite
      Configuring TestNG with: TestNGMapConfigurator
      [TestNG] [ERROR] No test suite found. Nothing to run
      (...)java.io.FileNotFoundException: /opt/jenkins/workspace/addons_nuxeo-drive-master/nuxeo-drive-server/nuxeo-drive-operations/target/surefire-reports/testng.css (No such file or directory)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
      	at org.testng.internal.Utils.writeResourceToFile(Utils.java:459)
      	at org.testng.reporters.HtmlHelper.generateStylesheet(HtmlHelper.java:25)
      	at org.testng.reporters.SuiteHTMLReporter.generateReport(SuiteHTMLReporter.java:48)
      	at org.testng.TestNG.generateReports(TestNG.java:936)
      	at org.testng.TestNG.run(TestNG.java:914)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:204)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:107)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:112)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Configuring TestNG with: TestNGMapConfigurator
      org.testng.TestNGException: 
      Failure in JUnit mode for class org.nuxeo.drive.operations.TestGetChangeSummary: could not create/run JUnit test suite: 
      Cannot find JUnit method class junit.framework.TestSuite$1.warning
      	at org.testng.junit.JUnitTestRunner.runFailed(JUnitTestRunner.java:237)
      	at org.testng.junit.JUnitTestRunner.start(JUnitTestRunner.java:230)
      	at org.testng.junit.JUnitTestRunner.run(JUnitTestRunner.java:211)
      	at org.testng.TestRunner$1.run(TestRunner.java:659)
      	at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
      	at org.testng.TestRunner.privateRunJUnit(TestRunner.java:690)
      	at org.testng.TestRunner.run(TestRunner.java:597)
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
      	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
      	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
      	at org.testng.SuiteRunner.run(SuiteRunner.java:223)
      	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
      	at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
      	at org.testng.TestNG.run(TestNG.java:900)
      	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:115)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:211)
      	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:107)
      	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:112)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.