Skip to content

Commit

Permalink
Merge branch 'master' into doc/status-final-not-sent-IO-166
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Ribeiro authored Nov 11, 2022
2 parents 5d305ac + baa0bd8 commit b4f8a46
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codacy: codacy/base@9.0.0
codacy: codacy/base@9.3.3

references:
circleci_job: &circleci_job
Expand Down
19 changes: 10 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import codacy.libs._

inThisBuild(
Seq(
scalaVersion := "2.12.11",
Expand All @@ -25,18 +23,21 @@ libraryDependencies ++= Seq(
)

// Test dependencies
libraryDependencies ++= Seq(scalatest % "it,test", mockitoScalaScalatest % Test)
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % "it,test",
"org.mockito" %% "mockito-scala-scalatest" % "1.7.1" % Test
)

configs(IntegrationTest)
Defaults.itSettings

mainClass in assembly := Some("com.codacy.CodacyCoverageReporter")
assemblyMergeStrategy in assembly := {
assembly / mainClass := Some("com.codacy.CodacyCoverageReporter")
assembly / assemblyMergeStrategy := {
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
case m if m.toLowerCase.matches("meta-inf.*\\.sf$") => MergeStrategy.discard
case _ => MergeStrategy.first
}
test in assembly := {}
assembly / test := {}
crossPaths := false

// HACK: Since we are only using the public resolvers we need to remove the private for it to not fail
Expand All @@ -53,8 +54,8 @@ scmInfo := Some(
)
)

fork in Test := true
cancelable in Global := true
Test / fork := true
Global / cancelable := true

javacOptions ++= Seq("-source", "11", "-target", "11")

Expand Down Expand Up @@ -87,7 +88,7 @@ lazy val coverageParser = project
"com.codacy" %% "codacy-api-scala" % "7.0.3",
"com.codacy" %% "codacy-plugins-api" % "5.2.0",
"org.scala-lang.modules" %% "scala-xml" % "1.2.0",
scalatest % Test
"org.scalatest" %% "scalatest" % "3.0.8" % Test
)
)

Expand Down
Binary file modified docs/images/coverage-pr-commits.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/images/coverage-pr-commits.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/coverage-validate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/images/coverage-validate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,11 @@ Because of this, to ensure that all code coverage metrics are available on Codac
!!! note "Example"
The example below shows that after pushing a commit that correctly sets up coverage on the main branch:

- Codacy will report coverage metrics for all subsequent commits and pull requests relative to the main branch
- Codacy won't report coverage metrics for commits and pull requests that are relative to older branches where the coverage setup wasn't performed yet
- Codacy will report coverage metrics for all subsequent commits and pull requests relative to the main branch.

- Codacy won't report coverage metrics for commits and pull requests that are relative to older branches where the coverage setup wasn't performed yet.

To solve this issue, you can rebase the old feature branch to update the common ancestor commit to one that already has coverage data.

![Setting up coverage on the main branch](images/coverage-validate.png)

Expand Down Expand Up @@ -244,8 +247,8 @@ Follow these instructions to validate that your coverage setup is working correc
</thead>
<tbody>
<tr>
<td rowspan="2" id="status-commit-not-found">
<p style="color: #EF5454;"><strong>Commit not found</strong></p>
<td rowspan="2">
<p id="status-commit-not-found" style="color: #EF5454;"><strong>Commit not found</strong></p>
<p>Codacy doesn't have information about the commit associated with the coverage data.</p>
</td>
<td>
Expand All @@ -265,8 +268,8 @@ Follow these instructions to validate that your coverage setup is working correc
</td>
</tr>
<tr>
<td rowspan="2" id="status-branch-not-enabled">
<p style="color: #EF5454;"><strong>Branch not enabled</strong></p>
<td rowspan="2">
<p id="status-branch-not-enabled" style="color: #EF5454;"><strong>Branch not enabled</strong></p>
<p>The commit associated with the coverage data doesn't belong to any branch that Codacy is analyzing.</p>
</td>
<td>
Expand All @@ -286,8 +289,8 @@ Follow these instructions to validate that your coverage setup is working correc
</td>
</tr>
<tr>
<td rowspan="5" id="status-commit-not-analyzed">
<p style="color: #EF5454;"><strong>Commit not analyzed</strong></p>
<td rowspan="5">
<p id="status-commit-not-analyzed" style="color: #EF5454;"><strong>Commit not analyzed</strong></p>
<p>Due to technical limitations, Codacy only reports coverage for a commit after successfully completing the static code analysis of that commit.</p>
</td>
<td>
Expand Down Expand Up @@ -378,7 +381,7 @@ Follow these instructions to validate that your coverage setup is working correc
If Codacy doesn't display the coverage variation metric in pull requests (represented by `-`), make sure that you have uploaded coverage data for both:

- The common ancestor commit of the pull request branch and the target branch
- The last commit in the pull request branch
- The head commit of the pull request branch

The following diagram highlights the commits that must have received coverage data for Codacy to display the coverage variation metric on a pull request:

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.7.2

0 comments on commit b4f8a46

Please sign in to comment.