ci/circle: speed up tests / coverage

Instead of running the testsuite twice when coverage is need,
only run it once (without filtering out `nocov` tests): with
`cluacov` installed, it's only 50% slower than a normal run.
This commit is contained in:
Benoit Pierre
2024-11-24 23:05:37 +01:00
committed by Frans de Jonge
parent ea5d424868
commit 74c9347bba
3 changed files with 16 additions and 10 deletions

View File

@@ -7,11 +7,9 @@ source "${CI_DIR}/common.sh"
set +e
if [ -z "${CIRCLE_PULL_REQUEST}" ] && [ "${CIRCLE_BRANCH}" = 'master' ]; then
travis_retry make --assume-old=all coverage
pushd install/koreader && {
echo -e "\\n${ANSI_GREEN}Uploading coverage."
cd install/koreader && {
# see https://github.com/codecov/example-lua
bash <(curl -s https://codecov.io/bash)
} && popd || exit
else
echo -e "\\n${ANSI_GREEN}Not on official master branch. Skipping coverage."
}
fi

View File

@@ -4,6 +4,14 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=/dev/null
source "${CI_DIR}/common.sh"
make testfront --assume-old=all T="-o '${PWD}/test-results.xml'"
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ "${CIRCLE_BRANCH}" == 'master' ]]; then
# We're on master: do a full testsuite run with coverage.
target='coverage'
else
# Pull request / not on master: do a regular testsuite run.
target='testfront'
fi
make "${target}" --assume-old=all T="-o '${PWD}/test-results.xml'"
# vim: sw=4

View File

@@ -103,11 +103,11 @@ jobs:
- run:
name: Test
command: .ci/test.sh
# Docs, coverage, and test timing (can we use two outputs at once?); master branch only.
# Upload coverage statistics (master branch only).
- run:
name: Coverage
name: Uploading coverage
command: .ci/after_success.sh
# By storing the test results CircleCI automatically distributes tests based on execution time.
# Store test results for better feedback / insights.
- store_test_results:
path: &TESTS_XML test-results.xml
# CircleCI doesn't make the test results available as artifacts (October 2017).
@@ -129,7 +129,7 @@ jobs:
- run:
name: fetch
command: .ci/fetch.sh
# docs, coverage, and test timing (can we use two outputs at once?); master branch only
# Docs & translations (master branch only).
- run:
name: docs-and-translation
command: .ci/after_success_docs_translation.sh