From aaac88649468337a1fbc67389a55297594226af1 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 24 Jun 2022 10:13:32 -0300 Subject: [PATCH] chore(ci): improve tparse (#527) * chore(ci): improve tparse Signed-off-by: Carlos A Becker * chore(ci): improve tparse Signed-off-by: Carlos A Becker --- .github/workflows/build.yml | 14 ++------------ deprecation/deprecation_test.go | 1 - scripts/test.sh | 11 +++++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100755 scripts/test.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3abba73..63e78a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,13 +37,7 @@ jobs: run: go install github.com/mfridman/tparse@latest - run: task setup - name: test - run: | - task test | tee output.json | tparse -notests -follow -all - tparse -format markdown -file output.json -all > $GITHUB_STEP_SUMMARY - env: - TEST_OPTIONS: "-json" - NO_COLOR: 1 - - run: git diff + run: ./scripts/test.sh test ${{ matrix.os }} - uses: codecov/codecov-action@v3 if: matrix.os == 'ubuntu-latest' with: @@ -81,12 +75,8 @@ jobs: - name: setup-tparse run: go install github.com/mfridman/tparse@latest - name: acceptance - run: | - task acceptance | tee output.json | tparse -notests -follow -all - tparse -format markdown -file output.json -all > $GITHUB_STEP_SUMMARY + run: ./scripts/test.sh acceptance ubuntu-latest env: - TEST_OPTIONS: "-json" - NO_COLOR: 1 TEST_PATTERN: "/${{ matrix.pkgFormat }}/${{ matrix.pkgPlatform }}/" goreleaser: strategy: diff --git a/deprecation/deprecation_test.go b/deprecation/deprecation_test.go index c5b5108..87977e4 100644 --- a/deprecation/deprecation_test.go +++ b/deprecation/deprecation_test.go @@ -8,7 +8,6 @@ import ( ) func TestNotice(t *testing.T) { - Print("before") var b bytes.Buffer Noticer = prefixed{&b} Print("blah\n") diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..d177130 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -o pipefail && TEST_OPTIONS="-json" task $1 | tee output.json | tparse -follow +success=$? + +if [ "$2" = "ubuntu-latest" ]; then + set -e + NO_COLOR=1 tparse -format markdown -slow 10 -file output.json > $GITHUB_STEP_SUMMARY +fi + +exit $success