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

[AN-341] Pin CI to use MySQL 8.0.40 #350

Merged
merged 7 commits into from
Feb 12, 2025
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 build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ libraryDependencies ++= Seq(
"org.mock-server" % "mockserver-netty" % "5.11.1" % Test,
"com.dimafeng" %% "testcontainers-scala-mysql" % testcontainersScalaV % Test,
"com.dimafeng" %% "testcontainers-scala-mongodb" % testcontainersScalaV % Test,
"org.flywaydb" % "flyway-core" % "7.3.2" % Test,
"org.flywaydb" % "flyway-core" % "7.3.2" % Test, // Starting 10.0.0 Flyway only supports Java 17. Agora is on Java 11. See https://broadworkbench.atlassian.net/browse/AN-394
"org.broadinstitute.dsde.workbench" % "sam-client_2.12" % "0.1-61135c7", // Should become available for 2.13 once a release happens ( https://github.com/broadinstitute/sam/pull/491 )
"org.broadinstitute.cromwell" % "cromwell-client_2.12" % "0.1-8b413b45f-SNAP", // Contains only Java, pinning on 2.12
"org.broadinstitute.dsde.workbench" %% "workbench-oauth2" % workbenchOauth2V excludeAll(
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mockAuthenticatedUserEmail = "[email protected]"
sqlDatabase = {
profile = "slick.jdbc.MySQLProfile$"
db {
url = "jdbc:tc:mysql:8.0:///agora"
url = "jdbc:tc:mysql:8.0.40:///agora"
user = null
password = null
driver = "org.testcontainers.jdbc.ContainerDatabaseDriver"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package org.broadinstitute.dsde.agora.server.dataaccess.permissions

import org.broadinstitute.dsde.agora.server.{AgoraTestData, AgoraTestFixture}
import org.broadinstitute.dsde.agora.server.{AgoraConfig, AgoraTestData, AgoraTestFixture}
import org.broadinstitute.dsde.agora.server.dataaccess.permissions.AgoraPermissions._
import org.broadinstitute.dsde.agora.server.webservice.ApiServiceSpec
import org.scalatest.flatspec.AnyFlatSpecLike
Expand All @@ -10,6 +10,8 @@ import org.scalatest.{BeforeAndAfterAll, DoNotDiscover}
@DoNotDiscover
class AgoraPermissionsSpec extends ApiServiceSpec with BeforeAndAfterAll with AgoraTestFixture with AnyFlatSpecLike {

import AgoraConfig.sqlDatabase.profile.api._

override protected def beforeAll(): Unit = {
ensureDatabasesAreRunning()
}
Expand All @@ -18,6 +20,15 @@ class AgoraPermissionsSpec extends ApiServiceSpec with BeforeAndAfterAll with Ag
clearDatabases()
}

"Agora" should "run on expected SQL version" in {
val action = for {
version <- sql"select version();".as[String]
} yield version.head
val version = runInDB { _ => action }

assert(version equals "8.0.40")
}

"Agora" should "return true if someone has read access and we ask if they have read access " in {
val authorization = AgoraPermissions(Read)
assert(authorization.canRead)
Expand Down
Loading