Add --rerun-fails flag for release branches (#21721)

* add re-run flag for release branches

* testing

* testing with the test ref

* fix test branch name

* adding packages flag

* fix package names

* joining package names

* fixing EOF error

* fixing packages syntax

* fix syntax

* fixing syntax

* syntax fix

* fix syntax

* moving flag

* test command

* testing success case

* original changes

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

* Update .github/workflows/test-go.yml

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>

---------

Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
This commit is contained in:
akshya96 2023-07-13 12:49:17 -07:00 committed by GitHub
parent b543d534a7
commit 20675ccef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -239,17 +239,24 @@ jobs:
fi
# shellcheck disable=SC2086 # can't quote package list
# On a release branch, add a flag to rerun failed tests
if [[ ${{ github.base_ref }} = release/* ]] ; then
RERUN_FAILS="--rerun-fails"
fi
GOARCH=${{ inputs.go-arch }} \
go run gotest.tools/gotestsum --format=short-verbose \
--junitfile test-results/go-test/results-${{ matrix.id }}.xml \
--jsonfile test-results/go-test/results-${{ matrix.id }}.json \
--jsonfile-timing-events failure-summary-${{ matrix.id }}${{ inputs.name != '' && '-' || '' }}${{ inputs.name }}.json \
$RERUN_FAILS \
--packages "${{ matrix.packages }}" \
-- \
-tags "${{ inputs.go-tags }}" \
-timeout=${{ env.TIMEOUT_IN_MINUTES }}m \
-parallel=${{ inputs.go-test-parallelism }} \
${{ inputs.extra-flags }} \
${{ matrix.packages }}
- name: Prepare datadog-ci
if: github.repository == 'hashicorp/vault' && (success() || failure())
continue-on-error: true