Search in sources :

Example 1 with PeassFolders

use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.

the class TestResultOrganizerParallel method initFolders.

private PeassFolders initFolders() {
    File parallelProjectFolder = new File(folders.getTempProjectFolder(), PARALLEL_VERSION);
    PeassFolders parallelProjectFolders = new PeassFolders(parallelProjectFolder);
    methodFolder = new File(parallelProjectFolders.getTempMeasurementFolder(), TestResultOrganizer.searchedTest.getClazz());
    methodFolder.mkdir();
    return parallelProjectFolders;
}
Also used : File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders)

Example 2 with PeassFolders

use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.

the class TestResultOrganizerParallel method testKoPeMeFileSaving.

@Test
public void testKoPeMeFileSaving() throws JAXBException, IOException {
    organizer = new ResultOrganizerParallel(folders, TestResultOrganizer.VERSION_NAME, 1, false, false, TestResultOrganizer.searchedTest, TestResult.BOUNDARY_SAVE_FILE * 2);
    PeassFolders parallelProjectFolders = initFolders();
    DummyKoPeMeDataCreator.initDummyTestfile(methodFolder, TestResult.BOUNDARY_SAVE_FILE * 2, TestResultOrganizer.searchedTest);
    organizer.addVersionFolders(PARALLEL_VERSION, parallelProjectFolders);
    Assert.assertTrue(organizer.testSuccess("1"));
    organizer.saveResultFiles(PARALLEL_VERSION, 0);
    testXMLFileIsCorrect();
}
Also used : ResultOrganizerParallel(de.dagere.peass.measurement.organize.ResultOrganizerParallel) PeassFolders(de.dagere.peass.folders.PeassFolders) Test(org.junit.jupiter.api.Test)

Example 3 with PeassFolders

use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.

the class TestResultOrganizerParams method testReading.

@Test
public void testReading() throws JAXBException, IOException {
    TestCase testcase = new TestCase("de.dagere.peass.ExampleBenchmarkClazz#calleeMethod");
    PeassFolders folders = mockFolders(testcase);
    for (int i = 0; i < 3; i++) {
        ResultOrganizer organizer = new ResultOrganizer(folders, VERSION, 15 + i, false, false, testcase, 10);
        organizer.saveResultFiles(VERSION, i);
        organizer.saveResultFiles(VERSION_OLD, i);
    }
    File expectedResultFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1).xml");
    File expectedResultFile2 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2).xml");
    Assert.assertTrue(expectedResultFile1.exists());
    Assert.assertTrue(expectedResultFile2.exists());
    Kopemedata data = XMLDataLoader.loadData(expectedResultFile1);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0).getResult();
    MatcherAssert.assertThat(results, IsIterableWithSize.iterableWithSize(2));
    File expectedFulldataFile = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2)_0_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata = XMLDataLoader.loadData(expectedFulldataFile);
    Assert.assertEquals(1, fulldata.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
    File expectedFulldataFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1)_2_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata1 = XMLDataLoader.loadData(expectedFulldataFile1);
    Assert.assertEquals(1, fulldata1.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
}
Also used : ResultOrganizer(de.dagere.peass.measurement.organize.ResultOrganizer) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

Example 4 with PeassFolders

use of de.dagere.peass.folders.PeassFolders 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 5 with PeassFolders

use of de.dagere.peass.folders.PeassFolders in project peass by DaGeRe.

the class ParallelExecutionRunnable method cloneProjectFolder.

private PeassFolders cloneProjectFolder() throws IOException, InterruptedException {
    PeassFolders temporaryFolders = tester.getFolders().getTempFolder("parallel_" + version);
    organizer.addVersionFolders(version, temporaryFolders);
    return temporaryFolders;
}
Also used : PeassFolders(de.dagere.peass.folders.PeassFolders)

Aggregations

PeassFolders (de.dagere.peass.folders.PeassFolders)73 File (java.io.File)45 Test (org.junit.jupiter.api.Test)38 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)30 ExecutionConfig (de.dagere.peass.config.ExecutionConfig)28 KiekerConfig (de.dagere.peass.config.KiekerConfig)21 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)19 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)18 StaticTestSelection (de.dagere.peass.dependency.persistence.StaticTestSelection)14 ResultsFolders (de.dagere.peass.folders.ResultsFolders)13 DependencyReader (de.dagere.peass.dependency.reader.DependencyReader)11 GitUtils (de.dagere.peass.vcs.GitUtils)11 VersionIteratorGit (de.dagere.peass.vcs.VersionIteratorGit)11 FakeFileIterator (de.dagere.peass.dependencytests.helper.FakeFileIterator)8 JUnitTestTransformer (de.dagere.peass.testtransformation.JUnitTestTransformer)8 TestExecutor (de.dagere.peass.execution.utils.TestExecutor)7 List (java.util.List)7 VisualizationFolderManager (de.dagere.peass.ci.helper.VisualizationFolderManager)6 ChangeManager (de.dagere.peass.dependency.ChangeManager)5 ChangedEntity (de.dagere.peass.dependency.analysis.data.ChangedEntity)5