use of de.dagere.peass.dependency.analysis.data.TestSet in project peass-ci-plugin by jenkinsci.
the class RTSVisualizationCreator method addVersionDataToChangeliste.
private void addVersionDataToChangeliste(final Map<String, List<String>> changesList, final VersionStaticSelection version) {
for (Map.Entry<ChangedEntity, TestSet> entry : version.getChangedClazzes().entrySet()) {
List<String> tests = new LinkedList<>();
for (TestCase test : entry.getValue().getTests()) {
tests.add(test.toString());
}
ChangedEntity changedClazz = entry.getKey();
changesList.put(changedClazz.toString(), tests);
}
}
use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.
the class ContinuousDependencyReader method fetchTestset.
/**
* Fetches the test set from the current version; it is required to allow null, in case a compile error occured
* @param version
* @param executionData
* @return
*/
private Set<TestCase> fetchTestset(final String version, final ExecutionData executionData) {
final Set<TestCase> tests;
TestSet versionTestSet = executionData.getVersions().get(version);
tests = versionTestSet != null ? versionTestSet.getTests() : new HashSet<TestCase>();
return tests;
}
use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.
the class GetProjectSizes method main.
public static void main(final String[] args) throws JsonParseException, JsonMappingException, IOException {
File dependencyFolder;
if (System.getenv(Constants.PEASS_REPOS) != null) {
final String repofolder = System.getenv(Constants.PEASS_REPOS);
final File folder = new File(repofolder);
dependencyFolder = new File(folder, "dependencies-final");
} else {
throw new RuntimeException("Please define environment variable " + Constants.PEASS_REPOS);
}
System.out.println("Projekt & Versionen & Analysierbar & GeƤndert & Selektiert & Tests\\\\ \\hline");
for (final String project : allProjects) {
final File projectFolder = new File("../../projekte/" + project);
final int commits = GitUtils.getCommits(projectFolder, true).size();
final File executionFile = new File(dependencyFolder, ResultsFolders.TRACE_SELECTION_PREFIX + project + ".json");
int analyzable = 0;
int tests = 0;
int executionTests = 0;
if (executionFile.exists()) {
final ExecutionData executionData = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
executionTests = executionData.getVersions().size();
for (final TestSet test : executionData.getVersions().values()) {
tests += test.getTests().size();
}
}
final File nonRunning = new File(dependencyFolder, "nonRunning_" + project + ".json");
final File nonChanges = new File(dependencyFolder, "nonChanges_" + project + ".json");
int changes = 0;
if (nonRunning.exists()) {
final VersionKeeper vk = Constants.OBJECTMAPPER.readValue(nonRunning, VersionKeeper.class);
analyzable = commits - vk.getNonRunableReasons().size();
if (nonChanges.exists()) {
final VersionKeeper vk2 = Constants.OBJECTMAPPER.readValue(nonChanges, VersionKeeper.class);
changes = analyzable - vk2.getNonRunableReasons().size();
}
}
System.out.println(project + " & " + commits + " & " + analyzable + " & " + changes + " & " + executionTests + " & " + tests + "\\\\");
}
}
use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.
the class MissingExecutionFinder method removeSlurmExecutions.
private void removeSlurmExecutions(final File folder) throws JAXBException {
ChangeReader reader = new ChangeReader(folder.getName(), tests);
reader.readFile(folder);
for (Entry<String, TestcaseData> entry : reader.getAllData().getData().entrySet()) {
String version = entry.getKey();
TestSet versionsTests = tests.getVersions().get(version);
LOG.debug("Removing from: {}", version);
for (TestCase test : entry.getValue().getTestcaseData().keySet()) {
removeTestFromTestSet(test.getClazz(), test.getMethod(), versionsTests);
}
}
}
use of de.dagere.peass.dependency.analysis.data.TestSet in project peass by DaGeRe.
the class DependencyManager method initialyGetTraces.
public boolean initialyGetTraces(final String version) throws IOException, InterruptedException, XmlPullParserException {
if (folders.getTempMeasurementFolder().exists()) {
FileUtils.deleteDirectory(folders.getTempMeasurementFolder());
}
final ModuleClassMapping mapping = new ModuleClassMapping(executor);
executor.loadClasses();
TestSet tests = findIncludedTests(mapping);
runTraceTests(tests, version);
if (folders.getTempMeasurementFolder().exists()) {
return readInitialResultFiles(mapping);
} else {
return printErrors();
}
}
Aggregations