Search in sources :

Example 11 with KiekerConfig

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

the class DependenciesOnlyStartversionIT method cleanDependencies.

@BeforeEach
public void cleanDependencies() throws Exception {
    FileUtils.deleteDirectory(ContinuousDependencyReaderIT.resultsFolders.getStaticTestSelectionFile().getParentFile());
    Assert.assertFalse(ContinuousDependencyReaderIT.resultsFolders.getStaticTestSelectionFile().exists());
    FileUtils.deleteDirectory(TestConstants.CURRENT_FOLDER);
    builder = new GitProjectBuilder(TestConstants.CURRENT_FOLDER, new File("../dependency/src/test/resources/dependencyIT/basic_state"));
    VersionIteratorGit iterator = new VersionIteratorGit(TestConstants.CURRENT_FOLDER);
    iterator.goToFirstCommit();
    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, "");
    Assert.assertEquals(0, dependencies.getVersions().size());
}
Also used : VersionIteratorGit(de.dagere.peass.vcs.VersionIteratorGit) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) GitProjectBuilder(de.dagere.peass.ci.helper.GitProjectBuilder) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 12 with KiekerConfig

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

the class KiekerConfigMixin method getKiekerConfig.

public KiekerConfig getKiekerConfig() {
    KiekerConfig kiekerConfig = new KiekerConfig(true);
    kiekerConfig.setUseCircularQueue(useCircularQueue);
    kiekerConfig.setUseSelectiveInstrumentation(!notUseSelectiveInstrumentation);
    kiekerConfig.setUseAggregation(useAggregation);
    kiekerConfig.setExtractMethod(useExtraction);
    kiekerConfig.setAdaptiveInstrumentation(enableAdaptiveInstrumentation);
    kiekerConfig.setUseSourceInstrumentation(!notUseSourceInstrumentation);
    kiekerConfig.setKiekerQueueSize(kiekerQueueSize);
    kiekerConfig.setTraceSizeInMb(traceSizeInMb);
    kiekerConfig.setOnlyOneCallRecording(onlyOneCallRecording);
    if (excludeForTracing != null) {
        LinkedHashSet<String> excludedForTracing = new LinkedHashSet<>();
        for (String exclude : excludeForTracing) {
            excludedForTracing.add(exclude);
        }
        kiekerConfig.setExcludeForTracing(excludedForTracing);
    }
    kiekerConfig.check();
    return kiekerConfig;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) KiekerConfig(de.dagere.peass.config.KiekerConfig)

Example 13 with KiekerConfig

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

the class TestContinuousDependencyReader method testNoChangeHappened.

@Test
public void testNoChangeHappened() throws JsonGenerationException, JsonMappingException, IOException {
    ResultsFolders resultsFolders = new ResultsFolders(new File("target/current_results"), "current");
    StaticTestSelection value = new StaticTestSelection();
    value.setInitialversion(new InitialVersion());
    value.getVersions().put("A", new VersionStaticSelection());
    Constants.OBJECTMAPPER.writeValue(resultsFolders.getStaticTestSelectionFile(), value);
    ContinuousDependencyReader reader = new ContinuousDependencyReader(new TestSelectionConfig(1, false), new ExecutionConfig(), new KiekerConfig(), new PeassFolders(new File("target/current")), resultsFolders, new EnvironmentVariables());
    reader.getDependencies(null, "git:dummyUrl");
}
Also used : TestSelectionConfig(de.dagere.peass.config.TestSelectionConfig) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) InitialVersion(de.dagere.peass.dependency.persistence.InitialVersion) VersionStaticSelection(de.dagere.peass.dependency.persistence.VersionStaticSelection) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 14 with KiekerConfig

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

the class RegressionTestSelectionStarter method readExecutions.

public void readExecutions(final String project, final List<GitCommit> commits) throws InterruptedException, IOException, JsonGenerationException, JsonMappingException, JAXBException {
    KiekerConfig kiekerConfig = kiekerConfigMixin.getKiekerConfig();
    ExecutionConfig executionConfig = executionConfigMixin.getExecutionConfig();
    final DependencyParallelReader reader = new DependencyParallelReader(config.getProjectFolder(), config.getResultBaseFolder(), project, commits, config.getDependencyConfig(), executionConfig, kiekerConfig, new EnvironmentVariables());
    final ResultsFolders[] outFiles = reader.readDependencies();
    LOG.debug("Files: {}", outFiles);
    ResultsFolders mergedFolders = new ResultsFolders(config.getResultBaseFolder(), project);
    final File out = mergedFolders.getStaticTestSelectionFile();
    final StaticTestSelection all = PartialDependenciesMerger.mergeVersions(out, outFiles);
    final PeassFolders folders = new PeassFolders(config.getProjectFolder());
    final File dependencyTempFiles = new File(folders.getTempProjectFolder().getParentFile(), "dependencyTempFiles");
    FileUtils.moveDirectory(folders.getTempProjectFolder(), dependencyTempFiles);
    ExecutionData executionData = PartialDependenciesMerger.mergeExecutions(mergedFolders, outFiles);
    mergeViews(outFiles, mergedFolders);
    if (!config.isDoNotGenerateProperties()) {
        ResultsFolders resultsFolders = new ResultsFolders(config.getResultBaseFolder(), project);
        final PropertyReader propertyReader = new PropertyReader(resultsFolders, config.getProjectFolder(), executionData, executionConfig);
        propertyReader.readAllTestsProperties();
    }
}
Also used : EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) DependencyParallelReader(de.dagere.peass.dependency.reader.DependencyParallelReader) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) ResultsFolders(de.dagere.peass.folders.ResultsFolders) PropertyReader(de.dagere.peass.analysis.properties.PropertyReader) KiekerConfig(de.dagere.peass.config.KiekerConfig) File(java.io.File) StaticTestSelection(de.dagere.peass.dependency.persistence.StaticTestSelection) PeassFolders(de.dagere.peass.folders.PeassFolders) ExecutionData(de.dagere.peass.dependency.persistence.ExecutionData)

Example 15 with KiekerConfig

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

the class JmhDependencyReaderMultiParamTest method testVersionReading.

@Test
public void testVersionReading() throws IOException, InterruptedException, XmlPullParserException, ParseException, ViewNotFoundException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
    try (MockedStatic<GitUtils> gitUtilsMock = Mockito.mockStatic(GitUtils.class)) {
        FakeGitUtil.prepareGitUtils(gitUtilsMock);
        FakeFileIterator iterator = mockIterator();
        ResultsFolders resultsFolders = new ResultsFolders(TraceGettingIT.VIEW_IT_PROJECTFOLDER, "test");
        TestSelectionConfig dependencyConfig = new TestSelectionConfig(1, false, true, false);
        ExecutionConfig jmhConfig = new ExecutionConfig();
        jmhConfig.setTestTransformer("de.dagere.peass.dependency.jmh.JmhTestTransformer");
        jmhConfig.setTestExecutor("de.dagere.peass.dependency.jmh.JmhTestExecutor");
        DependencyReader reader = new DependencyReader(dependencyConfig, new PeassFolders(TestConstants.CURRENT_FOLDER), resultsFolders, "", iterator, new VersionKeeper(new File("/dev/null")), jmhConfig, new KiekerConfig(true), new EnvironmentVariables());
        reader.readInitialVersion();
        checkInitialVersion(resultsFolders);
        reader.readDependencies();
        checkChangedVersion(resultsFolders);
    }
}
Also used : TestSelectionConfig(de.dagere.peass.config.TestSelectionConfig) VersionKeeper(de.dagere.peass.dependency.reader.VersionKeeper) FakeFileIterator(de.dagere.peass.dependencytests.helper.FakeFileIterator) EnvironmentVariables(de.dagere.peass.execution.utils.EnvironmentVariables) GitUtils(de.dagere.peass.vcs.GitUtils) DependencyReader(de.dagere.peass.dependency.reader.DependencyReader) ExecutionConfig(de.dagere.peass.config.ExecutionConfig) ResultsFolders(de.dagere.peass.folders.ResultsFolders) File(java.io.File) KiekerConfig(de.dagere.peass.config.KiekerConfig) PeassFolders(de.dagere.peass.folders.PeassFolders) 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