Search in sources :

Example 16 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig 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;
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) TreeReader(de.dagere.peass.measurement.rca.kieker.TreeReader) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Example 17 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class ContinuousDependencyReaderIT method testBasicVersionReading.

@Order(1)
@Test
public void testBasicVersionReading() throws Exception {
    builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/normal_change"), "test 1");
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    iterator.goToFirstCommit();
    iterator.goToNextCommit();
    ExecutionConfig executionConfig = new ExecutionConfig();
    executionConfig.setVersion(iterator.getTag());
    executionConfig.setVersionOld(iterator.getPrevious().getTag());
    ContinuousDependencyReader reader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_WITH_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, new EnvironmentVariables());
    StaticTestSelection dependencies = reader.getDependencies(iterator, "");
    final String lastTag = builder.getTags().get(builder.getTags().size() - 1);
    checkVersion(dependencies, lastTag, 1);
    ExecutionData executions = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
    Assert.assertEquals(2, executions.getVersions().size());
    System.out.println(executions.getVersions().keySet());
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData) Order(org.junit.jupiter.api.Order) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Test(org.junit.jupiter.api.Test)

Example 18 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class ContinuousDependencyReaderIT method testEmptyVersion.

@Order(3)
@Test
public void testEmptyVersion() throws Exception {
    final String prevTag = builder.getTags().get(builder.getTags().size() - 1);
    GitUtils.goToTag(prevTag, TestConstants.CURRENT_FOLDER);
    String newVersion = builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/only_comment_change"), "test 2");
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    ExecutionConfig executionConfig = new ExecutionConfig();
    executionConfig.setVersion(newVersion);
    executionConfig.setVersionOld(iterator.getPrevious().getTag());
    ContinuousDependencyReader reader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_WITH_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, new EnvironmentVariables());
    RTSResult result = reader.getTests(iterator, "", newVersion, new MeasurementConfig(1));
    Set<TestCase> tests = result.getTests();
    Assert.assertEquals(tests.size(), 0);
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) MeasurementConfig(de.dagere.peass.config.MeasurementConfig) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) Order(org.junit.jupiter.api.Order) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Test(org.junit.jupiter.api.Test)

Example 19 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class ContinuousDependencyReaderIT method testAnotherVersion.

@Order(2)
@Test
public void testAnotherVersion() throws Exception {
    final String prevTag = builder.getTags().get(builder.getTags().size() - 1);
    GitUtils.goToTag(prevTag, TestConstants.CURRENT_FOLDER);
    String newVersion = builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/basic_state"), "test 2");
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    ExecutionConfig executionConfig = new ExecutionConfig();
    executionConfig.setVersion(newVersion);
    executionConfig.setVersionOld(iterator.getPrevious().getTag());
    final ContinuousDependencyReader spiedReader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_WITH_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, new EnvironmentVariables());
    StaticTestSelection dependencies = spiedReader.getDependencies(iterator, "");
    final String lastTag = builder.getTags().get(builder.getTags().size() - 1);
    checkVersion(dependencies, lastTag, 2);
    ExecutionData executions = Constants.OBJECTMAPPER.readValue(resultsFolders.getTraceTestSelectionFile(), ExecutionData.class);
    Assert.assertEquals(3, executions.getVersions().size());
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData) Order(org.junit.jupiter.api.Order) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Test(org.junit.jupiter.api.Test)

Example 20 with KiekerConfig

use of de.dagere.peass.config.KiekerConfig in project peass by DaGeRe.

the class DependenciesOnlyStartversionIT method testBasicVersionReading.

@Order(1)
@Test
public void testBasicVersionReading() throws Exception {
    builder.addVersion(new File("../dependency/src/test/resources/dependencyIT/changed_class"), "test 1");
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    iterator.goToFirstCommit();
    iterator.goToNextCommit();
    ExecutionConfig executionConfig = new ExecutionConfig();
    executionConfig.setVersion(iterator.getTag());
    executionConfig.setVersionOld(iterator.getPrevious().getTag());
    ContinuousDependencyReader reader = new ContinuousDependencyReader(DependencyTestConstants.DEFAULT_CONFIG_NO_VIEWS, executionConfig, new KiekerConfig(true), new PeassFolders(TestConstants.CURRENT_FOLDER), ContinuousDependencyReaderIT.resultsFolders, new EnvironmentVariables());
    dependencies = reader.getDependencies(iterator, "");
    final String lastTag = builder.getTags().get(builder.getTags().size() - 1);
    checkVersion(dependencies, lastTag, 1);
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) TestMethodOrder(org.junit.jupiter.api.TestMethodOrder) Order(org.junit.jupiter.api.Order) Test(org.junit.jupiter.api.Test)

Aggregations

KiekerConfig (de.dagere.peass.config.KiekerConfig)34 PeassFolders (de.dagere.peass.folders.PeassFolders)22 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)21 File (java.io.File)21 Test (org.junit.jupiter.api.Test)18 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)9 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)7 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)5 CalledMethodLoader (de.dagere.peass.dependency.analysis.CalledMethodLoader)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)5 TraceElement (de.dagere.peass.dependency.analysis.data.TraceElement)5 ResultsFolders (de.dagere.peass.folders.ResultsFolders)5 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)5 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)4 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)4 ClazzChangeData (de.dagere.peass.dependency.changesreading.ClazzChangeData)4 ExecutionData (de.dagere.peass.dependency.persistence.ExecutionData)4 VersionIterator (de.dagere.peass.vcs.VersionIterator)4