From 46b6cf6cd123fbf2d3fd56afd771f3676ee7b3ec Mon Sep 17 00:00:00 2001 From: Jamie B <53781962+JamieB-gu@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:28:38 +0000 Subject: [PATCH] Add test summary to CI Updated our test config to output test summary files. Added a step to the `build` workflow in GitHub actions to read from these files and output a summary in the GitHub UI. --- .github/workflows/build.yml | 6 ++++++ .gitignore | 1 + project/ProjectSettings.scala | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0668a2e5e7df..3ec4a2059e49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,12 @@ jobs: -DAPP_SECRET="fake_secret" \ -Duser.timezone=Australia/Sydney \ -jar ./bin/sbt-launch.jar clean compile assets scalafmtCheckAll test Universal/packageBin + + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "test-results/**/TEST-*.xml" + if: always() - uses: guardian/actions-riff-raff@v4 env: diff --git a/.gitignore b/.gitignore index 6fbf8f6de5cd..725f9848c0dc 100644 --- a/.gitignore +++ b/.gitignore @@ -94,3 +94,4 @@ static/src/stylesheets/pasteup/.npmrc metals.sbt .java-version +test-results/ diff --git a/project/ProjectSettings.scala b/project/ProjectSettings.scala index f40137aa9a31..f906b47f73db 100644 --- a/project/ProjectSettings.scala +++ b/project/ProjectSettings.scala @@ -55,8 +55,7 @@ object ProjectSettings { def testStage = if (isCi) "DEVINFRA" else "LOCALTEST" val frontendTestSettings = Seq( - // Use ScalaTest https://groups.google.com/d/topic/play-framework/rZBfNoGtC0M/discussion - Test / testOptions := Nil, + Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", s"test-results/scala-${scalaVersion.value}", "-o"), concurrentRestrictions in Global := List(Tags.limit(Tags.Test, 4)), // Copy unit test resources https://groups.google.com/d/topic/play-framework/XD3X6R-s5Mc/discussion Test / unmanagedClasspath += (baseDirectory map { bd => Attributed.blank(bd / "test") }).value,