You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-08-25 20:09:25 +02:00
34 lines
901 B
Groovy
34 lines
901 B
Groovy
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))
|
|
}
|
|
|
|
}
|