use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class PartialDependenciesMerger method mergeExecutions.
public static ExecutionData mergeExecutions(final ResultsFolders mergedOut, final ResultsFolders[] outFiles) throws JsonParseException, JsonMappingException, IOException {
List<File> executionOutFiles = new LinkedList<>();
List<File> coverageSelectionOutFiles = new LinkedList<>();
for (ResultsFolders resultFolder : outFiles) {
if (resultFolder != null) {
if (resultFolder.getTraceTestSelectionFile().exists()) {
executionOutFiles.add(resultFolder.getTraceTestSelectionFile());
}
if (resultFolder.getCoverageSelectionFile() != null && resultFolder.getCoverageSelectionFile().exists()) {
coverageSelectionOutFiles.add(resultFolder.getCoverageSelectionFile());
}
}
}
ExecutionData mergedExecutions = mergeExecutionFiles(executionOutFiles);
Constants.OBJECTMAPPER.writeValue(mergedOut.getTraceTestSelectionFile(), mergedExecutions);
if (coverageSelectionOutFiles.size() > 0) {
ExecutionData mergedCoverage = mergeExecutionFiles(coverageSelectionOutFiles);
Constants.OBJECTMAPPER.writeValue(mergedOut.getCoverageSelectionFile(), mergedCoverage);
}
return mergedExecutions;
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class TestContinuousDependencyReader method testNoChangeHappened.
@Test
public void testNoChangeHappened() throws JsonGenerationException, JsonMappingException, IOException {
ResultsFolders resultsFolders = new ResultsFolders(new File("target/current_results"), "current");
StaticTestSelection value = new StaticTestSelection();
value.setInitialversion(new InitialVersion());
value.getVersions().put("A", new VersionStaticSelection());
Constants.OBJECTMAPPER.writeValue(resultsFolders.getStaticTestSelectionFile(), value);
ContinuousDependencyReader reader = new ContinuousDependencyReader(new TestSelectionConfig(1, false), new ExecutionConfig(), new KiekerConfig(), new PeassFolders(new File("target/current")), resultsFolders, new EnvironmentVariables());
reader.getDependencies(null, "git:dummyUrl");
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class RegressionTestSelectionStarter method readExecutions.
public void readExecutions(final String project, final List<GitCommit> commits) throws InterruptedException, IOException, JsonGenerationException, JsonMappingException, JAXBException {
KiekerConfig kiekerConfig = kiekerConfigMixin.getKiekerConfig();
ExecutionConfig executionConfig = executionConfigMixin.getExecutionConfig();
final DependencyParallelReader reader = new DependencyParallelReader(config.getProjectFolder(), config.getResultBaseFolder(), project, commits, config.getDependencyConfig(), executionConfig, kiekerConfig, new EnvironmentVariables());
final ResultsFolders[] outFiles = reader.readDependencies();
LOG.debug("Files: {}", outFiles);
ResultsFolders mergedFolders = new ResultsFolders(config.getResultBaseFolder(), project);
final File out = mergedFolders.getStaticTestSelectionFile();
final StaticTestSelection all = PartialDependenciesMerger.mergeVersions(out, outFiles);
final PeassFolders folders = new PeassFolders(config.getProjectFolder());
final File dependencyTempFiles = new File(folders.getTempProjectFolder().getParentFile(), "dependencyTempFiles");
FileUtils.moveDirectory(folders.getTempProjectFolder(), dependencyTempFiles);
ExecutionData executionData = PartialDependenciesMerger.mergeExecutions(mergedFolders, outFiles);
mergeViews(outFiles, mergedFolders);
if (!config.isDoNotGenerateProperties()) {
ResultsFolders resultsFolders = new ResultsFolders(config.getResultBaseFolder(), project);
final PropertyReader propertyReader = new PropertyReader(resultsFolders, config.getProjectFolder(), executionData, executionConfig);
propertyReader.readAllTestsProperties();
}
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class JmhDependencyReaderMultiParamTest method testVersionReading.
@Test
public void testVersionReading() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
try (MockedStatic<GitUtils> gitUtilsMock = Mockito.mockStatic(GitUtils.class)) {
FakeGitUtil.prepareGitUtils(gitUtilsMock);
FakeFileIterator iterator = mockIterator();
ResultsFolders resultsFolders = new ResultsFolders(TraceGettingIT.VIEW_IT_PROJECTFOLDER, "test");
TestSelectionConfig dependencyConfig = new TestSelectionConfig(1, false, true, false);
ExecutionConfig jmhConfig = new ExecutionConfig();
jmhConfig.setTestTransformer("de.dagere.peass.dependency.jmh.JmhTestTransformer");
jmhConfig.setTestExecutor("de.dagere.peass.dependency.jmh.JmhTestExecutor");
DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, "", iterator, new VersionKeeper(new File("/dev/null")), jmhConfig, new KiekerConfig(true), new EnvironmentVariables());
reader.readInitialVersion();
checkInitialVersion(resultsFolders);
reader.readDependencies();
checkChangedVersion(resultsFolders);
}
}
use of de.dagere.peass.folders.ResultsFolders in project peass by DaGeRe.
the class JmhDependencyReaderTest method testVersionReading.
@ParameterizedTest
@ArgumentsSource(KiekerConfigurationProvider.class)
public void testVersionReading(final KiekerConfig kiekerConfig) throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
try (MockedStatic<GitUtils> gitUtilsMock = Mockito.mockStatic(GitUtils.class)) {
FakeGitUtil.prepareGitUtils(gitUtilsMock);
FakeFileIterator iterator = mockIterator();
ResultsFolders resultsFolders = new ResultsFolders(TraceGettingIT.VIEW_IT_PROJECTFOLDER, "test");
TestSelectionConfig dependencyConfig = new TestSelectionConfig(1, false, true, false);
ExecutionConfig jmhConfig = new ExecutionConfig();
jmhConfig.setTestTransformer("de.dagere.peass.dependency.jmh.JmhTestTransformer");
jmhConfig.setTestExecutor("de.dagere.peass.dependency.jmh.JmhTestExecutor");
DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, "", iterator, new VersionKeeper(new File("/dev/null")), jmhConfig, kiekerConfig, new EnvironmentVariables());
reader.readInitialVersion();
checkInitialVersion(resultsFolders);
reader.readDependencies();
checkChangedVersion(resultsFolders);
}
}
Aggregations