use of de.dagere.peass.dependency.persistence.StaticTestSelection in project peass by DaGeRe.
the class TestCreateMeasurementExecutionScript method buildExecutionDataWithTests.
private ExecutionData buildExecutionDataWithTests() {
StaticTestSelection dependencies = TestExecutionData.buildExampleDependencies();
VersionStaticSelection version2 = dependencies.getVersions().get("000002");
version2.getChangedClazzes().put(new ChangedEntity("Test1#testMe"), new TestSet(new TestCase("Test1#testMe")));
VersionStaticSelection version5 = dependencies.getVersions().get("000005");
version5.getChangedClazzes().put(new ChangedEntity("Test5#testMe"), new TestSet(new TestCase("Test5#testMe")));
ExecutionData executiondata = new ExecutionData(dependencies);
return executiondata;
}
use of de.dagere.peass.dependency.persistence.StaticTestSelection in project peass-ci-plugin by jenkinsci.
the class RTSLogFileReader method isVersionRunSuccess.
private boolean isVersionRunSuccess(final VisualizationFolderManager visualizationFolders, final MeasurementConfig measurementConfig) {
boolean success = false;
File dependencyFile = visualizationFolders.getResultsFolders().getStaticTestSelectionFile();
if (dependencyFile.exists()) {
try {
StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(dependencyFile, StaticTestSelection.class);
VersionStaticSelection version = dependencies.getVersions().get(measurementConfig.getExecutionConfig().getVersion());
if (version != null) {
LOG.debug("Version run success: {}", version.isRunning());
success = version.isRunning();
}
} catch (IOException e) {
e.printStackTrace();
}
} else {
LOG.debug("Dependencyfile {} not found, so run was n o success", dependencyFile);
}
return success;
}
use of de.dagere.peass.dependency.persistence.StaticTestSelection in project peass-ci-plugin by jenkinsci.
the class TestRTSVisualizationCreator method writeEmptyDependencies.
private void writeEmptyDependencies(final ResultsFolders localWorkspace) throws IOException, JsonGenerationException, JsonMappingException {
StaticTestSelection emptyDependencies = new StaticTestSelection();
emptyDependencies.getInitialversion().addDependency(new TestCase("Test#test"), new ChangedEntity("SomeCallee#method"));
Constants.OBJECTMAPPER.writeValue(localWorkspace.getStaticTestSelectionFile(), emptyDependencies);
}
use of de.dagere.peass.dependency.persistence.StaticTestSelection in project peass by DaGeRe.
the class GetChanges method call.
@Override
public Void call() throws Exception {
SelectedTests selectedTests = VersionSorter.getSelectedTests(staticSelectionFile, executionFile);
if (!out.exists()) {
out.mkdirs();
}
LOG.info("Errors: 1: {} 2: {}", statisticConfigMixin.getType1error(), statisticConfigMixin.getType2error());
ResultsFolders folders = new ResultsFolders(out, "out");
final ChangeReader reader = createReader(folders, selectedTests);
if (staticSelectionFile != null) {
StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(staticSelectionFile, StaticTestSelection.class);
reader.setTests(dependencies.toExecutionData().getVersions());
}
if (executionFile != null) {
ExecutionData executions = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
reader.setTests(executions.getVersions());
}
for (final File dataFile : data) {
reader.readFile(dataFile);
}
return null;
}
use of de.dagere.peass.dependency.persistence.StaticTestSelection in project peass by DaGeRe.
the class ContinuousDependencyReader method getDependencies.
StaticTestSelection getDependencies(final VersionIterator iterator, final String url) {
try {
StaticTestSelection dependencies;
final VersionKeeper noChanges = new VersionKeeper(new File(resultsFolders.getStaticTestSelectionFile().getParentFile(), "nonChanges_" + folders.getProjectName() + ".json"));
if (!resultsFolders.getStaticTestSelectionFile().exists()) {
LOG.debug("Fully loading dependencies");
dependencies = fullyLoadDependencies(url, iterator, noChanges);
} else {
LOG.debug("Partially loading dependencies");
dependencies = Constants.OBJECTMAPPER.readValue(resultsFolders.getStaticTestSelectionFile(), StaticTestSelection.class);
VersionComparator.setDependencies(dependencies);
if (iterator != null) {
executePartialRTS(dependencies, iterator);
}
}
VersionComparator.setDependencies(dependencies);
return dependencies;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations