Skip to content

Commit

Permalink
✅ exclude hack tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Jul 2, 2020
1 parent b5bbd2e commit c7d7cef
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:
- 'cmd/**'

jobs:
coverage:
name: Run tests
test-cmd:
name: Run tests for cmd packages
runs-on: ubuntu-latest
container:
image: vdaas/vald-ci-container:nightly
Expand All @@ -26,6 +26,32 @@ jobs:
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Run tests
- name: Run tests for cmd packages
run: |
make test
make test/cmd
test-internal:
name: Run tests for internal packages
runs-on: ubuntu-latest
container:
image: vdaas/vald-ci-container:nightly
steps:
- name: Check out code.
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Run tests for internal packages
run: |
make test/internal
test-pkg:
name: Run tests for pkg packages
runs-on: ubuntu-latest
container:
image: vdaas/vald-ci-container:nightly
steps:
- name: Check out code.
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Run tests for pkg packages
run: |
make test/pkg
29 changes: 27 additions & 2 deletions Makefile.d/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,34 @@
#

.PHONY: test
## run tests
## run tests for cmd, internal, pkg
test:
go test -json -cover ./... | tparse -top
go test -json -cover ./cmd/... ./internal/... ./pkg/... | tparse -notests

.PHONY: test/cmd
## run tests for cmd
test/cmd:
go test -json -cover ./cmd/... | tparse -pass -notests

.PHONY: test/internal
## run tests for internal
test/internal:
go test -json -cover ./internal/... | tparse -pass -notests

.PHONY: test/pkg
## run tests for pkg
test/pkg:
go test -json -cover ./pkg/... | tparse -pass -notests

.PHONY: test/hack
## run tests for hack
test/hack:
go test -json -cover ./hack/... | tparse -pass -notests

.PHONY: test/all
## run tests for all Go codes
test/all:
go test -json -cover ./... | tparse -notests

.PHONY: coverage
## calculate coverages
Expand Down

0 comments on commit c7d7cef

Please sign in to comment.