8000 CI disable coverage on Windows to keep CI times reasonable by ogrisel · Pull Request #26052 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

CI disable coverage on Windows to keep CI times reasonable #26052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ jobs:
DISTRIB: 'conda'
LOCK_FILE: ./build_tools/azure/py38_conda_forge_mkl_win-64_conda.lock
CHECK_WARNINGS: 'true'
COVERAGE: 'true'
# The Azure Windows runner is typically much slower than other CI
# runners due to the lack of compiler cache. Running the tests with
# coverage enabled make them run extra slower. Since very few parts of
# code should have windows-specific code branches, it should be enable
# to restrict the code coverage collection to the non-windows runners.
COVERAGE: 'false'
SKLEARN_ENABLE_DEBUG_CYTHON_DIRECTIVES: '1'
SKLEARN_TESTS_GLOBAL_RANDOM_SEED: '7' # non-default seed
3 changes: 2 additions & 1 deletion build_tools/azure/combine_coverage_reports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ activate_environment
# such as pytest-xdist and joblib/loky:
pushd $TEST_DIR
coverage combine --append
coverage xml
popd

# Copy the combined coverage file to the root of the repository:
cp $TEST_DIR/.coverage $BUILD_REPOSITORY_LOCALPATH
cp $TEST_DIR/coverage.xml $BUILD_REPOSITORY_LOCALPATH
13 changes: 8 additions & 5 deletions build_tools/azure/upload_codecov.sh
77E0
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,29 @@ if [[ ! -d "$BUILD_REPOSITORY_LOCALPATH/.git" ]]; then
echo "Could not find the git checkout at $BUILD_REPOSITORY_LOCALPATH"
exit 1
fi

# Check that the combined coverage file exists at the expected location:
if [[ ! -f "$BUILD_REPOSITORY_LOCALPATH/.coverage" ]]; then
echo "Could not find the combined coverage file at $BUILD_REPOSITORY_LOCALPATH/.coverage"
export COVERAGE_XML="$BUILD_REPOSITORY_LOCALPATH/coverage.xml"
if [[ ! -f "$COVERAGE_XML" ]]; then
echo "Could not find the combined coverage file at $COVERAGE_XML"
exit 1
fi

if [[ $OSTYPE == *"linux"* ]]; then
curl -Os "$CODECOV_BASE_URL/linux/codecov"
SHA256SUM="32cb14b5f3aaacd67f4c1ff55d82f037d3cd10c8e7b69c051f27391d2e66e15c codecov"
echo "$SHA256SUM" | shasum -a256 -c
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f .coverage -Z
./codecov -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f coverage.xml -Z
elif [[ $OSTYPE == *"darwin"* ]]; then
curl -Os "$CODECOV_BASE_URL/macos/codecov"
SHA256SUM="4ab0f06f06e9c4d25464f155b0aff36bfc1e8dbcdb19bfffd586beed1269f3af codecov"
echo "$SHA256SUM" | shasum -a256 -c
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f .coverage -Z
./codecov -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f coverage.xml -Z
else
curl -Os "$CODECOV_BASE_URL/windows/codecov.exe"
SHA256SUM="e0cda212aeaebe695509ce8fa2d608760ff70bc932003f544f1ad368ac5450a8 codecov.exe"
echo "$SHA256SUM" | sha256sum -c
./codecov.exe -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f .coverage -Z
./codecov.exe -t ${CODECOV_TOKEN} -R $BUILD_REPOSITORY_LOCALPATH -f coverage.xml -Z
fi
0