diff options
author | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-09 11:48:24 +0100 |
---|---|---|
committer | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-09 12:03:09 +0100 |
commit | e0151c7896ddec869430b21c0bcc9c3b0d19240a (patch) | |
tree | 226b284548a20527cba96ac6682e6a7496b4a768 /.circleci | |
parent | 5eadfbedaa21d282226de4133cf13430ba5cdcf6 (diff) |
tests: split coverage into unit and integration "flags"
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 51c49e1..7085b92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -53,32 +53,24 @@ jobs: - run: name: Run coverage for unit tests command: | - for file in ./target/debug/khaleesi-*; do - if test -x $file; then - echo "Running coverage for: $file" + # hack - order by size to assign flags (unit tests are smaller) + flags=( unit integration ); + for file in $(ls --sort=size -r ./target/debug/khaleesi-*); do + if [[ -f "$file" && -x "$file" ]]; then + flag=${flags[0]}; + flags=("${flags[@]:1}"); # shift array by 1 + if [[ -z "$flag" ]]; then + echo "Error, no flag left!"; + break; + fi + echo "Running coverage for: $file, flag $flag"; kcov --verify --include-path $(pwd) --exclude-pattern=tests \ target/coverage/$(basename $file) \ $file --quiet + # -c deletes coverage data after submission + bash <(curl -s https://codecov.io/bash) -c -F $flag; fi done - - run: - name: Upload to Codecov - command: bash <(curl -s https://codecov.io/bash) -c -F unittests - - run: - name: Run coverage for integration tests - command: | - for file in ./target/debug/integration-*; do - if test -x $file; then - echo "Running coverage for: $file" - kcov --verify --include-path $(pwd) --exclude-pattern=tests \ - target/coverage/$(basename $file) \ - $file --quiet - fi - done - - run: - name: Upload to Codecov - command: bash <(curl -s https://codecov.io/bash) -c -F integration - workflows: version: 2 test_all_and_coverage: |