Search in sources :

Example 1 with RCAVisualizer

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

the class TestRCAVisualizer method testHTMLGeneration.

@Test
public void testHTMLGeneration() throws Exception {
    final File testChangeFile = new File("src/test/resources/demo-results/rca/changes.json");
    ProjectChanges changes = Constants.OBJECTMAPPER.readValue(testChangeFile, ProjectChanges.class);
    initFolders();
    final File visualizationResultFolder = new File(folder.getRoot(), "visualization_result");
    final Run run = mockRun(visualizationResultFolder);
    // Calls the RCAVisualizer, which should be tested
    MeasurementConfig measurementConfig = new MeasurementConfig(2);
    measurementConfig.getExecutionConfig().setVersion("b02c92af73e3297be617f4c973a7a63fb603565b");
    VisualizationFolderManager visualizationFolders = new VisualizationFolderManager(folder.getRoot(), "project", run);
    RCAVisualizer visualizer = new RCAVisualizer(measurementConfig, visualizationFolders, changes, run);
    visualizer.visualizeRCA();
    testCorrectResult(run, visualizationResultFolder);
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) RCAVisualizer(de.dagere.peass.ci.helper.RCAVisualizer) ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) Run(hudson.model.Run) VisualizationFolderManager(de.dagere.peass.ci.helper.VisualizationFolderManager) File(java.io.File) Test(org.junit.Test)

Example 2 with RCAVisualizer

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

the class TestRCAVisualizerPrefix method createChangefileActions.

private Run createChangefileActions(final File changefile) throws IOException, StreamReadException, DatabindException {
    ProjectChanges changes = Constants.OBJECTMAPPER.readValue(changefile, ProjectChanges.class);
    Changes versionChanges = changes.getVersionChanges().values().iterator().next();
    String longestPrefix = RCAVisualizer.getLongestPrefix(versionChanges.getTestcaseChanges().keySet());
    Run run = Mockito.mock(Run.class);
    RCAVisualizer rcaVisualizer = new RCAVisualizer(null, null, null, run);
    for (Entry<String, List<Change>> testcases : versionChanges.getTestcaseChanges().entrySet()) {
        for (Change change : testcases.getValue()) {
            final String name = testcases.getKey() + "_" + change.getMethod();
            rcaVisualizer.createRCAAction(new File("target/"), longestPrefix, testcases, change, name, changefile);
        }
    }
    return run;
}
Also used : Changes(de.dagere.peass.analysis.changes.Changes) ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) RCAVisualizer(de.dagere.peass.ci.helper.RCAVisualizer) ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) Run(hudson.model.Run) List(java.util.List) Change(de.dagere.peass.analysis.changes.Change) File(java.io.File)

Example 3 with RCAVisualizer

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

the class LocalPeassProcessManager method visualizeRCAResults.

public void visualizeRCAResults(final Run<?, ?> run, final ProjectChanges changes) throws Exception, IOException {
    final RCAVisualizer rcaVisualizer = new RCAVisualizer(peassConfig.getMeasurementConfig(), visualizationFolders, changes, run);
    rcaVisualizer.visualizeRCA();
    if (peassConfig.isDisplayRCALogs()) {
        logActionCreator.createRCAActions();
    }
}
Also used : RCAVisualizer(de.dagere.peass.ci.helper.RCAVisualizer)

Aggregations

RCAVisualizer (de.dagere.peass.ci.helper.RCAVisualizer)3 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)2 Run (hudson.model.Run)2 File (java.io.File)2 Change (de.dagere.peass.analysis.changes.Change)1 Changes (de.dagere.peass.analysis.changes.Changes)1 VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)1 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)1 List (java.util.List)1 Test (org.junit.Test)1