Skip to content

Commit

Permalink
Fix integration coverage (#111)
Browse files Browse the repository at this point in the history
* fix integration coverage

* upload code coverage

* fix formatting

* forgot one
  • Loading branch information
patrick-ogrady authored Mar 22, 2023
1 parent c8307fb commit 04b3545
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/tokenvm-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jobs:
working-directory: ./examples/tokenvm
shell: bash
run: scripts/tests.integration.sh
- name: Archive code coverage results (text)
uses: actions/upload-artifact@v3
with:
name: code-coverage-out
path: ./examples/tokenvm/integration.coverage.out
- name: Archive code coverage results (html)
uses: actions/upload-artifact@v3
with:
name: code-coverage-html
path: ./examples/tokenvm/integration.coverage.html
- name: Run e2e tests
working-directory: ./examples/tokenvm
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ dist/
*.pk
tmp-storage-testing
.token-cli*
*.html
14 changes: 11 additions & 3 deletions examples/tokenvm/scripts/tests.integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if ! [[ "$0" =~ scripts/tests.integration.sh ]]; then
exit 255
fi

# remove previous coverage reports
rm -f integration.coverage.out
rm -f integration.coverage.html

# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/ginkgo@v2.0.0-rc2 || true

Expand All @@ -23,9 +27,13 @@ ACK_GINKGO_RC=true ginkgo \
run \
-v \
--fail-fast \
--cover \
--coverpkg github.com/ava-labs/hypersdk/examples/tokenvm/chain,github.com/ava-labs/hypersdk/examples/tokenvm/vm \
-cover \
-covermode=atomic \
-coverpkg=github.com/ava-labs/hypersdk/... \
-coverprofile=integration.coverage.out \
./tests/integration \
-- \
--vms 3 \
--min-price 1

# output generate coverage html
go tool cover -html=integration.coverage.out -o=integration.coverage.html

0 comments on commit 04b3545

Please sign in to comment.