Search in sources :

Example 6 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.

the class ContinuousDependencyReader method doPartialRCS.

private void doPartialRCS(final StaticTestSelection dependencies, final VersionIterator newIterator) {
    DependencyReader reader = new DependencyReader(dependencyConfig, folders, resultsFolders, dependencies.getUrl(), newIterator, new VersionKeeper(new File(resultsFolders.getStaticTestSelectionFile().getParentFile(), "nochanges.json")), executionConfig, kiekerConfig, env);
    newIterator.goTo0thCommit();
    reader.readCompletedVersions(dependencies);
    try {
        ExecutionData executions = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
        reader.setExecutionData(executions);
        if (resultsFolders.getCoverageSelectionFile().exists()) {
            ExecutionData coverageExecutions = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageSelectionFile(), ExecutionData.class);
            reader.setCoverageExecutions(coverageExecutions);
            if (resultsFolders.getCoverageInfoFile().exists()) {
                CoverageSelectionInfo coverageInfo = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageInfoFile(), CoverageSelectionInfo.class);
                reader.setCoverageInfo(coverageInfo);
            }
        }
        reader.readDependencies();
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : VersionKeeper(de.dagere.peass.dependency.reader.VersionKeeper) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) IOException(java.io.IOException) File(java.io.File) CoverageSelectionInfo(de.dagere.peass.dependency.traces.coverage.CoverageSelectionInfo) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 7 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.

the class ContinuousDependencyReader method selectResults.

private Set<TestCase> selectResults(final String version) {
    try {
        final Set<TestCase> tests;
        if (dependencyConfig.isGenerateCoverageSelection()) {
            LOG.info("Using coverage-based test selection");
            ExecutionData executionData = Constants.OBJECTMAPPER.readValue(resultsFolders.getCoverageSelectionFile(), ExecutionData.class);
            tests = fetchTestset(version, executionData);
        } else {
            LOG.info("Using dynamic test selection results");
            ExecutionData executionData = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
            tests = fetchTestset(version, executionData);
        }
        return tests;
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) IOException(java.io.IOException) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 8 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.

the class CopyFromFull method main.

public static void main(final String[] args) throws JsonParseException, JsonMappingException, IOException, InterruptedException, JAXBException {
    final RepoFolders folders = new RepoFolders();
    File reexecuteFolder = new File("results/reexecute-validation");
    reexecuteFolder.mkdirs();
    for (String project : GetValidationExecutionFile.VALIDATION_PROJECTS) {
        LOG.info("Analyzing {}", project);
        File executionFile = GetValidationExecutionFile.getValidationExecutionFile(project);
        final ExecutionData tests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
        final File projectFolder = new File(folders.getCleanDataFolder(), project);
        File goal = folders.getValidationDataFolder(project);
        // mergeAllFiles(tests, projectFolder, goal);
        mergeAllFiles(tests, goal, projectFolder);
    }
}
Also used : File(java.io.File) RepoFolders(de.dagere.peass.analysis.all.RepoFolders) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 9 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.

the class FindMissingValidation method main.

public static void main(final String[] args) throws JsonParseException, JsonMappingException, IOException, JAXBException {
    final RepoFolders folders = new RepoFolders();
    File reexecuteFolder = new File("results/reexecute-validation");
    reexecuteFolder.mkdirs();
    for (String project : GetValidationExecutionFile.VALIDATION_PROJECTS) {
        LOG.info("Analyzing {}", project);
        File executionFile = GetValidationExecutionFile.getValidationExecutionFile(project);
        ExecutionData tests = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
        MissingExecutionFinder missingExecutionFinder = new MissingExecutionFinder(project, reexecuteFolder, tests, "commentExec");
        missingExecutionFinder.findMissing(new File[] { folders.getValidationDataFolder(project) });
    }
}
Also used : MissingExecutionFinder(de.dagere.peass.reexecutions.MissingExecutionFinder) File(java.io.File) RepoFolders(de.dagere.peass.analysis.all.RepoFolders) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 10 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass by DaGeRe.

the class TestExecutionMerging method mergeWrittenExecutions.

@Test
public void mergeWrittenExecutions() throws JsonGenerationException, JsonMappingException, IOException {
    ResultsFolders[] folders = new ResultsFolders[3];
    for (int i = 0; i < 3; i++) {
        ExecutionData ex1 = createExecutionData(i);
        Constants.OBJECTMAPPER.writeValue(new File("target/execute-" + i + ".json"), ex1);
        folders[i] = Mockito.mock(ResultsFolders.class);
        Mockito.when(folders[i].getTraceTestSelectionFile()).thenReturn(new File("target/execute-" + i + ".json"));
    }
    ResultsFolders out = new ResultsFolders(new File("target"), "mytest");
    ExecutionData merged = PartialDependenciesMerger.mergeExecutions(out, folders);
    checkMergedResult(merged);
}
Also used : ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData) Test(org.junit.jupiter.api.Test)

Aggregations

ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)42 File (java.io.File)25 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)12 Test (org.junit.jupiter.api.Test)10 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)8 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)8 ResultsFolders (de.dagere.peass.folders.ResultsFolders)7 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)6 PeassFolders (de.dagere.peass.folders.PeassFolders)5 PrintStream (java.io.PrintStream)5 RepoFolders (de.dagere.peass.analysis.all.RepoFolders)4 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)4 PropertyReader (de.dagere.peass.analysis.properties.PropertyReader)4 KiekerConfig (de.dagere.peass.config.KiekerConfig)4 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)4 ChangeReader (de.dagere.peass.analysis.changes.ChangeReader)3 VersionKeeper (de.dagere.peass.dependency.reader.VersionKeeper)3 LinkedList (java.util.LinkedList)3 Change (de.dagere.peass.analysis.changes.Change)2 VersionChangeProperties (de.dagere.peass.analysis.properties.VersionChangeProperties)2