No more JUnit classes on Jenkins

12 views
Skip to first unread message

mr_blanket

unread,
May 18, 2022, 12:24:50 PMMay 18
to Jenkins Users
Hi all!

Bigger picture ... When I started with Jenkins shared library, pipelines I hit some CPS issues. Since then I was running shared library tests using JUnit on 2.152 on Jenkins itself (as part of groovy pipelines).

On recent Jenkins this does not work anymore. Seems like this was removed as part of https://issues.jenkins.io/browse/JENKINS-63269

Now in script console executing:

import groovy.util.GroovyTestCase throws java.lang.ClassNotFoundException: junit.framework.TestCase.

import groovy.test.GroovyAssert throws java.lang.ClassNotFoundException: org.junit.Assert

Would adding a junit.jar back to jenkins be OK or a terrible hack?

What would be the best way to add this back?

The only way I've managed to achieve this so far was to directly update jenkins.war with WEB-INF/lib/junit.jar.

Thank you!

Best regards, B.
Reply all
Reply to author
Forward
0 new messages