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