Skip to content

Commit

Permalink
Merge pull request #285 from batchcorp/blinktag/code_coverage
Browse files Browse the repository at this point in the history
Adding code coverage
  • Loading branch information
blinktag committed Jun 13, 2022
2 parents 54e2ffd + 91c599c commit 816a73d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/master-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ jobs:
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: Install Code Climate reporter
run: |
sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
sudo chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Master buld tests
run: |
make test
make test/coverage
- name: Upload coverage information
run: |
GIT_BRANCH=master ./cc-test-reporter after-build -p github.com/batchcorp/plumber -r ${{ secrets.CC_TEST_REPORTER_ID }}
functional:
name: Run functional tests
runs-on: ubuntu-latest
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ jobs:
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: Install Code Climate reporter
run: |
sudo curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
sudo chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Test
run: |
make test
make test/coverage
- name: Upload coverage information
run: |
GIT_BRANCH="${GITHUB_HEAD_REF}" ./cc-test-reporter after-build -p github.com/batchcorp/plumber -r ${{ secrets.CC_TEST_REPORTER_ID }}
functional:
name: Run functional tests
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ start-*.sh
.tsdata
data
data/*
c.out
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ testv: GOFLAGS=
testv:
$(GO) test ./... -v

.PHONY: test/coverage
test/coverage: description = Run Go unit tests and output coverage information
test/coverage: GOFLAGS=
test/coverage:
$(GO) test ./... -coverprofile c.out

.PHONY: test/functional
test/functional: description = Run functional tests
test/functional: GOFLAGS=
Expand Down

0 comments on commit 816a73d

Please sign in to comment.