Skip to content

Commit

Permalink
Refactor integ-test path
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chu <[email protected]>
  • Loading branch information
noCharger committed Jul 5, 2024
1 parent b5715f6 commit 95f78ea
Show file tree
Hide file tree
Showing 44 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
java-version: 11

- name: Integ Test
run: sbt integtest/test
run: sbt it:test

- name: Unit Test
run: sbt test
Expand Down
24 changes: 18 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,20 @@ lazy val flintSparkIntegration = (project in file("flint-spark-integration"))
},
assembly / test := (Test / test).value)

// Test assembly package with integration test.
lazy val IntegrationTest = config("it") extend Test

lazy val integtest = (project in file("integ-test"))
.dependsOn(flintCommons % "test->test", flintSparkIntegration % "test->test", pplSparkIntegration % "test->test", sparkSqlApplication % "test->test")
.configs(IntegrationTest)
.settings(
commonSettings,
inConfig(IntegrationTest)(Defaults.testSettings), // Apply test settings to the IntegrationTest configuration
IntegrationTest / scalaSource := baseDirectory.value / "src" / "it" / "scala",
IntegrationTest / javaSource := baseDirectory.value / "src" / "it" / "java",
name := "integ-test",
scalaVersion := scala212,
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk" % "1.12.397" % "provided"
exclude ("com.fasterxml.jackson.core", "jackson-databind"),
exclude("com.fasterxml.jackson.core", "jackson-databind"),
"org.scalactic" %% "scalactic" % "3.2.15",
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
"com.stephenn" %% "scalatest-json-jsonassert" % "0.2.5" % "test",
Expand All @@ -214,11 +218,19 @@ lazy val integtest = (project in file("integ-test"))
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0" % "test",
// add opensearch-java client to get node stats
"org.opensearch.client" % "opensearch-java" % "2.6.0" % "test"
exclude ("com.fasterxml.jackson.core", "jackson-databind")),
exclude("com.fasterxml.jackson.core", "jackson-databind")),
libraryDependencies ++= deps(sparkVersion),
Test / fullClasspath ++= Seq((flintSparkIntegration / assembly).value, (pplSparkIntegration / assembly).value,
// Adding assembled jars to the classpath
Test / fullClasspath ++= Seq(
(flintSparkIntegration / assembly).value,
(pplSparkIntegration / assembly).value,
(sparkSqlApplication / assembly).value
))
),
// Make sure integration tests do not run during the normal test phase
Test / test := (),
IntegrationTest / test := (IntegrationTest / test).dependsOn(Compile / compile).value
)
.dependsOn(flintCommons % "test->test", flintSparkIntegration % "test->test", pplSparkIntegration % "test->test", sparkSqlApplication % "test->test")

lazy val standaloneCosmetic = project
.settings(
Expand Down

0 comments on commit 95f78ea

Please sign in to comment.