From f168cd075894fff5ca0065ee94705feb9e15314f Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Fri, 7 Oct 2022 05:36:07 +0300 Subject: [PATCH] Enable Junit reports for Scalatest (#3756) Changelog - enable graphical test results for Scalatest tests like we have for [stdlib tests](https://github.com/enso-org/enso/actions/runs/3180677675/jobs/5184855484) # Important Notes Sometimes the report is created on a different workflow, like [here](https://github.com/enso-org/enso/actions/runs/3196147595/jobs/5217691808). Turned out it is a [known](https://github.com/dorny/test-reporter/issues/67) issue in GitHub Actions https://github.com/orgs/community/discussions/24616 --- .github/workflows/scala-new.yml | 30 +++++++++++++++++++++++++++--- build.sbt | 10 +++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scala-new.yml b/.github/workflows/scala-new.yml index 80c407080055..6aa364c8ae13 100644 --- a/.github/workflows/scala-new.yml +++ b/.github/workflows/scala-new.yml @@ -80,7 +80,15 @@ jobs: if: success() || failure() with: name: Enso Standard Library Tests (linux) - path: ${{ env.ENSO_TEST_JUNIT_DIR }}/**/*.xml + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml + path-replace-backslashes: "true" + reporter: java-junit + - name: Engine test report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Engine Tests (linux) + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*.xml path-replace-backslashes: "true" reporter: java-junit enso-build-cli-ci-gen-job-ci-check-backend-macos: @@ -146,7 +154,15 @@ jobs: if: success() || failure() with: name: Enso Standard Library Tests (macos) - path: ${{ env.ENSO_TEST_JUNIT_DIR }}/**/*.xml + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml + path-replace-backslashes: "true" + reporter: java-junit + - name: Engine test report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Engine Tests (macos) + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*.xml path-replace-backslashes: "true" reporter: java-junit enso-build-cli-ci-gen-job-ci-check-backend-windows: @@ -214,7 +230,15 @@ jobs: if: success() || failure() with: name: Enso Standard Library Tests (windows) - path: ${{ env.ENSO_TEST_JUNIT_DIR }}/**/*.xml + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml + path-replace-backslashes: "true" + reporter: java-junit + - name: Engine test report + uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Engine Tests (windows) + path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*.xml path-replace-backslashes: "true" reporter: java-junit env: diff --git a/build.sbt b/build.sbt index f51e211063c4..742d952233b0 100644 --- a/build.sbt +++ b/build.sbt @@ -210,9 +210,13 @@ ThisBuild / scalacOptions ++= Seq( "-Ywarn-unused:privates" // Warn if a private member is unused. ) -ThisBuild / Test / testOptions += Tests.Argument( - "-oI" -) +ThisBuild / Test / testOptions ++= + Seq(Tests.Argument("-oI")) ++ + sys.env + .get("ENSO_TEST_JUNIT_DIR") + .map { junitDir => + Tests.Argument(TestFrameworks.ScalaTest, "-u", junitDir) + } val jsSettings = Seq( scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) }