Skip to content

Commit

Permalink
ci: flag integration tests and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcloughlin committed Jan 10, 2019
1 parent b1f036a commit 61e2c9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ script:
- ./script/coverage
- ./script/lint
after_success:
- bash <(curl -s https://codecov.io/bash) -f all.coverprofile
- bash <(curl -s https://codecov.io/bash) -F unittests -f unittests.coverprofile
- bash <(curl -s https://codecov.io/bash) -F integration -f integration.coverprofile
11 changes: 7 additions & 4 deletions script/coverage
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ ext=".coverprofile"
find . -name '*'${ext} | xargs rm -f

# Unit test coverage.
go test -covermode=count -coverprofile=unit${ext} ./...
go test -covermode=count -coverprofile=unittests${ext} ./...

# Integration test coverage.
find . -name 'asm.go' | while read main; do
coverprofiles=()
for main in $(find . -name 'asm.go'); do
dir=$(dirname ${main})
name=$(basename ${dir})
coverprofile="${dir}/${name}${ext}"
./script/covermain ${main} ${coverprofile} > /dev/null
coverprofiles+=(${coverprofile})
done

covertool merge --output integration${ext} ${coverprofiles[@]}

# Merge.
all="all${ext}"
find . -name '*'${ext} | xargs covertool merge --output ${all}
covertool merge --output all${ext} unit${ext} integration${ext}

0 comments on commit 61e2c9d

Please sign in to comment.