Skip to content

Commit

Permalink
Add test summary to CI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JamieB-gu committed Dec 3, 2024
1 parent d26c066 commit 46b6cf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ static/src/stylesheets/pasteup/.npmrc
metals.sbt

.java-version
test-results/
3 changes: 1 addition & 2 deletions project/ProjectSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 46b6cf6

Please sign in to comment.