ci: flag integration tests and unit tests
This commit is contained in:
@@ -9,4 +9,5 @@ script:
|
|||||||
- ./script/coverage
|
- ./script/coverage
|
||||||
- ./script/lint
|
- ./script/lint
|
||||||
after_success:
|
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
|
||||||
|
|||||||
@@ -6,16 +6,19 @@ ext=".coverprofile"
|
|||||||
find . -name '*'${ext} | xargs rm -f
|
find . -name '*'${ext} | xargs rm -f
|
||||||
|
|
||||||
# Unit test coverage.
|
# Unit test coverage.
|
||||||
go test -covermode=count -coverprofile=unit${ext} ./...
|
go test -covermode=count -coverprofile=unittests${ext} ./...
|
||||||
|
|
||||||
# Integration test coverage.
|
# Integration test coverage.
|
||||||
find . -name 'asm.go' | while read main; do
|
coverprofiles=()
|
||||||
|
for main in $(find . -name 'asm.go'); do
|
||||||
dir=$(dirname ${main})
|
dir=$(dirname ${main})
|
||||||
name=$(basename ${dir})
|
name=$(basename ${dir})
|
||||||
coverprofile="${dir}/${name}${ext}"
|
coverprofile="${dir}/${name}${ext}"
|
||||||
./script/covermain ${main} ${coverprofile} > /dev/null
|
./script/covermain ${main} ${coverprofile} > /dev/null
|
||||||
|
coverprofiles+=(${coverprofile})
|
||||||
done
|
done
|
||||||
|
|
||||||
|
covertool merge --output integration${ext} ${coverprofiles[@]}
|
||||||
|
|
||||||
# Merge.
|
# Merge.
|
||||||
all="all${ext}"
|
covertool merge --output all${ext} unit${ext} integration${ext}
|
||||||
find . -name '*'${ext} | xargs covertool merge --output ${all}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user