forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipe go test -race output into tparse (cosmos#7309)
- Loading branch information
Alessio Treglia
authored
Sep 16, 2020
1 parent
0d2599b
commit d97f32e
Showing
1 changed file
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,18 @@ jobs: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" | ||
|
||
install-tparse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: install tparse | ||
run: | | ||
export GO111MODULE="on" && go get github.com/mfridman/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-tparse-binary | ||
|
||
test-cosmovisor: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -224,8 +236,12 @@ jobs: | |
name: "${{ github.sha }}-aa" | ||
if: "env.GIT_DIFF != ''" | ||
- name: Run tests with race detector | ||
run: cat xaa.txt | xargs go test -mod=readonly -timeout 15m -race -tags='cgo ledger test_ledger_mock' | ||
run: cat xaa.txt | xargs go test -mod=readonly -json -timeout 15m -race -tags='cgo ledger test_ledger_mock' > xaa-race-output.txt | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-aa-race-output" | ||
path: ./xaa-race-output.txt | ||
|
||
test-race-2: | ||
runs-on: ubuntu-latest | ||
|
@@ -245,8 +261,12 @@ jobs: | |
name: "${{ github.sha }}-ab" | ||
if: "env.GIT_DIFF != ''" | ||
- name: Run tests with race detector | ||
run: cat xab.txt | xargs go test -mod=readonly -timeout 15m -race -tags='cgo ledger test_ledger_mock' | ||
run: cat xab.txt | xargs go test -mod=readonly -json -timeout 15m -race -tags='cgo ledger test_ledger_mock' > xab-race-output.txt | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ab-race-output" | ||
path: ./xab-race-output.txt | ||
|
||
test-race-3: | ||
runs-on: ubuntu-latest | ||
|
@@ -266,8 +286,12 @@ jobs: | |
name: "${{ github.sha }}-ac" | ||
if: "env.GIT_DIFF != ''" | ||
- name: Run tests with race detector | ||
run: cat xac.txt | xargs go test -mod=readonly -timeout 15m -race -tags='cgo ledger test_ledger_mock' | ||
run: cat xac.txt | xargs go test -mod=readonly -json -timeout 15m -race -tags='cgo ledger test_ledger_mock' > xac-race-output.txt | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ac-race-output" | ||
path: ./xac-race-output.txt | ||
|
||
test-race-4: | ||
runs-on: ubuntu-latest | ||
|
@@ -287,7 +311,49 @@ jobs: | |
name: "${{ github.sha }}-ad" | ||
if: "env.GIT_DIFF != ''" | ||
- name: Run tests with race detector | ||
run: cat xad.txt | xargs go test -mod=readonly -timeout 15m -race -tags='cgo ledger test_ledger_mock' | ||
run: cat xad.txt | xargs go test -mod=readonly -json -timeout 15m -race -tags='cgo ledger test_ledger_mock' > xad-race-output.txt | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ad-race-output" | ||
path: ./xad-race-output.txt | ||
|
||
race-detector-report: | ||
runs-on: ubuntu-latest | ||
needs: [test-race-1, test-race-2, test-race-3, test-race-4, install-tparse] | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/get-diff-action@v3 | ||
id: git_diff | ||
with: | ||
SUFFIX_FILTER: | | ||
.go | ||
.mod | ||
.sum | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-aa-race-output" | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ab-race-output" | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ac-race-output" | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: "${{ github.sha }}-ad-race-output" | ||
if: "env.GIT_DIFF != ''" | ||
- uses: actions/[email protected] | ||
with: | ||
path: ~/go/bin | ||
key: ${{ runner.os }}-go-tparse-binary | ||
if: "env.GIT_DIFF != ''" | ||
- name: Generate test report (go test -race) | ||
run: cat xa*-race-output.txt | ~/go/bin/tparse | ||
if: "env.GIT_DIFF != ''" | ||
|
||
liveness-test: | ||
|