Skip to content

Commit

Permalink
Add integration tests for handling unexpected failures
Browse files Browse the repository at this point in the history
# ------------------------ >8 ------------------------
# reviewdog results
  • Loading branch information
haya14busa committed May 31, 2020
1 parent 9565536 commit 3e79cf2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,26 @@ jobs:
cd ./_testdata/ && golint ./... | reviewdog -f=golint -name=golint-pr-review-nofilter -reporter=github-pr-review -filter-mode=nofilter -fail-on-error || EXIT_CODE=$?
test "${EXIT_CODE}" = 1
- name: Unexpected failure (github-pr-review)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \
-reporter=github-pr-review || EXIT_CODE=$?
test "${EXIT_CODE}" = 1
- name: Unexpected failure (github-check)
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \
-reporter=github-check || EXIT_CODE=$?
test "${EXIT_CODE}" = 1
- name: Unexpected failure (local)
run: |
cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \
-reporter=local -diff='git diff master' || EXIT_CODE=$?
test "${EXIT_CODE}" = 1
golangci-lint:
if: github.event_name == 'pull_request'
name: runner / golangci-lint
Expand Down
10 changes: 10 additions & 0 deletions _testdata/reviewdog_error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
runner:
# OK
golint-ok:
cmd: golint ./...
format: golint
level: warning
test-fail:
cmd: 'echo "test failure"; exit 1'
errorformat:
- "%f:%l:%c:%m"

0 comments on commit 3e79cf2

Please sign in to comment.