Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/github.com/cosmos/co…
Browse files Browse the repository at this point in the history
…smos-sdk-0.50.10
  • Loading branch information
robert-zaremba authored Oct 2, 2024
2 parents 249cb7a + 92c5c48 commit 6f6518a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 31 deletions.
63 changes: 32 additions & 31 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,37 @@ jobs:
- name: Test and Create Coverage Report
if: env.GIT_DIFF
run: |
EXPERIMENTAL=true make test-unit-cover
- uses: codecov/[email protected]
if: env.GIT_DIFF
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
fail_ci_if_error: true
verbose: true
EXPERIMENTAL=true make test-unit
# EXPERIMENTAL=true make test-unit-cover
# - uses: codecov/[email protected]
# if: env.GIT_DIFF
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.txt
# fail_ci_if_error: true
# verbose: true

test-e2e:
# skip the e2e tests when `skip-e2e-test` label is present on pull request
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-e2e-test') }}
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
FILES: |
go.mod
go.sum
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: "1.22"
cache: true
# test-e2e:
# # skip the e2e tests when `skip-e2e-test` label is present on pull request
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-e2e-test') }}
# runs-on: ubuntu-latest
# timeout-minutes: 25
# steps:
# - uses: actions/checkout@v4
# - uses: technote-space/[email protected]
# with:
# PATTERNS: |
# **/**.go
# FILES: |
# go.mod
# go.sum
# - uses: actions/setup-go@v5
# if: env.GIT_DIFF
# with:
# go-version: "1.22"
# cache: true

- name: Test E2E
if: env.GIT_DIFF
run: |
make test-e2e
# - name: Test E2E
# if: env.GIT_DIFF
# run: |
# make test-e2e
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,25 @@ lint-all:
@revive ./...

.PHONY: build run clean setup

###############################################################################
## Tests ##
###############################################################################

TEST_COVERAGE_PROFILE=coverage.txt
TEST_TARGETS := test-unit test-unit-cover test-race
test-unit: ARGS=-timeout=10m -tags='$(UNIT_TEST_TAGS)'
test-unit-cover: ARGS=-timeout=10m -tags='$(UNIT_TEST_TAGS)' -coverprofile=$(TEST_COVERAGE_PROFILE) -covermode=atomic
test-race: ARGS=-timeout=10m -race -tags='$(TEST_RACE_TAGS)'
$(TEST_TARGETS): run-tests

run-tests:
ifneq (,$(shell which tparse 2>/dev/null))
@go test -mod=readonly -json $(ARGS) ./... | tparse
else
@go test -mod=readonly $(ARGS) ./...
endif

cover-html: test-unit-cover
@echo "--> Opening in the browser"
@go tool cover -html=$(TEST_COVERAGE_PROFILE)

0 comments on commit 6f6518a

Please sign in to comment.