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