Search in sources :

Example 41 with ExecutionData

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

the class VersionSorter method getSelectedTests.

public static SelectedTests getSelectedTests(final File dependencyFile, final File executionFile, final File... additionalDependencyFiles) throws IOException, JsonParseException, JsonMappingException {
    StaticTestSelection dependencies = null;
    ExecutionData executionData = null;
    if (dependencyFile != null) {
        dependencies = Constants.OBJECTMAPPER.readValue(dependencyFile, StaticTestSelection.class);
        return dependencies;
    }
    if (executionFile != null) {
        executionData = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
        return executionData;
    }
    if (dependencies == null) {
        for (final File dependencytest : additionalDependencyFiles) {
            dependencies = Constants.OBJECTMAPPER.readValue(dependencytest, StaticTestSelection.class);
            return dependencies;
        }
    }
    throw new RuntimeException("No dependencyfile provided");
}
Also used : File(java.io.File) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 42 with ExecutionData

use of de.dagere.peass.dependency.persistence.ExecutionData in project peass-ci-plugin by jenkinsci.

the class RTSVisualizationCreator method readTraceBasedSelection.

private List<String> readTraceBasedSelection(final Run<?, ?> run) throws IOException, JsonParseException, JsonMappingException {
    List<String> selectedTests = new LinkedList<>();
    File traceTestSelectionFile = localWorkspace.getTraceTestSelectionFile();
    if (traceTestSelectionFile.exists()) {
        ExecutionData traceSelections = Constants.OBJECTMAPPER.readValue(traceTestSelectionFile, ExecutionData.class);
        TestSet tests = traceSelections.getVersions().get(peassConfig.getMeasurementConfig().getExecutionConfig().getVersion());
        if (tests != null) {
            for (TestCase test : tests.getTests()) {
                selectedTests.add(test.toString());
            }
        }
    } else {
        LOG.info("File {} was not found, RTS execution info might be incomplete", traceTestSelectionFile.getAbsoluteFile());
    }
    return selectedTests;
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) File(java.io.File) LinkedList(java.util.LinkedList) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

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