Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make scripted tests more comprehensive #552

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}