From 3baba354282b6ddf1dc787c25ac90dd03a330ec2 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Fri, 24 Jun 2022 09:47:37 -0300 Subject: [PATCH 1/2] chore(ci): improve tparse Signed-off-by: Carlos A Becker --- .github/workflows/build.yml | 8 +------- scripts/test.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100755 scripts/test.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3abba73e..bb9109bb 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 - uses: codecov/codecov-action@v3 if: matrix.os == 'ubuntu-latest' with: diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000..f15cea03 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -o pipefail && TEST_OPTIONS="-json" task test | tee output.json | tparse -follow +success=$? + +set -e +NO_COLOR=1 tparse -format markdown -slow 10 -file output.json > $GITHUB_STEP_SUMMARY + +exit $success From fc67c9d18172d3074acb675827cd57975762f4fb Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Fri, 24 Jun 2022 09:55:20 -0300 Subject: [PATCH 2/2] chore(ci): improve tparse Signed-off-by: Carlos A Becker --- .github/workflows/build.yml | 8 ++------ deprecation/deprecation_test.go | 1 - scripts/test.sh | 8 +++++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb9109bb..63e78a78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: go install github.com/mfridman/tparse@latest - run: task setup - name: test - run: ./scripts/test.sh + run: ./scripts/test.sh test ${{ matrix.os }} - uses: codecov/codecov-action@v3 if: matrix.os == 'ubuntu-latest' with: @@ -75,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 c5b5108e..87977e4a 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 index f15cea03..d1771308 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,9 +1,11 @@ #!/bin/bash -set -o pipefail && TEST_OPTIONS="-json" task test | tee output.json | tparse -follow +set -o pipefail && TEST_OPTIONS="-json" task $1 | tee output.json | tparse -follow success=$? -set -e -NO_COLOR=1 tparse -format markdown -slow 10 -file output.json > $GITHUB_STEP_SUMMARY +if [ "$2" = "ubuntu-latest" ]; then + set -e + NO_COLOR=1 tparse -format markdown -slow 10 -file output.json > $GITHUB_STEP_SUMMARY +fi exit $success