Search in sources :

Example 51 with ExecutionConfig

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

the class TestBenchmarkDetection method testMultimoduleBenchmarkDetection.

@Test
public void testMultimoduleBenchmarkDetection() throws FileNotFoundException, IOException, XmlPullParserException {
    JmhTestTransformer jmhTransformer = new JmhTestTransformer(JmhTestConstants.MULTIMODULE_VERSION, JMH_CONFIG);
    ProjectModules modules = new ProjectModules(Arrays.asList(new File[] { new File(JmhTestConstants.MULTIMODULE_VERSION, "base-module"), new File(JmhTestConstants.MULTIMODULE_VERSION, "using-module") }));
    ModuleClassMapping mapping = new ModuleClassMapping(JmhTestConstants.MULTIMODULE_VERSION, modules, new ExecutionConfig());
    TestSet tests = jmhTransformer.findModuleTests(mapping, null, modules);
    Iterator<TestCase> iterator = tests.getTests().iterator();
    TestCase test = iterator.next();
    Assert.assertEquals("de.dagere.peass.ExampleBenchmarkBasic#testMethod", test.getExecutable());
    TestCase testUsing = iterator.next();
    Assert.assertEquals("de.dagere.peass.ExampleBenchmarkUsing#testMethod", testUsing.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) File(java.io.File) TestSet(de.dagere.peass.dependency.analysis.data.TestSet) Test(org.junit.jupiter.api.Test)

Example 52 with ExecutionConfig

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

the class TestTreeFilter method getTree.

public CallTreeNode getTree() throws IOException, XmlPullParserException, InterruptedException, FileNotFoundException, ViewNotFoundException, AnalysisConfigurationException {
    final MeasurementConfig config = new MeasurementConfig(1, new ExecutionConfig(15), new KiekerConfig(true));
    config.getStatisticsConfig().setOutlierFactor(18);
    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 53 with ExecutionConfig

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

the class TraceViewGenerator method generateViews.

public boolean generateViews(final ResultsFolders resultsFolders, final TestSet examinedTests) throws IOException, XmlPullParserException, ParseException, ViewNotFoundException, InterruptedException {
    LOG.debug("Generating views for {}", version);
    boolean allWorked = true;
    GitUtils.reset(folders.getProjectFolder());
    ProjectModules modules = dependencyManager.getExecutor().getModules();
    ExecutionConfig executionConfig = dependencyManager.getTestTransformer().getConfig().getExecutionConfig();
    ModuleClassMapping mapping = new ModuleClassMapping(folders.getProjectFolder(), modules, executionConfig);
    List<File> classpathFolders = getClasspathFolders(modules);
    for (TestCase testcase : examinedTests.getTests()) {
        final OneTraceGenerator oneViewGenerator = new OneTraceGenerator(resultsFolders, folders, testcase, traceFileMapping, version, classpathFolders, mapping, kiekerConfig);
        final boolean workedLocal = oneViewGenerator.generateTrace(version);
        allWorked &= workedLocal;
    }
    return allWorked;
}
Also used : 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) OneTraceGenerator(de.dagere.peass.dependency.traces.OneTraceGenerator) File(java.io.File)

Example 54 with ExecutionConfig

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

the class TraceViewGenerator method getClasspathFolders.

private List<File> getClasspathFolders(final ProjectModules modules) {
    ExecutionConfig executionConfig = dependencyManager.getTestTransformer().getConfig().getExecutionConfig();
    final List<File> files = new LinkedList<>();
    for (int i = 0; i < modules.getModules().size(); i++) {
        final File module = modules.getModules().get(i);
        for (String clazzPath : executionConfig.getClazzFolders()) {
            files.add(new File(module, clazzPath));
        }
        for (String testClazzPath : executionConfig.getTestClazzFolders()) {
            files.add(new File(module, testClazzPath));
        }
    }
    return files;
}
Also used : ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) LinkedList(java.util.LinkedList)

Example 55 with ExecutionConfig

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

the class PropertyReadHelper method main.

/**
 * Just for local debugging purposes - no public use intended
 *
 * @param args
 * @throws IOException
 */
public static void main(final String[] args) throws IOException {
    final ChangedEntity ce = new ChangedEntity("org.apache.commons.fileupload.StreamingTest", "");
    final Change change = new Change();
    change.setChangePercent(-8.0);
    change.setMethod("testFILEUPLOAD135");
    final File projectFolder2 = new File("../../projekte/commons-fileupload");
    final File viewFolder2 = new File("/home/reichelt/daten3/diss/repos/preprocessing/4/commons-fileupload/views_commons-fileupload/");
    ExecutionConfig demoConfig = new ExecutionConfig();
    demoConfig.setVersion("96f8f56556a8592bfed25c82acedeffc4872ac1f");
    demoConfig.setVersionOld("09d16c");
    final PropertyReadHelper propertyReadHelper = new PropertyReadHelper(demoConfig, ce, change, projectFolder2, viewFolder2, new File("/tmp/"), null);
    propertyReadHelper.read();
}
Also used : ChangedEntity(de.dagere.peass.dependency.analysis.data.ChangedEntity) Change(de.dagere.peass.analysis.changes.Change) TraceChange(de.dagere.peass.analysis.properties.ChangeProperty.TraceChange) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File)

Aggregations

ExecutionConfig (de.dagere.peass.config.ExecutionConfig)74 Test (org.junit.jupiter.api.Test)49 File (java.io.File)40 PeassFolders (de.dagere.peass.folders.PeassFolders)29 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)23 KiekerConfig (de.dagere.peass.config.KiekerConfig)21 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)20 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)14 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)14 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)13 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)12 ProjectModules (de.dagere.peass.execution.utils.ProjectModules)12 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)11 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)11 GitUtils (de.dagere.peass.vcs.GitUtils)10 ResultsFolders (de.dagere.peass.folders.ResultsFolders)9 ModuleClassMapping (de.dagere.peass.dependency.analysis.ModuleClassMapping)7 VersionIterator (de.dagere.peass.vcs.VersionIterator)7 HashSet (java.util.HashSet)7 ChangeManager (de.dagere.peass.dependency.ChangeManager)6