You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-08-25 20:09:25 +02:00
Dry-run pipeline1C test
This commit is contained in:
33
test/integration/groovy/pipeline1cTest.groovy
Normal file
33
test/integration/groovy/pipeline1cTest.groovy
Normal file
@@ -0,0 +1,33 @@
|
||||
import hudson.model.Label
|
||||
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition
|
||||
import org.jenkinsci.plugins.workflow.job.WorkflowJob
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.jvnet.hudson.test.JenkinsRule
|
||||
|
||||
class pipeline1cTest {
|
||||
|
||||
@Rule
|
||||
public JenkinsRule rule = new JenkinsRule()
|
||||
|
||||
@Before
|
||||
void configureGlobalGitLibraries() {
|
||||
RuleBootstrapper.setup(rule)
|
||||
}
|
||||
|
||||
@Test
|
||||
void "pipeline1C should do something"() {
|
||||
def pipeline = '''
|
||||
pipeline1C()
|
||||
'''.stripIndent()
|
||||
|
||||
rule.createSlave(Label.get("agent"))
|
||||
final CpsFlowDefinition flow = new CpsFlowDefinition(pipeline, true)
|
||||
final WorkflowJob workflowJob = rule.createProject(WorkflowJob, 'project')
|
||||
workflowJob.definition = flow
|
||||
|
||||
rule.assertLogContains('(pre-stage)', rule.buildAndAssertSuccess(workflowJob))
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user