Skip to content

Commit

Permalink
add test that checks different paths between provider and report
Browse files Browse the repository at this point in the history
  • Loading branch information
DMarinhoCodacy committed Jun 3, 2024
1 parent 53e8ad4 commit f377b8c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
<line number="6" hits="2"/>
</lines>
</class>
<class line-rate="0.87" name="TestSourceFile" filename="coverage-parser\src\test\resources\TeStSOuRcEfIle.scala">
<methods/>
<lines>
<line number="9" hits="1"/>
<line number="10" hits="1"/>
</lines>
</class>
<class line-rate="0.87" name="TestSourceFile2" filename="coverage-parser\src\test\resources\TeStSOuRcEfIle2.scala">
<methods/>
<lines>
Expand Down
24 changes: 24 additions & 0 deletions src/test/scala/com/codacy/rules/ReportRulesSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,30 @@ class ReportRulesSpec extends WordSpec with Matchers with PrivateMethodTester wi
)
}

"succeed even if the provider paths and the report paths have different cases" in {
val coverageServices = mock[CoverageServices]
val gitFileFetcher = mock[GitFileFetcher]

gitFileFetcher.forCommit(any[String]).shouldReturn(Left("The report has files with different cases"))

coverageServices.sendReport(
any[String],
any[String],
any[CoverageReport],
anyBoolean,
Some(RequestTimeout(1000, 10000)),
Some(10000),
Some(3)
) returns SuccessfulResponse(RequestSuccess("Success"))

assertCodacyCoverage(
coverageServices,
gitFileFetcher,
List("src/test/resources/test-paths-with-different-paths.xml"),
success = true
)
}

"succeed even if one of the parsed reports ends up empty" in {
val coverageServices = mock[CoverageServices]
val gitFileFetcher = mock[GitFileFetcher]
Expand Down

0 comments on commit f377b8c

Please sign in to comment.