1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/test/groovy/DurationMeasureTest.groovy
Oliver Nocon 749aa5e7ed
InfluxDB support (#52)
* adding step for writing metrics to InfluxDB including dependencies
* added documentation
* incorporated PR feedback
2018-01-24 09:55:38 +01:00

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