use of de.dagere.peass.ci.MeasureVersionAction in project peass-ci-plugin by jenkinsci.
the class MeasureVersionBuilderTest method testFullBuild.
@Test
public void testFullBuild() throws Exception {
// Windows tends to create some strange errors when trying to copy .git-folders; therefore, windows builds are currently not fully supported
Assume.assumeFalse(EnvironmentVariables.isWindows());
// On Github actions, this test currently fails because of timeout - try to use higher timeout
jenkins.timeout = 5 * 60;
FreeStyleProject project = jenkins.createFreeStyleProject();
initProjectFolder(project);
MeasureVersionBuilder builder = createSimpleBuilder();
project.getBuildersList().add(builder);
project = jenkins.configRoundtrip(project);
FreeStyleBuild build = jenkins.buildAndAssertSuccess(project);
MeasureVersionAction action = build.getActions(MeasureVersionAction.class).get(0);
Assert.assertEquals(ITERATIONS, action.getConfig().getIterations());
Assert.assertEquals(VMS, action.getConfig().getVms());
Assert.assertEquals(REPETITIONS, action.getConfig().getRepetitions());
Assert.assertEquals(WARMUP, action.getConfig().getWarmup());
Assert.assertEquals(0.05, action.getConfig().getStatisticsConfig().getType1error(), 0.01);
}
use of de.dagere.peass.ci.MeasureVersionAction in project peass-ci-plugin by jenkinsci.
the class TestMeasureVersionAction method testPrefix.
@Test
public void testPrefix() {
final ProjectChanges changes = getChanges();
HashMap<String, HistogramValues> measurements = new HashMap<String, HistogramValues>();
measurements.put("de.package.ClassA#method1", null);
measurements.put("de.package.ClassA#method2", null);
measurements.put("de.package.ClassB#method2", null);
measurements.put("de.package.otherpackage.ClassC#method2", null);
MeasureVersionAction action = new MeasureVersionAction(new MeasurementConfig(5), changes.getVersion("1"), new ProjectStatistics(), new HashMap<>(), measurements, new HashMap<>());
Assert.assertEquals("ClassA", action.getReducedName("de.package.ClassA"));
Assert.assertEquals("otherpackage.ClassC", action.getReducedName("de.package.otherpackage.ClassC"));
}
use of de.dagere.peass.ci.MeasureVersionAction in project peass-ci-plugin by jenkinsci.
the class TestMeasureVersionAction method testIsChanged.
@Test
public void testIsChanged() {
final ProjectChanges changes = getChanges();
MeasureVersionAction action = new MeasureVersionAction(new MeasurementConfig(5), changes.getVersion("1"), new ProjectStatistics(), new HashMap<>(), new HashMap<>(), new HashMap<>());
Assert.assertTrue(action.testIsChanged("de.package.ClassA#method1"));
Assert.assertTrue(action.testIsChanged("de.package.ClassA#method2"));
Assert.assertTrue(action.testIsChanged("de.package.ClassB#method2"));
}
use of de.dagere.peass.ci.MeasureVersionAction in project peass-ci-plugin by jenkinsci.
the class TestHistogramReader method testHistogramCreation.
@Test
public void testHistogramCreation() throws JAXBException {
MeasurementConfig measurementConfig = new MeasurementConfig(2);
measurementConfig.getExecutionConfig().setVersion("b02c92af73e3297be617f4c973a7a63fb603565b");
measurementConfig.getExecutionConfig().setVersionOld("e80d8a1bf747d1f70dc52260616b36cac9e44561");
measurementConfig.setWarmup(2);
measurementConfig.setIterations(2);
measurementConfig.setRepetitions(2);
HistogramReader reader = new HistogramReader(measurementConfig, new File(EXAMPLE_DATA_FOLDER, "b02c92af73e3297be617f4c973a7a63fb603565b"));
Map<String, HistogramValues> measurements = reader.readMeasurements();
double[] valuesBefore = measurements.get("de.test.CalleeTest#onlyCallMethod1").getValuesBefore();
double[] valuesCurrent = measurements.get("de.test.CalleeTest#onlyCallMethod1").getValuesCurrent();
MeasureVersionAction measureVersionActionMock = Mockito.mock(MeasureVersionAction.class);
when(measureVersionActionMock.getValuesReadable(any(double[].class))).thenCallRealMethod();
Assert.assertEquals(2, measureVersionActionMock.getValuesReadable(valuesBefore).split(",").length);
Assert.assertEquals(2, measureVersionActionMock.getValuesReadable(valuesCurrent).split(",").length);
Assert.assertFalse(reader.measurementConfigurationUpdated());
}
use of de.dagere.peass.ci.MeasureVersionAction in project peass-ci-plugin by jenkinsci.
the class LocalPeassProcessManager method visualizeMeasurementResults.
public ProjectChanges visualizeMeasurementResults(final Run<?, ?> run) throws JAXBException, IOException, JsonParseException, JsonMappingException, JsonGenerationException {
File dataFolder = results.getVersionFullResultsFolder(peassConfig.getMeasurementConfig());
final HistogramReader histogramReader = new HistogramReader(peassConfig.getMeasurementConfig(), dataFolder);
final Map<String, HistogramValues> measurements = histogramReader.readMeasurements();
final ProjectChanges changes = getChanges();
final ProjectStatistics statistics = readStatistics();
TrendFileUtil.persistTrend(run, localWorkspace, statistics);
Map<String, TestcaseStatistic> noWarmupStatistics = createPureMeasurementVisualization(run, dataFolder, measurements);
Changes versionChanges = changes.getVersion(peassConfig.getMeasurementConfig().getExecutionConfig().getVersion());
final MeasureVersionAction action = new MeasureVersionAction(peassConfig.getMeasurementConfig(), versionChanges, statistics, noWarmupStatistics, measurements, histogramReader.getUpdatedConfigurations());
run.addAction(action);
return changes;
}
Aggregations