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

update ScalaTest #3101

Merged
merged 1 commit into from
Oct 5, 2019
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
38 changes: 12 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ val isTravisBuild = settingKey[Boolean]("Flag indicating whether the current bui
val crossScalaVersionsFromTravis = settingKey[Seq[String]]("Scala versions set in .travis.yml as scala_version_XXX")
isTravisBuild in Global := sys.env.get("TRAVIS").isDefined

val scalatestVersion = "3.1.0-SNAP13"

val scalatestplusScalaCheckVersion = "1.0.0-SNAP8"

val scalaCheckVersion = "1.14.2"

val disciplineVersion = "1.0.0"
val scalatestplusScalaCheckVersion = "3.1.0.0-RC2"

val disciplineScalatestVersion = "1.0.0-M1"
val disciplineVersion = "1.0.1"

val kindProjectorVersion = "0.10.3"
val disciplineScalatestVersion = "1.0.0-RC1"

val kindProjectorVersion = "0.11.0"

crossScalaVersionsFromTravis in Global := {
val manifest = (baseDirectory in ThisBuild).value / ".travis.yml"
Expand Down Expand Up @@ -96,7 +94,7 @@ def macroDependencies(scalaVersion: String) =
lazy val catsSettings = Seq(
incOptions := incOptions.value.withLogRecompileOnMacro(false),
libraryDependencies ++= Seq(
compilerPlugin("org.typelevel" %% "kind-projector" % kindProjectorVersion)
compilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full))
) ++ macroDependencies(scalaVersion.value)
) ++ commonSettings ++ publishSettings ++ scoverageSettings ++ simulacrumSettings

Expand Down Expand Up @@ -168,9 +166,8 @@ lazy val disciplineDependencies = Seq(

lazy val testingDependencies = Seq(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalatestVersion % "test",
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion % "test",
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion % "test"
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion % "test",
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion % "test"
)
)

Expand Down Expand Up @@ -571,12 +568,7 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
.settings(moduleName := "cats-tests")
.settings(catsSettings)
.settings(noPublishSettings)
.settings(
libraryDependencies ++= Seq(
"org.scalatestplus" %%% "scalatestplus-scalacheck" % scalatestplusScalaCheckVersion,
"org.typelevel" %%% "discipline-scalatest" % disciplineScalatestVersion
)
)
.settings(testingDependencies)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions in Test := (scalacOptions in Test).value.filter(_ != "-Xfatal-warnings"))
Expand All @@ -589,11 +581,6 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform)
.settings(moduleName := "cats-testkit")
.settings(catsSettings)
.settings(disciplineDependencies)
.settings(
libraryDependencies ++= Seq(
"org.scalacheck" %%% "scalacheck" % scalaCheckVersion
)
)
.jsSettings(commonJsSettings)
.jvmSettings(commonJvmSettings)
.settings(scalacOptions := scalacOptions.value.filter(_ != "-Xfatal-warnings"))
Expand Down Expand Up @@ -664,17 +651,17 @@ lazy val binCompatTest = project
// see https://github.com/typelevel/cats/pull/3026#discussion_r321984342
useCoursier := false,
commonScalaVersionSettings,
addCompilerPlugin("org.typelevel" %% "kind-projector" % kindProjectorVersion),
addCompilerPlugin(("org.typelevel" %% "kind-projector" % kindProjectorVersion).cross(CrossVersion.full)),
libraryDependencies ++= List(
{
if (priorTo2_13(scalaVersion.value))
mimaPrevious("cats-core", scalaVersion.value, version.value).last % Provided
else //We are not testing BC on Scala 2.13 yet.
"org.typelevel" %% "cats-core" % "2.0.0-M4" % Provided
},
"org.scalatest" %%% "scalatest" % scalatestVersion % Test
}
)
)
.settings(testingDependencies)
.dependsOn(core.jvm % Test)

// cats-js is JS-only
Expand Down Expand Up @@ -857,7 +844,6 @@ def priorTo2_13(scalaVersion: String): Boolean =
lazy val sharedPublishSettings = Seq(
releaseTagName := tagName.value,
releaseVcsSign := true,
useGpg := true, // bouncycastle has bugs with subkeys, so we use gpg instead
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(false),
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala/cats/tests/CatsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cats.platform.Platform
import cats.syntax._
import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt}
import org.scalatest.funsuite.AnyFunSuiteLike
import org.scalatest.Matchers
import org.scalatest.matchers.should.Matchers
import org.scalatest.prop.Configuration
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.typelevel.discipline.scalatest.Discipline
Expand Down
5 changes: 3 additions & 2 deletions tests/src/test/scala/cats/tests/SemigroupSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cats
package tests

import org.scalatest._
import org.scalatest.matchers.should.Matchers
import org.scalatest.funsuite._
import org.scalatest.prop.GeneratorDrivenPropertyChecks
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks

class SemigroupSuite extends AnyFunSuiteLike with Matchers with GeneratorDrivenPropertyChecks {
class SemigroupSuite extends AnyFunSuiteLike with Matchers with ScalaCheckDrivenPropertyChecks {
{
import cats.implicits._
Invariant[Semigroup]
Expand Down