Search in sources :

Example 56 with StaticTestSelection

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

the class RTSInfos method readInfosFromFolders.

public static RTSInfos readInfosFromFolders(final ResultsFolders results, final PeassProcessConfiguration peassConfig) throws StreamReadException, DatabindException, IOException {
    File staticTestSelectionFile = results.getStaticTestSelectionFile();
    if (staticTestSelectionFile.exists()) {
        boolean staticChanges = false;
        StaticTestSelection staticTestSelection = Constants.OBJECTMAPPER.readValue(staticTestSelectionFile, StaticTestSelection.class);
        VersionStaticSelection version = staticTestSelection.getVersions().get(peassConfig.getMeasurementConfig().getExecutionConfig().getVersion());
        boolean hasStaticallySelectedTests = false;
        if (version != null) {
            if (!version.getChangedClazzes().isEmpty()) {
                staticChanges = true;
            }
            TestSet tests = version.getTests();
            hasStaticallySelectedTests = !tests.getTests().isEmpty();
        }
        return new RTSInfos(staticChanges, hasStaticallySelectedTests);
    } else {
        return new RTSInfos(false, false);
    }
}
Also used : VersionStaticSelection(de.dagere.peass.dependency.persistence.VersionStaticSelection) File(java.io.File) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Aggregations

StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)56 File (java.io.File)24 Test (org.junit.jupiter.api.Test)22 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)14 PeassFolders (de.dagere.peass.folders.PeassFolders)14 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)12 VersionStaticSelection (de.dagere.peass.dependency.persistence.VersionStaticSelection)12 LinkedList (java.util.LinkedList)9 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)8 KiekerConfig (de.dagere.peass.config.KiekerConfig)7 InitialVersion (de.dagere.peass.dependency.persistence.InitialVersion)7 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)7 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)7 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)6 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)6 GitCommit (de.dagere.peass.vcs.GitCommit)6 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)5 ResultsFolders (de.dagere.peass.folders.ResultsFolders)5 GitUtils (de.dagere.peass.vcs.GitUtils)5 ChangeManager (de.dagere.peass.dependency.ChangeManager)4