Skip to content

Commit

Permalink
github: backend-test: Add tracing to steps for easy debugging
Browse files Browse the repository at this point in the history
So we can see which of the bash commands in a run block are failing.

Signed-off-by: René Dudfield <renedudfield@microsoft.com>
  • Loading branch information
illume committed Jul 2, 2024
1 parent 61f2412 commit 84697e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
- name: Run tests and calculate code coverage
run: |
set -o x
cd backend
go test ./... -coverprofile=coverage.out -covermode=atomic -coverpkg=./...
testcoverage=$(go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+')
Expand All @@ -58,6 +59,7 @@ jobs:
- name: Get base branch code coverage
if: ${{ github.event_name }} == 'pull_request'
run: |
set -o x
cd backend
base_branch="${{ github.base_ref }}"
testcoverage="${{ env.coverage }}"
Expand All @@ -72,6 +74,7 @@ jobs:
- name: Compare code coverage
if: ${{ github.event_name }} == 'pull_request'
run: |
set -o x
testcoverage="${{ env.coverage }}"
base_coverage="${{ env.base_coverage }}"
if [[ -z $testcoverage || -z $base_coverage ]]; then
Expand All @@ -91,6 +94,7 @@ jobs:
- name: Comment on PR
if: ${{ github.event_name }} == 'pull_request'
run: |
set -o x
testcoverage="${{ env.coverage }}"
base_coverage="${{ env.base_coverage }}"
coverage_diff="${{ env.coverage_diff }}"
Expand Down

0 comments on commit 84697e0

Please sign in to comment.