From 6ffc3199a7b13626317b05b6a3172b16013e2bcb Mon Sep 17 00:00:00 2001 From: Henry Coles Date: Wed, 2 Oct 2024 12:55:41 +0100 Subject: [PATCH] failing test --- .../src/test/java/org/pitest/PitMojoIT.java | 40 ++++++++++++------- .../resources/pit-cross-module-tests/pom.xml | 4 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/pitest-maven-verification/src/test/java/org/pitest/PitMojoIT.java b/pitest-maven-verification/src/test/java/org/pitest/PitMojoIT.java index 242e595c9..442a5b25b 100755 --- a/pitest-maven-verification/src/test/java/org/pitest/PitMojoIT.java +++ b/pitest-maven-verification/src/test/java/org/pitest/PitMojoIT.java @@ -360,21 +360,6 @@ public void shouldWorkWithGWTMockito() throws Exception { assertThat(actual).doesNotContain("status='RUN_ERROR'"); } - @Test - @Ignore("yatspec is not available on maven central. Repo currently down") - public void shouldWorkWithYatspec() throws Exception { - File testDir = prepare("/pit-263-yatspec"); - verifier.executeGoal("test"); - verifier.executeGoal("org.pitest:pitest-maven:mutationCoverage"); - - String actual = readResults(testDir); - assertThat(actual) - .contains( - "SomeClass.java"); - assertThat(actual).doesNotContain("status='NO_COVERAGE'"); - assertThat(actual).doesNotContain("status='RUN_ERROR'"); - } - @Test // note this test depends on the junit5 plugin public void shouldWorkWithQuarkus() throws Exception { @@ -465,6 +450,31 @@ public void resolvesCorrectFilesForKotlinMultiModules() throws Exception { } + @Test + public void handlesTestsInSeparateModulesWhenConfigured() + throws Exception { + File testDir = prepare("/pit-cross-module-tests"); + + verifier.executeGoal("test"); + verifier.executeGoal("org.pitest:pitest-maven:mutationCoverage"); + + verifier.executeGoal("org.pitest:pitest-maven:report-aggregate-module"); + + File siteParentDir = buildFilePath(testDir, "target", "pit-reports"); + assertThat(buildFilePath(siteParentDir, "index.html")).exists(); + String projectReportsHtmlContents = FileUtils + .readFileToString(buildFilePath(testDir, "target", "pit-reports", + "index.html")); + + assertTrue("miss data of subModule 1", + projectReportsHtmlContents + .contains("org.example1")); + + assertTrue("coverage included", + projectReportsHtmlContents + .contains("85%")); + } + private void runForJava8Only() { String javaVersion = System.getProperty("java.version"); assumeTrue(javaVersion.startsWith("1.8")); diff --git a/pitest-maven-verification/src/test/resources/pit-cross-module-tests/pom.xml b/pitest-maven-verification/src/test/resources/pit-cross-module-tests/pom.xml index 955f71e24..d98c8fbd6 100644 --- a/pitest-maven-verification/src/test/resources/pit-cross-module-tests/pom.xml +++ b/pitest-maven-verification/src/test/resources/pit-cross-module-tests/pom.xml @@ -41,9 +41,7 @@ true - 26 - 20 - 6 +