diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff833ea67..3858a6fcf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,8 +24,13 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: fail-fast: false + matrix: + scala: [2.11.12, 2.12.18, 2.13.11] + + name: Scala ${{matrix.scala}} steps: - name: Checkout code @@ -36,4 +41,4 @@ jobs: with: java-version: "adopt@1.8" - name: Build and run tests - run: sbt test doc + run: sbt ++${{matrix.scala}} test doc diff --git a/.github/workflows/jacoco_check.yml b/.github/workflows/jacoco_check.yml index 398a32ddf..426698bc1 100644 --- a/.github/workflows/jacoco_check.yml +++ b/.github/workflows/jacoco_check.yml @@ -33,7 +33,7 @@ jobs: # The codebase for all Scala versions is the same, so the coverage is calculated only once # Scala 2.12 is chosen since it is supported by the most wide range of Spark versions and # vendor distributions. - - scala: 2.12.12 + - scala: 2.12.18 scalaShort: "2.12" overall: 80.0 changed: 80.0 diff --git a/agent/src/test/scala/za/co/absa/atum/agent/AtumContextTest.scala b/agent/src/test/scala/za/co/absa/atum/agent/AtumContextTest.scala index 996dc3a50..97f744af5 100644 --- a/agent/src/test/scala/za/co/absa/atum/agent/AtumContextTest.scala +++ b/agent/src/test/scala/za/co/absa/atum/agent/AtumContextTest.scala @@ -78,7 +78,7 @@ class AtumContextTest extends AnyFlatSpec with Matchers { val atumContext = new AtumContext(atumPartitions, mockAgent) .addMeasure(RecordCount("letter")) - val spark = SparkSession.builder + val spark = SparkSession.builder() .master("local") .config("spark.driver.host", "localhost") .config("spark.ui.enabled", "false") @@ -134,7 +134,7 @@ class AtumContextTest extends AnyFlatSpec with Matchers { implicit val atumContext: AtumContext = new AtumContext(atumPartitions, mockAgent) .addMeasure(RecordCount("notImportantColumn")) - val spark = SparkSession.builder + val spark = SparkSession.builder() .master("local") .config("spark.driver.host", "localhost") .config("spark.ui.enabled", "false") diff --git a/build.sbt b/build.sbt index 94b74ad12..59233505e 100644 --- a/build.sbt +++ b/build.sbt @@ -21,10 +21,8 @@ import sbt.Keys.name ThisBuild / organization := "za.co.absa" -ThisBuild / name := "atum-service" ThisBuild / scalaVersion := Versions.scala212 // default version -ThisBuild / crossScalaVersions := Versions.supportedScalaVersions ThisBuild / versionScheme := Some("early-semver") @@ -71,8 +69,7 @@ lazy val server = (projectMatrix in file("server")) packageBin := (Compile / assembly).value, artifactPath / (Compile / packageBin) := baseDirectory.value / s"target/${name.value}-${version.value}.war", webappWebInfClasses := true, - inheritJarManifest := true, - mergeStrategy + inheritJarManifest := true ): _* ) .settings( @@ -82,7 +79,7 @@ lazy val server = (projectMatrix in file("server")) .enablePlugins(AssemblyPlugin) .enablePlugins(TomcatPlugin) .enablePlugins(AutomateHeaderPlugin) - .jvmPlatform(scalaVersions = Versions.supportedScalaVersions) + .jvmPlatform(scalaVersions = Seq(Versions.serviceScalaVersion)) .dependsOn(model) lazy val agent = (projectMatrix in file("agent")) @@ -102,8 +99,8 @@ lazy val agent = (projectMatrix in file("agent")) jacocoExcludes := jacocoProjectExcludes() ) .sparkRow(SparkVersionAxis(Versions.spark2), scalaVersions = Seq(Versions.scala211, Versions.scala212)) - .sparkRow(SparkVersionAxis(Versions.spark3), scalaVersions = Seq(Versions.scala212)) - .jvmPlatform(scalaVersions = Versions.supportedScalaVersions) + .sparkRow(SparkVersionAxis(Versions.spark3), scalaVersions = Seq(Versions.scala212, Versions.scala213)) + .jvmPlatform(scalaVersions = Versions.clientSupportedScalaVersions) .dependsOn(model) lazy val model = (projectMatrix in file("model")) @@ -118,4 +115,4 @@ lazy val model = (projectMatrix in file("model")) jacocoReportSettings := jacocoSettings(scalaVersion.value, "atum-agent: model"), jacocoExcludes := jacocoProjectExcludes() ) - .jvmPlatform(scalaVersions = Versions.supportedScalaVersions) + .jvmPlatform(scalaVersions = Versions.clientSupportedScalaVersions) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index d839473cf..690fb246f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -23,8 +23,11 @@ object Dependencies { val spark3 = "3.3.2" val scala211 = "2.11.12" - val scala212 = "2.12.12" - val supportedScalaVersions: Seq[String] = Seq(scala211, scala212) + val scala212 = "2.12.18" + val scala213 = "2.13.11" + + val serviceScalaVersion: String = scala212 + val clientSupportedScalaVersions: Seq[String] = Seq(scala211, scala212, scala213) val scalatest = "3.2.15" val scalaMockito = "1.17.12" @@ -35,7 +38,7 @@ object Dependencies { val specs2 = "4.10.0" val typesafeConfig = "1.4.2" - val spring = "2.6.6" + val spring = "2.6.15" val javaxServlet = "4.0.1" @@ -51,7 +54,6 @@ object Dependencies { val json4s_spark2 = "3.5.3" val json4s_spark3 = "3.7.0-M11" - val slf4s = "1.7.25" val logback = "1.2.3" } @@ -72,7 +74,8 @@ object Dependencies { scalaVersion match { case _ if scalaVersion.startsWith("2.11") => Versions.spark2 case _ if scalaVersion.startsWith("2.12") => Versions.spark3 - case _ => throw new IllegalArgumentException("Only Scala 2.11 and 2.12 are currently supported.") + case _ if scalaVersion.startsWith("2.13") => Versions.spark3 + case _ => throw new IllegalArgumentException("Only Scala 2.11, 2.12, and 2.13 are currently supported.") } } @@ -95,7 +98,6 @@ object Dependencies { lazy val json4sJackson = "org.json4s" %% "json4s-jackson" % json4sVersion % Provided lazy val json4sNative = "org.json4s" %% "json4s-native" % json4sVersion % Provided - lazy val slf4s = "org.slf4s" %% "slf4s-api" % Versions.slf4s lazy val logback = "ch.qos.logback" % "logback-classic" % Versions.logback lazy val scalatest = "org.scalatest" %% "scalatest" % Versions.scalatest % Test lazy val mockito = "org.mockito" %% "mockito-scala" % Versions.scalaMockito % Test @@ -106,7 +108,6 @@ object Dependencies { json4sCore, json4sJackson, json4sNative, - slf4s, logback, scalatest, mockito, diff --git a/server/src/main/scala/za/co/absa/atum/server/dao/InMemoryApiModelDao.scala b/server/src/main/scala/za/co/absa/atum/server/dao/InMemoryApiModelDao.scala index 0975b53ae..fae254e64 100644 --- a/server/src/main/scala/za/co/absa/atum/server/dao/InMemoryApiModelDao.scala +++ b/server/src/main/scala/za/co/absa/atum/server/dao/InMemoryApiModelDao.scala @@ -22,10 +22,9 @@ import za.co.absa.atum.server.model.{BaseApiModel, ControlMeasure, Flow, Partiti import java.util.UUID import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap} -import scala.collection.JavaConverters._ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future - +import scala.collection.JavaConverters._ object InMemoryApiModelDao {