1
0
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:
Nikita Fedkin
2024-08-31 17:06:51 +02:00
parent b0639058a5
commit 6ae35d012b
2 changed files with 59 additions and 18 deletions

View 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))
}
}