Skip to content

Commit

Permalink
Merge pull request #552 from rolandtritsch/main
Browse files Browse the repository at this point in the history
Make scripted tests more comprehensive
  • Loading branch information
rolandtritsch authored Aug 21, 2024
2 parents 8b8205b + a059af3 commit 942d544
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/aggregate-disabled-module/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ lazy val c = project.disablePlugins(ScoverageSbtPlugin)

ThisBuild / resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/aggregate-only/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ lazy val root = (project in file("."))

ThisBuild / resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/aggregate/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ lazy val root = (project in file("."))

ThisBuild / resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage-file-branch/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage-file-stmt/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage-package-stmt/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage-total-branch/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage-total-stmt/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ resolvers ++= {
.get("plugin.version")
.map(_.endsWith("-SNAPSHOT"))
.getOrElse(false)
) Seq(Resolver.sonatypeRepo("snapshots"))
) Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/bad-coverage/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ coverageFailOnMinimum := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
4 changes: 2 additions & 2 deletions src/sbt-test/scoverage/coverage-excluded-files/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ scalaVersion := "2.13.13"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageExcludedFiles := ".*/two/GoodCoverage"
coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 2 additions & 0 deletions src/sbt-test/scoverage/coverage-excluded-files/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
> test
> coverageReport
# There should be no directory for the excluded files
$ exists target/scala-2.13/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-2.13/scoverage-report/two
-$ exists target/scala-2.13/scoverage-report/three
4 changes: 2 additions & 2 deletions src/sbt-test/scoverage/coverage-excluded-packages/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ scalaVersion := "2.13.13"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageExcludedPackages := "two\\..*"
coverageExcludedPackages := "two\\..*;three\\..*"

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 2 additions & 0 deletions src/sbt-test/scoverage/coverage-excluded-packages/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
> test
> coverageReport
# There should be no directory for the excluded package
$ exists target/scala-2.13/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-2.13/scoverage-report/two
-$ exists target/scala-2.13/scoverage-report/three
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/coverage-off/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ coverageFailOnMinimum := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/data-dir/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ coverageFailOnMinimum := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/good-coverage/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ coverageFailOnMinimum := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/preserve-set/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ checkScoverageEnabled := {

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/scala3-bad/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ coverageEnabled := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ scalaVersion := "3.4.2"

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test

coverageExcludedFiles := ".*/two/GoodCoverage;.*/three/GoodCoverage"
coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
4 changes: 3 additions & 1 deletion src/sbt-test/scoverage/scala3-coverage-excluded-files/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
> test
> coverageReport
# There should be no directory for the excluded files
-$ exists target/scala-3.4.2/scoverage-report/two
$ exists target/scala-3.4.2/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.4.2/scoverage-report/two
-$ exists target/scala-3.4.2/scoverage-report/three
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ coverageExcludedPackages := "two\\..*;three\\..*"

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 2 additions & 0 deletions src/sbt-test/scoverage/scala3-coverage-excluded-packages/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
> test
> coverageReport
# There should be no directory for the excluded package
$ exists target/scala-3.4.2/scoverage-report/GoodCoverage.scala.html
-$ exists target/scala-3.4.2/scoverage-report/two
-$ exists target/scala-3.4.2/scoverage-report/three
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/scala3-good/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ coverageFailOnMinimum := true

resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/scalajs/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ lazy val crossJVM = cross.jvm

ThisBuild / resolvers ++= {
if (sys.props.get("plugin.version").exists(_.endsWith("-SNAPSHOT")))
Seq(Resolver.sonatypeRepo("snapshots"))
Resolver.sonatypeOssRepos("snapshots")
else Seq.empty
}

0 comments on commit 942d544

Please sign in to comment.