Skip to content

Commit

Permalink
Merge pull request #3546 from joroKr21/alleycats-tests
Browse files Browse the repository at this point in the history
Fix alleycats-tests on Scala.js
  • Loading branch information
djspiewak authored Aug 5, 2020
2 parents 66e6e11 + d47ecdc commit 4cb93fb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
stage: test
name: Js tests 2.12
env: TEST="JS tests"
# http://austinpray.com/ops/2015/09/20/change-travis-node-version.html
install: rm -rf ~/.nvm && git clone https:/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
script: sbt ++$TRAVIS_SCALA_VERSION! validateJS && sbt ++$TRAVIS_SCALA_VERSION! validateKernelJS && sbt ++$TRAVIS_SCALA_VERSION! validateFreeJS
script: sbt ++$TRAVIS_SCALA_VERSION! validateAllJS
scala: *scala_version_212
- <<: *js_tests
name: Js tests 2.13
Expand Down Expand Up @@ -78,8 +76,7 @@ jobs:
scala: *scala_version_213

# Note that we're currently only building some modules on Dotty, not running tests.
- &dotty_tests
stage: test
- stage: test
name: Dotty tests
env: TEST="Dotty tests"
script: sbt ++$TRAVIS_SCALA_VERSION! alleycatsLawsJVM/compile
Expand All @@ -104,14 +101,13 @@ notifications:
- ${GITTER_WEBHOOK_URL}
on_success: change
on_failure: always
on_start: false
on_start: never

env:
global:
# Sonatype Credential
- secure: Kf44XQFpq2QGe3rn98Dsf5Uz3WXzPDralS54co7sqT5oQGs1mYLYZRYz+I75ZSo5ffZ86H7M+AI9YFofqGwAjBixBbqf1tGkUh3oZp2fN3QfqzazGV3HzC+o41zALG5FL+UBaURev9ChQ5fYeTtFB7YAzejHz4y5E97awk934Rg=
- secure: QbNAu0jCaKrwjJi7KZtYEBA/pYbTJ91Y1x/eLAJpsamswVOvwnThA/TLYuux+oiZQCiDUpBzP3oxksIrEEUAhl0lMtqRFY3MrcUr+si9NIjX8hmoFwkvZ5o1b7pmLF6Vz3rQeP/EWMLcljLzEwsrRXeK0Ei2E4vFpsg8yz1YXJg=
- TRAVIS_NODE_VERSION="4"
# Hydra License
- secure: "Nwd0ySmT7BQJcQb/Dyrkv/B1uYLrE5u+Ppz3Q3d6FvEB5z3XzzDai03hjMwwFwMgXGtZ2Aio0KqF2qf3oINPkmSVx1ntvL0JqwRZqxF5YPLp/vb8b4LbvHrzsf5Jh/EFK5JOdN6ApPlhw8u1X1ifvJbG6yVt9qRxCejHOI0ZT4k="
# Hydra Metrics Credential
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package alleycats.tests

import org.scalactic.anyvals.{PosInt, PosZDouble, PosZInt}
import org.scalatest.matchers.should.Matchers
import org.scalatest.prop.Configuration
import org.scalacheck.Test

trait TestSettings extends Configuration with Matchers {

lazy val checkConfiguration: PropertyCheckConfiguration =
PropertyCheckConfiguration(
minSuccessful = PosInt(5),
maxDiscardedFactor = PosZDouble(50.0),
minSize = PosZInt(0),
sizeRange = PosZInt(5),
workers = PosInt(1)
)
trait TestSettings {
lazy val checkConfiguration: Test.Parameters =
Test.Parameters.default
.withMinSuccessfulTests(5)
.withMaxDiscardRatio(50.0f)
.withMinSize(0)
.withWorkers(1)
}
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scalafixDependencies in ThisBuild += "org.typelevel" %% "simulacrum-scalafix" %

val isTravisBuild = settingKey[Boolean]("Flag indicating whether the current build is running under Travis")
val crossScalaVersionsFromTravis = settingKey[Seq[String]]("Scala versions set in .travis.yml as scala_version_XXX")
isTravisBuild in Global := sys.env.get("TRAVIS").isDefined
isTravisBuild in Global := sys.env.contains("TRAVIS")

val scalaCheckVersion = "1.14.3"

Expand Down Expand Up @@ -249,19 +249,18 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1
else if (currentMinVersion != minor) List(0)
else Range(0, patch - 1).inclusive.toList

val versions = for {
for {
maj <- majorVersions
min <- minorVersions
pat <- patchVersions(min)
} yield (maj, min, pat)
versions.toList
}

val mimaVersions: List[String] = {
Version(ver) match {
case Some(Version(major, Seq(minor, patch), _)) =>
semverBinCompatVersions(major.toInt, minor.toInt, patch.toInt)
.map { case (maj, min, pat) => s"${maj}.${min}.${pat}" }
.map { case (maj, min, pat) => s"$maj.$min.$pat" }
case _ =>
List.empty[String]
}
Expand Down Expand Up @@ -680,7 +679,7 @@ lazy val publishSettings = Seq(
scmInfo := Some(ScmInfo(url("https:/typelevel/cats"), "scm:git:[email protected]:typelevel/cats.git")),
autoAPIMappings := true,
apiURL := Some(url("http://typelevel.org/cats/api/")),
pomExtra := (
pomExtra :=
<developers>
<developer>
<id>ceedubs</id>
Expand Down Expand Up @@ -758,7 +757,6 @@ lazy val publishSettings = Seq(
<url>https://github.com/kailuowang/</url>
</developer>
</developers>
)
) ++ credentialSettings ++ sharedPublishSettings ++ sharedReleaseProcess

// Scalafmt
Expand All @@ -774,9 +772,11 @@ addCommandAlias("buildAlleycatsJVM", ";alleycatsCoreJVM/test;alleycatsLawsJVM/te
addCommandAlias("buildJVM", ";buildKernelJVM;buildCoreJVM;buildTestsJVM;buildFreeJVM;buildAlleycatsJVM")
addCommandAlias("validateBC", ";binCompatTest/test;mimaReportBinaryIssues")
addCommandAlias("validateJVM", ";fmtCheck;buildJVM;bench/test;validateBC;makeMicrosite")
addCommandAlias("validateJS", ";catsJS/compile;testsJS/test;js/test")
addCommandAlias("validateJS", ";testsJS/test;js/test")
addCommandAlias("validateKernelJS", "kernelLawsJS/test")
addCommandAlias("validateFreeJS", "freeJS/test") //separated due to memory constraint on travis
addCommandAlias("validateFreeJS", "freeJS/test")
addCommandAlias("validateAlleycatsJS", "alleycatsTestsJS/test")
addCommandAlias("validateAllJS", "all testsJS/test js/test kernelLawsJS/test freeJS/test alleycatsTestsJS/test")
addCommandAlias("validateDotty", ";++0.24.0!;alleycatsLawsJVM/compile")
addCommandAlias("validate", ";clean;validateJS;validateKernelJS;validateFreeJS;validateJVM;validateDotty")

Expand Down

0 comments on commit 4cb93fb

Please sign in to comment.