use of de.dagere.peass.dependency.persistence.VersionStaticSelection in project peass by DaGeRe.
the class ContinuousDependencyReader method getTests.
public RTSResult getTests(final VersionIterator iterator, final String url, final String version, final MeasurementConfig measurementConfig) {
final StaticTestSelection dependencies = getDependencies(iterator, url);
RTSResult result;
final Set<TestCase> tests;
if (dependencies.getVersions().size() > 0) {
VersionStaticSelection versionInfo = dependencies.getVersions().get(version);
LOG.debug("Versioninfo for version {}, running was: {}", version, versionInfo != null ? versionInfo.isRunning() : "null");
if (dependencyConfig.isGenerateTraces()) {
tests = selectResults(version);
result = new RTSResult(tests, versionInfo.isRunning());
} else {
tests = versionInfo.getTests().getTests();
result = new RTSResult(tests, versionInfo.isRunning());
}
// final Set<TestCase> tests = selectIncludedTests(dependencies);
NonIncludedTestRemover.removeNotIncluded(tests, measurementConfig.getExecutionConfig());
} else {
tests = new HashSet<>();
result = new RTSResult(tests, true);
LOG.info("No test executed - version did not contain changed tests.");
}
return result;
}
use of de.dagere.peass.dependency.persistence.VersionStaticSelection in project peass by DaGeRe.
the class RootCauseAnalysis method call.
@Override
public Void call() throws Exception {
if (testName == null) {
throw new RuntimeException("Test needs to be defined!");
}
initVersionProcessor();
if (version == null) {
version = executionData.getVersions().keySet().iterator().next();
LOG.info("Version was not defined, using " + version);
}
final TestCase test = new TestCase(testName);
final VersionStaticSelection versionInfo = staticTestSelection.getVersions().get(version);
boolean found = versionInfo.getTests().getTests().contains(test);
if (!found) {
LOG.error("Test " + test + " is not contained in regression test selection result, therefore it is unlikely to have a performance change!");
}
final String predecessor = versionInfo.getPredecessor();
LOG.debug("Timeout in minutes: {}", executionMixin.getTimeout());
final MeasurementConfig measurementConfiguration = getConfiguration(predecessor);
final CauseSearcherConfig causeSearcherConfig = new CauseSearcherConfig(test, causeSearchConfigMixin);
if (kiekerConfigMixin.isUseAggregation() && measurementConfiguration.getKiekerConfig().getRecord() == AllowedKiekerRecord.OPERATIONEXECUTION) {
throw new RuntimeException("Aggregation and OperationExecutionRecord can not be combined!");
}
final CauseSearchFolders alternateFolders = new CauseSearchFolders(folders.getProjectFolder());
final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, alternateFolders, new EnvironmentVariables());
final CauseSearcher tester = getCauseSeacher(measurementConfiguration, causeSearcherConfig, alternateFolders, reader);
tester.search();
return null;
}
use of de.dagere.peass.dependency.persistence.VersionStaticSelection in project peass by DaGeRe.
the class DependencyDetectorParameterizedIT method testNormalChange.
@Test
public void testNormalChange() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException {
final ChangeManager changeManager = changeManagerWithParameter();
final VersionIterator fakeIterator = new FakeFileIterator(DependencyTestConstants.CURRENT, Arrays.asList(NORMAL_CHANGE));
final DependencyReader reader = DependencyDetectorTestUtil.readTwoVersions(changeManager, fakeIterator);
System.out.println(reader.getDependencies().getInitialversion().getInitialDependencies());
VersionStaticSelection firstVersion = reader.getDependencies().getVersions().get(DependencyTestConstants.VERSION_1);
System.out.println(firstVersion.getChangedClazzes());
Assert.assertEquals(3, reader.getDependencies().getInitialversion().getInitialDependencies().size());
TestSet selectedTest = firstVersion.getChangedClazzes().get(new ChangedEntity("defaultpackage.NormalDependency#onlyCalledWithOne"));
Assert.assertEquals(new TestCase("TestMe#testMe(JUNIT_PARAMETERIZED-2)"), selectedTest.getTests().iterator().next());
}
use of de.dagere.peass.dependency.persistence.VersionStaticSelection in project peass by DaGeRe.
the class TestDependencies method testRunningersions.
@Test
public void testRunningersions() {
StaticTestSelection dependencies = new StaticTestSelection();
dependencies.setInitialversion(new InitialVersion());
dependencies.getInitialversion().setVersion("0");
VersionStaticSelection running1 = new VersionStaticSelection();
running1.setRunning(true);
dependencies.getVersions().put("1", running1);
VersionStaticSelection nonRunning2 = new VersionStaticSelection();
nonRunning2.setRunning(false);
dependencies.getVersions().put("2", nonRunning2);
VersionStaticSelection running3 = new VersionStaticSelection();
running3.setRunning(true);
dependencies.getVersions().put("3", running3);
String[] versionNames = dependencies.getRunningVersionNames();
Assert.assertEquals("0", versionNames[0]);
Assert.assertEquals("1", versionNames[1]);
Assert.assertEquals("3", versionNames[2]);
Assert.assertEquals("3", dependencies.getNewestVersion());
}
use of de.dagere.peass.dependency.persistence.VersionStaticSelection in project peass by DaGeRe.
the class DependencyReader method documentFailure.
public void documentFailure(final String version) {
if (dependencyManager.getExecutor().isAndroid()) {
dependencyResult.setAndroid(true);
executionResult.setAndroid(true);
coverageBasedSelection.setAndroid(true);
}
LOG.error("Version not running");
final VersionStaticSelection newVersionInfo = new VersionStaticSelection();
newVersionInfo.setRunning(false);
dependencyResult.getVersions().put(version, newVersionInfo);
}
Aggregations