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
This commit is contained in:
Dmitry Bushev 2022-10-07 05:36:07 +03:00 committed by GitHub
parent 55f9e96a78
commit f168cd0758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 6 deletions

View File

@ -80,7 +80,15 @@ jobs:
if: success() || failure() if: success() || failure()
with: with:
name: Enso Standard Library Tests (linux) 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" path-replace-backslashes: "true"
reporter: java-junit reporter: java-junit
enso-build-cli-ci-gen-job-ci-check-backend-macos: enso-build-cli-ci-gen-job-ci-check-backend-macos:
@ -146,7 +154,15 @@ jobs:
if: success() || failure() if: success() || failure()
with: with:
name: Enso Standard Library Tests (macos) 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" path-replace-backslashes: "true"
reporter: java-junit reporter: java-junit
enso-build-cli-ci-gen-job-ci-check-backend-windows: enso-build-cli-ci-gen-job-ci-check-backend-windows:
@ -214,7 +230,15 @@ jobs:
if: success() || failure() if: success() || failure()
with: with:
name: Enso Standard Library Tests (windows) 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" path-replace-backslashes: "true"
reporter: java-junit reporter: java-junit
env: env:

View File

@ -210,9 +210,13 @@ ThisBuild / scalacOptions ++= Seq(
"-Ywarn-unused:privates" // Warn if a private member is unused. "-Ywarn-unused:privates" // Warn if a private member is unused.
) )
ThisBuild / Test / testOptions += Tests.Argument( ThisBuild / Test / testOptions ++=
"-oI" Seq(Tests.Argument("-oI")) ++
) sys.env
.get("ENSO_TEST_JUNIT_DIR")
.map { junitDir =>
Tests.Argument(TestFrameworks.ScalaTest, "-u", junitDir)
}
val jsSettings = Seq( val jsSettings = Seq(
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) } scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) }