Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48353

junit-dep blocking testCompile using jUnit 4.12

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • gradle-jpi-plugin
    • None
    • jenkins core: 2.60.3

      Jenkins Test Harness and Jenkins core both use newer jUnit 4.12 so I don't understand why gradle-jpi is introducing junit-dep which is deprecated even and removed in Jenkins as of "jenkins-1.505"

      though it might be the fact that I am working with PluginFirstLoader enabled. However it causes the following error

      java.lang.NoSuchMethodError: org.junit.rules.Timeout.seconds(J)Lorg/junit/rules/Timeout;
      
      at org.jvnet.hudson.test.JenkinsRule.apply(JenkinsRule.java:574)
      at org.junit.rules.RunRules.applyAll(RunRules.java:24)
      at org.junit.rules.RunRules.<init>(RunRules.java:13)
      at org.junit.runners.BlockJUnit4ClassRunner.withTestRules(BlockJUnit4ClassRunner.java:376)
      at org.junit.runners.BlockJUnit4ClassRunner.withRules(BlockJUnit4ClassRunner.java:331)
      at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
      

      5 years ago, junit-dep was removed from Jenkins: https://github.com/jenkinsci/jenkins/commit/b956c4c9c5cfc808f467ff04a5eec1b9e1cd9985
      Core, 2 year old commit forĀ 4.12: https://github.com/jenkinsci/jenkins/commit/d708b389ee73fbc07dc37a2b02b72f26c7e01d7b
      Test harness, 2 year old commit: https://github.com/jenkinsci/jenkins-test-harness/commit/ac5f86aabfc5e8b77c2081105992478c0efbba89

      lucky there is a workaround:

      configurations.forEach { it.exclude(module = "junit-dep") }
      

            daspilker Daniel Spilker
            casz Joseph Petersen (old)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: