Search in sources :

Example 21 with ProjectChanges

use of de.dagere.peass.analysis.changes.ProjectChanges in project peass by DaGeRe.

the class TestChangeReader method testParameterizedUsage.

@Test
public void testParameterizedUsage() throws JAXBException, JsonProcessingException {
    ChangeReader reader = new ChangeReader("demo-parameterized", new ExecutionData());
    ProjectChanges changes = reader.readFile(TestAnalyseFullData.PARAM_DATA_FOLDER);
    System.out.println(Constants.OBJECTMAPPER.writeValueAsString(changes));
    List<Change> methodChanges = checkParameterizedResult(changes);
    Assert.assertEquals(4232151.27, methodChanges.get(0).getOldTime(), 0.1);
}
Also used : ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) ChangeReader(de.dagere.peass.analysis.changes.ChangeReader) Change(de.dagere.peass.analysis.changes.Change) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData) Test(org.junit.jupiter.api.Test)

Example 22 with ProjectChanges

use of de.dagere.peass.analysis.changes.ProjectChanges in project peass by DaGeRe.

the class ContinuousExecutorIT method checkChangesJson.

private void checkChangesJson() throws IOException, JsonParseException, JsonMappingException {
    File changeFile = new File(fullPeassFolder, "changes.json");
    ProjectChanges changes = Constants.OBJECTMAPPER.readValue(changeFile, ProjectChanges.class);
    String changedTestClass = changes.getVersion("ff2ab99a0d24c90abe610fb318a17db6da473208").getTestcaseChanges().keySet().iterator().next();
    TestCase tc = new TestCase(changedTestClass);
    Assert.assertEquals("com.example.android_example.ExampleUnitTest", tc.getClazz());
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) File(java.io.File) ZipFile(net.lingala.zip4j.ZipFile)

Example 23 with ProjectChanges

use of de.dagere.peass.analysis.changes.ProjectChanges in project peass-ci-plugin by jenkinsci.

the class MeasureVersionBuilder method measure.

private void measure(final Run<?, ?> run, final LocalPeassProcessManager processManager, final Set<TestCase> tests) throws IOException, InterruptedException, JAXBException, JsonParseException, JsonMappingException, JsonGenerationException, Exception {
    boolean worked = processManager.measure(tests);
    if (!worked) {
        run.setResult(Result.FAILURE);
        return;
    }
    ProjectChanges changes = processManager.visualizeMeasurementResults(run);
    if (executeRCA) {
        final CauseSearcherConfig causeSearcherConfig = generateCauseSearchConfig();
        boolean rcaWorked = processManager.rca(changes, causeSearcherConfig);
        if (!rcaWorked) {
            run.setResult(Result.FAILURE);
            return;
        }
        processManager.visualizeRCAResults(run, changes);
    }
}
Also used : ProjectChanges(de.dagere.peass.analysis.changes.ProjectChanges) CauseSearcherConfig(de.dagere.peass.measurement.rca.CauseSearcherConfig)

Aggregations

ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)23 File (java.io.File)14 Change (de.dagere.peass.analysis.changes.Change)7 VersionChangeProperties (de.dagere.peass.analysis.properties.VersionChangeProperties)6 Changes (de.dagere.peass.analysis.changes.Changes)5 Test (org.junit.Test)5 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)4 LinkedList (java.util.LinkedList)4 RepoFolders (de.dagere.peass.analysis.all.RepoFolders)3 ChangeReader (de.dagere.peass.analysis.changes.ChangeReader)3 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)3 MeasureVersionAction (de.dagere.peass.ci.MeasureVersionAction)3 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)3 ChangeProperties (de.dagere.peass.analysis.properties.ChangeProperties)2 ChangeProperty (de.dagere.peass.analysis.properties.ChangeProperty)2 HistogramValues (de.dagere.peass.ci.helper.HistogramValues)2 RCAVisualizer (de.dagere.peass.ci.helper.RCAVisualizer)2 StatisticsConfig (de.dagere.peass.config.StatisticsConfig)2 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)2