From 3b99376829c583636a97b54a4a3dde1cea994e88 Mon Sep 17 00:00:00 2001 From: Tomoyuki MORITA Date: Wed, 13 Nov 2024 11:31:43 -0800 Subject: [PATCH] Enable HTML test report (#897) * Enable HTML test report Signed-off-by: Tomoyuki Morita * Extend heap memory Signed-off-by: Tomoyuki Morita * Try extending memory for subproject Signed-off-by: Tomoyuki Morita * Use env variable to extend heap size Signed-off-by: Tomoyuki Morita * Add comment Signed-off-by: Tomoyuki Morita * Scope library dependency to test Signed-off-by: Tomoyuki Morita --------- Signed-off-by: Tomoyuki Morita --- .github/workflows/test-and-build-workflow.yml | 11 +++++++++++ build.sbt | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index f8d9bd682..e3b2b20f4 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -25,5 +25,16 @@ jobs: - name: Style check run: sbt scalafmtCheckAll + - name: Set SBT_OPTS + # Needed to extend the JVM memory size to avoid OutOfMemoryError for HTML test report + run: echo "SBT_OPTS=-Xmx2G" >> $GITHUB_ENV + - name: Integ Test run: sbt integtest/integration + + - name: Upload test report + if: always() # Ensures the artifact is saved even if tests fail + uses: actions/upload-artifact@v3 + with: + name: test-reports + path: target/test-reports # Adjust this path if necessary \ No newline at end of file diff --git a/build.sbt b/build.sbt index 7a0492a17..131fb2347 100644 --- a/build.sbt +++ b/build.sbt @@ -82,7 +82,11 @@ lazy val commonSettings = Seq( compileScalastyle := (Compile / scalastyle).toTask("").value, Compile / compile := ((Compile / compile) dependsOn compileScalastyle).value, testScalastyle := (Test / scalastyle).toTask("").value, + // Enable HTML report and output to separate folder per package + Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-h", s"target/test-reports/${name.value}"), Test / test := ((Test / test) dependsOn testScalastyle).value, + // Needed for HTML report + libraryDependencies += "com.vladsch.flexmark" % "flexmark-all" % "0.64.8" % "test", dependencyOverrides ++= Seq( "com.fasterxml.jackson.core" % "jackson-core" % jacksonVersion, "com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion