diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7da3f96c..32d2b6434 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: # We compile the tests here so the test command can run faster - name: Compile tests - run: "sbt test:compile" + run: "sbt Test/compile" # Due to transient errors thrown by HTMLUnit, we try # to run the tests a few times - name: Run tests diff --git a/build.sbt b/build.sbt index daab1b3c2..b546adcfe 100644 --- a/build.sbt +++ b/build.sbt @@ -50,6 +50,8 @@ scalacOptions ++= Seq( "-Xlint:eta-zero", "-Xlint:eta-sam", "-Xlint:deprecation", + // Sets warnings as errors on the CI + if (insideCI.value) "-Wconf:any:error" else "-Wconf:any:warning", "-Wdead-code", "-Wextra-implicit", "-Wmacros:before", diff --git a/test/models/AuthorizationSpec.scala b/test/models/AuthorizationSpec.scala index 39ce8d7a7..5c08fe5db 100644 --- a/test/models/AuthorizationSpec.scala +++ b/test/models/AuthorizationSpec.scala @@ -40,7 +40,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(Helper)) val fileExpirationDate = 10 - val overrun = -3 + val overrun: Long = -3 val answers = List.empty[Answer] @@ -70,7 +70,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(Helper)) val fileExpirationDate = 10 - val overrun = 10 + val overrun: Long = 10 val answers = List.empty[Answer] @@ -132,7 +132,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(Helper)) val fileExpirationDate = 10 - val overrun = -3 + val overrun: Long = -3 val answer = createAnswer(applicationId, now().minusDays(fileExpirationDate + overrun)) @@ -165,7 +165,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(Helper)) val fileExpirationDate = 10 - val overrun = 2 + val overrun: Long = 2 val answer = createAnswer(applicationId, now().minusDays(fileExpirationDate + overrun)) @@ -205,7 +205,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(InstructorOfGroups(Set.empty[UUID]))) val fileExpirationDate = 10 - val overrun = -3 + val overrun: Long = -3 val answers = List.empty[Answer] @@ -235,7 +235,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(InstructorOfGroups(Set.empty[UUID]))) val fileExpirationDate = 10 - val overrun = 10 + val overrun: Long = 10 val answers = List.empty[Answer] @@ -297,7 +297,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(InstructorOfGroups(Set.empty[UUID]))) val fileExpirationDate = 10 - val overrun = -3 + val overrun: Long = -3 val answer = createAnswer(applicationId, now().minusDays(fileExpirationDate + overrun)) @@ -330,7 +330,7 @@ class AuthorizationSpec extends Specification { val userId = randomUUID() val rights = UserRights(Set(InstructorOfGroups(Set.empty[UUID]))) val fileExpirationDate = 10 - val overrun = 2 + val overrun: Long = 2 val answer = createAnswer(applicationId, now().minusDays(fileExpirationDate + overrun))