Skip to content

Commit

Permalink
CI: make things work with coverage.py 5.x
Browse files Browse the repository at this point in the history
It has changed its internal format to sqlite and still doesn't
provide a way to merge runs from different OSes, see
nedbat/coveragepy#903
  • Loading branch information
lazka committed Dec 27, 2019
1 parent 7263d94 commit fb3644c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitlab-ci/coverage-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -e
python -m pip install coverage

# Make the Windows paths match our current layout
python ./.gitlab-ci/fixup-cov-paths.py coverage/.coverage* coverage/*.lcov
python ./.gitlab-ci/fixup-lcov-paths.py coverage/*.lcov
python ./.gitlab-ci/fixup-covpy-paths.py coverage/.coverage*

# Remove external headers (except gi tests)
for path in coverage/*.lcov; do
Expand Down
17 changes: 17 additions & 0 deletions .gitlab-ci/fixup-covpy-paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys
import sqlite3


def main(argv):
paths = argv[1:]

for path in paths:
# https://github.com/nedbat/coveragepy/issues/903
conn = sqlite3.connect(path)
conn.execute("UPDATE file set path = REPLACE(path, '\\', '/')")
conn.commit()
conn.close()


if __name__ == "__main__":
sys.exit(main(sys.argv))
File renamed without changes.
3 changes: 0 additions & 3 deletions .gitlab-ci/test-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ pacman --noconfirm -S --needed \
git \
perl

# https://github.com/Alexpux/MINGW-packages/issues/4333
pacman --noconfirm -S --needed mingw-w64-$MSYS2_ARCH-$PYTHON-pathlib2

# ccache setup
export PATH="$MSYSTEM/lib/ccache/bin:$PATH"
mkdir -p _ccache
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exclude=subprojects

[coverage:run]
branch=True
relative_files=True
include=
gi/*
tests/*
Expand Down

0 comments on commit fb3644c

Please sign in to comment.