Search in sources :

Example 1 with MeasurementConfig

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

the class ContinuousMeasurementExecutor method createCopiedConfiguration.

private MeasurementConfig createCopiedConfiguration() {
    MeasurementConfig copied = new MeasurementConfig(measurementConfig);
    copied.setUseKieker(false);
    return copied;
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig)

Example 2 with MeasurementConfig

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

the class TestParallelMeasurement method testFiles.

@Test
public void testFiles() throws Exception {
    try (MockedStatic<VersionControlSystem> mockedVCS = Mockito.mockStatic(VersionControlSystem.class);
        MockedStatic<ExecutorCreator> mockedExecutor = Mockito.mockStatic(ExecutorCreator.class);
        MockedStatic<GitUtils> gitUtils = Mockito.mockStatic(GitUtils.class)) {
        VCSTestUtils.mockGetVCS(mockedVCS);
        VCSTestUtils.mockGoToTagEmpty(gitUtils);
        final PeassFolders folders = new PeassFolders(folder.getRoot());
        final MeasurementConfig configuration = new MeasurementConfig(4, "2", "1");
        configuration.setMeasurementStrategy(MeasurementStrategy.PARALLEL);
        MavenTestExecutorMocker.mockExecutor(mockedExecutor, folders, configuration);
        DependencyTester spiedTester = createTesterNoThreads(folders, configuration);
        spiedTester.evaluate(TestDependencyTester.EXAMPLE_TESTCASE);
        TestDependencyTester.checkResult(folders);
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) TestDependencyTester(de.dagere.peass.measurement.analysis.TestDependencyTester) DependencyTester(de.dagere.peass.measurement.dependencyprocessors.DependencyTester) GitUtils(de.dagere.peass.vcs.GitUtils) ExecutorCreator(de.dagere.peass.dependency.ExecutorCreator) VersionControlSystem(de.dagere.peass.vcs.VersionControlSystem) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.Test)

Example 3 with MeasurementConfig

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

the class CauseTester method main.

public static void main(final String[] args) throws IOException, XmlPullParserException, InterruptedException, JAXBException, ClassNotFoundException {
    final File projectFolder = new File("../../projekte/commons-fileupload");
    final String version = "4ed6e923cb2033272fcb993978d69e325990a5aa";
    final TestCase test = new TestCase("org.apache.commons.fileupload.ServletFileUploadTest", "testFoldedHeaders");
    final MeasurementConfig config = new MeasurementConfig(15 * 1000 * 60, 15, true, version, version + "~1");
    config.setUseKieker(true);
    final CauseSearcherConfig causeConfig = new CauseSearcherConfig(test, false, 0.01, false, false, RCAStrategy.COMPLETE, 1);
    final CauseTester manager = new CauseTester(new CauseSearchFolders(projectFolder), config, causeConfig, new EnvironmentVariables());
    final CallTreeNode node = new CallTreeNode("FileUploadTestCase#parseUpload", "protected java.util.List org.apache.commons.fileupload.FileUploadTestCase.parseUpload(byte[],java.lang.String)", "protected java.util.List org.apache.commons.fileupload.FileUploadTestCase.parseUpload(byte[],java.lang.String)", config);
    node.setOtherVersionNode(node);
    final Set<CallTreeNode> nodes = new HashSet<>();
    nodes.add(node);
    manager.setIncludedMethods(nodes);
    manager.runOnce(test, version, 0, new File("log"));
// manager.evaluate(test);
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) File(java.io.File) HashSet(java.util.HashSet)

Example 4 with MeasurementConfig

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

the class LevelCauseSearchExperimentalStarter method main.

public static void main(final String[] args) throws IOException, XmlPullParserException, InterruptedException, IllegalStateException, AnalysisConfigurationException, ViewNotFoundException, JAXBException {
    final File projectFolder = new File("../../projekte/commons-fileupload");
    final String version = "4ed6e923cb2033272fcb993978d69e325990a5aa";
    final TestCase test = new TestCase("org.apache.commons.fileupload.ServletFileUploadTest", "testFoldedHeaders");
    final MeasurementConfig measurementConfiguration = new MeasurementConfig(15 * 1000 * 60, 5, true, version, version + "~1");
    measurementConfiguration.setUseKieker(true);
    final CauseSearcherConfig causeSearcherConfig = new CauseSearcherConfig(test, false, 0.1, false, false, RCAStrategy.COMPLETE, 1);
    final CauseSearchFolders folders2 = new CauseSearchFolders(projectFolder);
    final BothTreeReader reader = new BothTreeReader(causeSearcherConfig, measurementConfiguration, folders2, new EnvironmentVariables());
    final CauseTester measurer = new CauseTester(folders2, measurementConfiguration, causeSearcherConfig, new EnvironmentVariables());
    final LevelCauseSearcher searcher = new LevelCauseSearcher(reader, causeSearcherConfig, measurer, measurementConfiguration, folders2, new EnvironmentVariables());
    reader.readTrees();
    List<CallTreeNode> predecessor = Arrays.asList(new CallTreeNode[] { reader.getRootPredecessor() });
    List<CallTreeNode> current = Arrays.asList(new CallTreeNode[] { reader.getRootVersion() });
    int level = 0;
    boolean hasChilds = true;
    while (hasChilds) {
        level++;
        LOG.info("Level: " + level + " " + predecessor.get(0).getKiekerPattern());
        boolean foundNodeLevel = false;
        final List<CallTreeNode> predecessorNew = new LinkedList<>();
        final List<CallTreeNode> currentNew = new LinkedList<>();
        final Iterator<CallTreeNode> currentIterator = current.iterator();
        for (final Iterator<CallTreeNode> preIterator = predecessor.iterator(); preIterator.hasNext() && currentIterator.hasNext(); ) {
            final CallTreeNode predecessorChild = preIterator.next();
            final CallTreeNode currentChild = currentIterator.next();
            predecessorNew.addAll(predecessorChild.getChildren());
            currentNew.addAll(currentChild.getChildren());
            final String searchedCall = "public static long org.apache.commons.fileupload.util.Streams.copy(java.io.InputStream,java.io.OutputStream,boolean,byte[])";
            if (predecessorChild.getKiekerPattern().equals(searchedCall) && currentChild.getKiekerPattern().equals(searchedCall)) {
                foundNodeLevel = true;
            }
            if (predecessorChild.getKiekerPattern().equals(searchedCall) != currentChild.getKiekerPattern().equals(searchedCall)) {
                LOG.info(predecessorChild.getKiekerPattern());
                LOG.info(currentChild.getKiekerPattern());
                throw new RuntimeException("Tree structure differs above searched node!");
            }
        }
        if (foundNodeLevel) {
            LOG.info("Found!");
            searcher.isLevelDifferent(predecessorNew, currentNew);
        }
        predecessor = predecessorNew;
        current = currentNew;
        if (predecessor.isEmpty()) {
            hasChilds = false;
        }
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) CallTreeNode(de.dagere.peass.measurement.rca.data.CallTreeNode) BothTreeReader(de.dagere.peass.measurement.rca.kieker.BothTreeReader) LinkedList(java.util.LinkedList) CauseSearchFolders(de.dagere.peass.folders.CauseSearchFolders) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) LevelCauseSearcher(de.dagere.peass.measurement.rca.searcher.LevelCauseSearcher) File(java.io.File)

Example 5 with MeasurementConfig

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

the class CauseSearchData method buildCurrentMap.

private void buildCurrentMap(final MeasuredNode node, final CallTreeNode parentStructure) {
    final CallTreeNode nodeStructure = parentStructure != null ? parentStructure.appendChild(node.getCall(), node.getKiekerPattern(), node.getOtherKiekerPattern()) : new CallTreeNode(node.getCall(), node.getKiekerPattern(), node.getOtherKiekerPattern(), (MeasurementConfig) null);
    current.put(nodeStructure, node);
    for (final MeasuredNode child : node.getChilds()) {
        buildCurrentMap(child, nodeStructure);
    }
}
Also used : MeasurementConfig(de.dagere.peass.config.MeasurementConfig) MeasuredNode(de.dagere.peass.measurement.rca.serialization.MeasuredNode)

Aggregations

MeasurementConfig (de.dagere.peass.config.MeasurementConfig)98 Test (org.junit.jupiter.api.Test)43 File (java.io.File)37 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)23 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)22 PeassFolders (de.dagere.peass.folders.PeassFolders)19 Test (org.junit.Test)17 CallTreeNode (de.dagere.peass.measurement.rca.data.CallTreeNode)13 JUnitTestTransformer (de.dagere.peass.testtransformation.JUnitTestTransformer)13 CauseSearchFolders (de.dagere.peass.folders.CauseSearchFolders)10 ResultsFolders (de.dagere.peass.folders.ResultsFolders)8 List (java.util.List)8 VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)7 VersionControlSystem (de.dagere.peass.vcs.VersionControlSystem)6 BeforeEach (org.junit.jupiter.api.BeforeEach)6 CompilationUnit (com.github.javaparser.ast.CompilationUnit)5 MeasureVersionBuilder (de.dagere.peass.ci.MeasureVersionBuilder)5 TestSelectionConfig (de.dagere.peass.config.TestSelectionConfig)5 ExecutorCreator (de.dagere.peass.dependency.ExecutorCreator)5 TestExecutor (de.dagere.peass.execution.utils.TestExecutor)5