mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
749aa5e7ed
* adding step for writing metrics to InfluxDB including dependencies * added documentation * incorporated PR feedback
26 lines
822 B
Groovy
26 lines
822 B
Groovy
#!groovy
|
|
import com.lesfurets.jenkins.unit.BasePipelineTest
|
|
import org.junit.Rule
|
|
import org.junit.Test
|
|
import util.JenkinsSetupRule
|
|
import static org.junit.Assert.assertTrue
|
|
|
|
class DurationMeasureTest extends BasePipelineTest {
|
|
|
|
@Rule
|
|
public JenkinsSetupRule setupRule = new JenkinsSetupRule(this)
|
|
|
|
@Test
|
|
void testDurationMeasurement() throws Exception {
|
|
def cpe = loadScript("commonPipelineEnvironment.groovy").commonPipelineEnvironment
|
|
def script = loadScript("durationMeasure.groovy")
|
|
def bodyExecuted = false
|
|
script.call(script: [commonPipelineEnvironment: cpe], measurementName: 'test') {
|
|
bodyExecuted = true
|
|
}
|
|
assertTrue(cpe.getPipelineMeasurement('test') != null)
|
|
assertTrue(bodyExecuted)
|
|
assertJobStatusSuccess()
|
|
}
|
|
}
|