JenkinsPipelineUnit
JenkinsPipelineUnit copied to clipboard
Cannot run inline script when shared library is loaded
Jenkins and plugins versions report
Environment
Paste the output here
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows
Reproduction steps
Unable to run this test:
import com.lesfurets.jenkins.unit.BasePipelineTest
import org.junit.Before
import org.junit.Test
import static com.lesfurets.jenkins.unit.global.lib.LibraryConfiguration.library
import static com.lesfurets.jenkins.unit.global.lib.ProjectSource.projectSource
class TestingExamplesFromGithub extends BasePipelineTest {
@Override
@Before
void setUp() throws Exception {
super.setUp()
def library = library().name('commons')
.defaultVersion('<notNeeded>')
.allowOverride(true)
.implicit(true)
.targetPath('<notNeeded>')
.retriever(projectSource())
.build()
helper.registerSharedLibrary(library)
}
@Test
void testSomeScript() throws Exception {
def script = runInlineScript('''
node {
stage('Build') {
echo 'make'
}
}
''')
printCallStack()
assertJobStatusSuccess()
}
}
Expected Results
Test is run, stack is displayed, assertion is made.
Actual Results
Test is hanging.
Anything else?
When library is not loaded, the test can be executed successfully.
What is this play with "bug" label about? Should it not be used at all? Could you explain it @nre-ableton ?
I removed all labels except for "dependabot", which gets added automatically by the dependabot service by GitHub and can't be avoided. The labels weren't useful and just cluttered up the backlog.