From d46be324e560a66e5940750d8a0e41174cad3c5c Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 15 Apr 2021 00:19:17 -0700 Subject: [PATCH] tests: improve bats/gh integration Signed-off-by: Andrea Luzzardi --- .github/workflows/ci.yml | 8 ++++++++ .gitignore | 1 + tests/helpers.bash | 3 +++ tests/package.json | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e89b65e7..21bad162 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,11 @@ jobs: - name: Integration test run: | make integration + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v2 + if: always() + with: + report_paths: "tests/*.xml" + github_token: ${{ secrets.GITHUB_TOKEN }} + check_name: "Test Report" diff --git a/.gitignore b/.gitignore index 48558707..1244af75 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ # Test binary, build with `go test -c` *.test +tests/report.xml # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/tests/helpers.bash b/tests/helpers.bash index 8d52cd0a..60bfb9e3 100644 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -7,6 +7,9 @@ common_setup() { DAGGER="${DAGGER_BINARY:-$TESTDIR/../cmd/dagger/dagger}" export DAGGER + DAGGER_LOG_FORMAT="pretty" + export DAGGER_LOG_FORMAT + DAGGER_STORE="$(mktemp -d -t dagger-store-XXXXXX)" export DAGGER_STORE } diff --git a/tests/package.json b/tests/package.json index f6177bd6..4af287e6 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,7 +1,7 @@ { "license": "Apache-2.0", "scripts": { - "test": "bats ." + "test": "bats --report-formatter junit ." }, "devDependencies": { "bats": "https://github.com/bats-core/bats-core.git",