use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class JmhDependencyReaderTest method mockIterator.
private FakeFileIterator mockIterator() {
List<File> versionList = Arrays.asList(JmhTestConstants.BASIC_VERSION, JmhTestConstants.SLOWER_VERSION);
FakeFileIterator fakeIterator = new FakeFileIterator(TestConstants.CURRENT_FOLDER, versionList);
fakeIterator.goToFirstCommit();
FakeFileIterator iteratorspied = Mockito.spy(fakeIterator);
VersionDiff fakedDiff = new VersionDiff(Arrays.asList(TestConstants.CURRENT_FOLDER), TestConstants.CURRENT_FOLDER);
ExecutionConfig defaultConfig = new ExecutionConfig();
fakedDiff.addChange("src/test/java/de/dagere/peass/ExampleBenchmark.java", defaultConfig);
Mockito.doReturn(fakedDiff).when(iteratorspied).getChangedClasses(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any());
return iteratorspied;
}
use of de.dagere.peass.config.ExecutionConfig 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);
}
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestBenchmarkDetection method testBenchmarkDetectionInnerClass.
@Test
public void testBenchmarkDetectionInnerClass() throws FileNotFoundException, IOException, XmlPullParserException {
JmhTestTransformer jmhTransformer = new JmhTestTransformer(JmhTestConstants.INNER_CLASS_VERSION, JMH_CONFIG);
ProjectModules modules = new ProjectModules(JmhTestConstants.INNER_CLASS_VERSION);
TestSet tests = jmhTransformer.findModuleTests(new ModuleClassMapping(JmhTestConstants.INNER_CLASS_VERSION, modules, new ExecutionConfig()), null, modules);
Assert.assertEquals(tests.getTests().size(), 1);
TestCase test = tests.getTests().iterator().next();
Assert.assertEquals("de.dagere.peass.ExampleBenchmark#testMethod", test.getExecutable());
}
use of de.dagere.peass.config.ExecutionConfig in project peass by DaGeRe.
the class TestTreeReaderWrongConfig method getTree.
public CallTreeNode getTree() throws IOException, XmlPullParserException, InterruptedException, FileNotFoundException, ViewNotFoundException, AnalysisConfigurationException {
KiekerConfig wrongKiekerConfig = new KiekerConfig(true);
wrongKiekerConfig.setUseAggregation(true);
wrongKiekerConfig.setRecord(AllowedKiekerRecord.DURATION);
final MeasurementConfig config = new MeasurementConfig(1, new ExecutionConfig(15), wrongKiekerConfig);
TreeReader executor = TreeReaderFactory.createTestTreeReader(projectFolder, config, new EnvironmentVariables());
TestCase test = new TestCase("defaultpackage.TestMe", "testMe");
// executor.executeKoPeMeKiekerRun(new TestSet(test), "1");
CallTreeNode node = executor.getTree(test, "1");
return node;
}
use of de.dagere.peass.config.ExecutionConfig in project peass-ci-plugin by jenkinsci.
the class MeasurementActionCreator method createMeasurementActions.
public void createMeasurementActions(final Set<TestCase> tests) throws IOException {
createOverallLogAction();
Map<TestCase, List<LogFiles>> logFiles = reader.readAllTestcases(tests);
createLogActions(run, logFiles);
ExecutionConfig executionConfig = measurementConfig.getExecutionConfig();
String shortVersion = executionConfig.getVersion().substring(0, 6);
String shortVersionOld = executionConfig.getVersionOld().substring(0, 6);
LogOverviewAction logOverviewAction = new LogOverviewAction(logFiles, shortVersion, shortVersionOld, measurementConfig.getVms(), executionConfig.isRedirectSubprocessOutputToFile());
run.addAction(logOverviewAction);
}
Aggregations