Search in sources :

Example 1 with DefaultMeasurementVisualizer

use of de.dagere.peass.ci.helper.DefaultMeasurementVisualizer in project peass-ci-plugin by jenkinsci.

the class TestMeasurementVisualizer method testParameterizedVisualization.

@Test
public void testParameterizedVisualization() {
    HashSet<String> tests = new LinkedHashSet<>();
    tests.add("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-0)");
    tests.add("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-1)");
    File exampleDataFolder = new File("src/test/resources/demo-results-measurements/measurement_a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b_49f75e8877c2e9b7cf6b56087121a35fdd73ff8b/");
    Run run = Mockito.mock(Run.class);
    VisualizationFolderManager visualizationFolderManager = Mockito.mock(VisualizationFolderManager.class);
    DefaultMeasurementVisualizer visualizer = new DefaultMeasurementVisualizer(exampleDataFolder, "a12a0b7f4c162794fca0e7e3fcc6ea3b3a2cbc2b", run, visualizationFolderManager, tests);
    visualizer.visualizeMeasurements();
    ArgumentCaptor<MeasurementVisualizationAction> captor = ArgumentCaptor.forClass(MeasurementVisualizationAction.class);
    Mockito.verify(run, Mockito.times(2)).addAction(captor.capture());
    MeasurementVisualizationAction action1 = captor.getAllValues().get(0);
    Assert.assertEquals(action1.getDisplayName(), "measurement_ExampleTest_test(JUNIT_PARAMETERIZED-0)");
    MeasurementVisualizationAction action2 = captor.getAllValues().get(1);
    Assert.assertEquals(action2.getDisplayName(), "measurement_ExampleTest_test(JUNIT_PARAMETERIZED-1)");
    Map<String, TestcaseStatistic> noWarmupStatistics = visualizer.getNoWarmupStatistics();
    Assert.assertTrue(noWarmupStatistics.containsKey("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-0)"));
    Assert.assertTrue(noWarmupStatistics.containsKey("de.dagere.peass.ExampleTest#test(JUNIT_PARAMETERIZED-1)"));
}
Also used : LinkedHashSet(java.util.LinkedHashSet) TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) DefaultMeasurementVisualizer(de.dagere.peass.ci.helper.DefaultMeasurementVisualizer) Run(hudson.model.Run) VisualizationFolderManager(de.dagere.peass.ci.helper.VisualizationFolderManager) File(java.io.File) MeasurementVisualizationAction(de.dagere.peass.ci.MeasurementVisualizationAction) Test(org.junit.jupiter.api.Test)

Example 2 with DefaultMeasurementVisualizer

use of de.dagere.peass.ci.helper.DefaultMeasurementVisualizer in project peass-ci-plugin by jenkinsci.

the class LocalPeassProcessManager method createPureMeasurementVisualization.

private Map<String, TestcaseStatistic> createPureMeasurementVisualization(final Run<?, ?> run, final File dataFolder, final Map<String, HistogramValues> measurements) {
    DefaultMeasurementVisualizer visualizer = new DefaultMeasurementVisualizer(dataFolder, peassConfig.getMeasurementConfig().getExecutionConfig().getVersion(), run, visualizationFolders, measurements.keySet());
    visualizer.visualizeMeasurements();
    Map<String, TestcaseStatistic> noWarmupStatistics = visualizer.getNoWarmupStatistics();
    return noWarmupStatistics;
}
Also used : TestcaseStatistic(de.dagere.peass.measurement.statistics.data.TestcaseStatistic) DefaultMeasurementVisualizer(de.dagere.peass.ci.helper.DefaultMeasurementVisualizer)

Aggregations

DefaultMeasurementVisualizer (de.dagere.peass.ci.helper.DefaultMeasurementVisualizer)2 TestcaseStatistic (de.dagere.peass.measurement.statistics.data.TestcaseStatistic)2 MeasurementVisualizationAction (de.dagere.peass.ci.MeasurementVisualizationAction)1 VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)1 Run (hudson.model.Run)1 File (java.io.File)1 LinkedHashSet (java.util.LinkedHashSet)1 Test (org.junit.jupiter.api.Test)1