Search in sources :

Example 1 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class ContinuousExecutor method analyzeMeasurements.

private void analyzeMeasurements(final File measurementFolder) throws InterruptedException, IOException, JsonGenerationException, JsonMappingException, XmlPullParserException {
    final ProjectStatistics statistics = new ProjectStatistics();
    TestTransformer testTransformer = ExecutorCreator.createTestTransformer(folders, measurementConfig.getExecutionConfig(), measurementConfig);
    TestExecutor executor = ExecutorCreator.createExecutor(folders, testTransformer, env);
    ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), executor.getModules(), measurementConfig.getExecutionConfig());
    final AnalyseFullData afd = new AnalyseFullData(resultsFolders.getChangeFile(), statistics, mapping, measurementConfig.getStatisticsConfig());
    afd.analyseFolder(measurementFolder);
    Constants.OBJECTMAPPER.writeValue(resultsFolders.getStatisticsFile(), statistics);
}
Also used : TestExecutor(de.dagere.peass.execution.utils.TestExecutor) TestTransformer(de.dagere.peass.testtransformation.TestTransformer) AnalyseFullData(de.dagere.peass.analysis.measurement.AnalyseFullData) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) ProjectStatistics(de.dagere.peass.analysis.measurement.ProjectStatistics)

Example 2 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class TreeReader method readTree.

private CallTreeNode readTree(final TestCase testcase, final File kiekerTraceFolder) throws AnalysisConfigurationException, IOException, XmlPullParserException {
    final ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), executor.getModules(), realConfig.getExecutionConfig());
    TreeStage stage = KiekerDurationReader.executeTreeStage(kiekerTraceFolder, testcase, ignoreEOIs, realConfig, mapping);
    CallTreeNode root = stage.getRoot();
    if (root == null) {
        throw new RuntimeException("An error occured - root node of " + testcase + " could not be identified!");
    }
    return root;
}
Also used : ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode)

Example 3 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class TestPeassFilter method testExecution.

@Test
public void testExecution() throws ViewNotFoundException, IOException, XmlPullParserException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    Assume.assumeFalse(EnvironmentVariables.isWindows());
    PeassFolders folders = new PeassFolders(CURRENT);
    final KiekerResultManager manager = new KiekerResultManager(folders, new ExecutionConfig(5), new KiekerConfig(true), new EnvironmentVariables());
    final TestSet testset = new TestSet();
    final TestCase testcase = new TestCase("defaultpackage.TestMe", "testMe", "");
    testset.addTest(testcase);
    final ModuleClassMapping mapping = new ModuleClassMapping(manager.getExecutor());
    final List<TraceElement> referenceTrace = regenerateTrace(manager, testset, testcase, mapping, 0);
    for (int i = 1; i <= 3; i++) {
        final List<TraceElement> compareTrace = regenerateTrace(manager, testset, testcase, mapping, i);
        checkRegeneratedTrace(referenceTrace, compareTrace);
    }
}
Also used : EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) TraceElement(de.dagere.peass.dependency.analysis.data.TraceElement) KiekerResultManager(de.dagere.peass.dependency.KiekerResultManager) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Example 4 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping in project peass by DaGeRe.

the class TraceChangeHandler method analyzeTests.

private void analyzeTests(final VersionStaticSelection newVersionInfo, final TestSet testsToRun) throws IOException, XmlPullParserException, InterruptedException, JsonGenerationException, JsonMappingException {
    final ModuleClassMapping mapping = new ModuleClassMapping(dependencyManager.getExecutor());
    dependencyManager.runTraceTests(testsToRun, version);
    handleDependencyChanges(newVersionInfo, testsToRun, mapping);
}
Also used : ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping)

Example 5 with ModuleClassMapping

use of de.dagere.peass.dependency.analysis.ModuleClassMapping 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());
}
Also used : JmhTestTransformer(de.dagere.peass.dependency.jmh.JmhTestTransformer) ProjectModules(de.dagere.peass.execution.utils.ProjectModules) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) ModuleClassMapping(de.dagere.peass.dependency.analysis.ModuleClassMapping) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Aggregations

ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)12 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)7 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)6 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)6 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)5 File (java.io.File)4 Test (org.junit.jupiter.api.Test)4 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)3 ProjectChanges (de.dagere.peass.analysis.changes.ProjectChanges)2 StatisticsConfig (de.dagere.peass.config.StatisticsConfig)2 KiekerResultManager (de.dagere.peass.dependency.KiekerResultManager)2 PeassFolders (de.dagere.peass.folders.PeassFolders)2 GitCommit (de.dagere.peass.vcs.GitCommit)2 LinkedList (java.util.LinkedList)2 Test (org.junit.Test)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Change (de.dagere.peass.analysis.changes.Change)1 AnalyseFullData (de.dagere.peass.analysis.measurement.AnalyseFullData)1 ProjectStatistics (de.dagere.peass.analysis.measurement.ProjectStatistics)1 KiekerConfig (de.dagere.peass.config.KiekerConfig)1