Remove coverage measurement.

This commit is contained in:
Jussi Pakkanen
2025-06-17 19:27:19 +03:00
parent c3ea9753e3
commit 7f908d909e
14 changed files with 17 additions and 211 deletions

11
.github/codecov.yml vendored
View File

@@ -1,11 +0,0 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
comment: false
github_checks:
annotations: false

View File

@@ -87,7 +87,7 @@ jobs:
- name: Run pip
run: |
export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
python3 -m pip --disable-pip-version-check install gcovr fastjsonschema pefile pytest pytest-subtests pytest-xdist coverage
python3 -m pip --disable-pip-version-check install gcovr fastjsonschema pefile pytest pytest-subtests pytest-xdist
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
- uses: actions/cache/save@v4
@@ -99,7 +99,7 @@ jobs:
- name: Run tests
run: |
export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
python3 ./tools/run_with_cov.py run_tests.py --backend=ninja
python3 ./run_tests.py --backend=ninja
env:
# Cygwin's static boost installation is broken (some static library
# variants such as boost_thread are not present)
@@ -112,17 +112,3 @@ jobs:
path: meson-test-run.*
# test log should be saved on failure
if: ${{ !cancelled() }}
- name: Aggregate coverage reports
run: |
export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
./ci/combine_cov.sh
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "${{ matrix.NAME }}"
fail_ci_if_error: false
verbose: true

View File

@@ -53,7 +53,7 @@ jobs:
with:
python-version: '3.x'
# Pin mypy to version 1.8, so we retain the ability to lint for Python 3.7
- run: python -m pip install "mypy==1.8" coverage strictyaml types-PyYAML types-tqdm types-chevron
- run: python -m pip install "mypy==1.8" strictyaml types-PyYAML types-tqdm types-chevron
- run: python run_mypy.py --allver
env:
PYTHONUNBUFFERED: 1

View File

@@ -35,7 +35,7 @@ jobs:
- run: |
export PATH="$HOME/Library/Python/3.9/bin:$PATH"
/usr/bin/python3 -m pip install --upgrade pip
/usr/bin/python3 -m pip install pytest pytest-xdist pytest-subtests fastjsonschema coverage
/usr/bin/python3 -m pip install pytest pytest-xdist pytest-subtests fastjsonschema
- run: brew install pkg-config ninja llvm qt@5
- env:
CPPFLAGS: "-I/opt/homebrew/include"
@@ -48,20 +48,7 @@ jobs:
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
export PATH="$HOME/Library/Python/3.9/bin:$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:$PATH"
export PKG_CONFIG_PATH="/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/pkgconfig:/opt/homebrew/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH"
/usr/bin/python3 ./tools/run_with_cov.py ./run_unittests.py
- name: Aggregate coverage reports
run: |
export PATH="$HOME/Library/Python/3.9/bin:$PATH"
./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "appleclang [unit tests]"
fail_ci_if_error: false
verbose: true
/usr/bin/python3 ./run_unittests.py
project-tests-appleclang:
@@ -98,7 +85,7 @@ jobs:
# https://github.com/actions/setup-python/issues/58
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc zstd ncurses objfw libomp
- run: |
python3 -m pip install cython coverage
python3 -m pip install cython
- env:
CPPFLAGS: "-I/opt/homebrew/include"
LDFLAGS: "-L/opt/homebrew/lib"
@@ -112,18 +99,7 @@ jobs:
# We need this to avoid objfw test failures.
export PATH="$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/ncurses/bin:$PATH:/opt/homebrew/opt/llvm/bin"
export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig:/opt/homebrew/opt/lapack/lib/pkgconfig:/opt/homebrew/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH"
./tools/run_with_cov.py ./run_project_tests.py --backend=ninja
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "appleclang [project tests; unity=${{ matrix.unity }}]"
fail_ci_if_error: false
verbose: true
./run_project_tests.py --backend=ninja
Qt4macos:
# This job only works on Intel Macs, because OpenSSL 1.0 doesn't build on

View File

@@ -90,7 +90,7 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip --disable-pip-version-check install gcovr pefile pytest pytest-subtests pytest-xdist coverage
python3 -m pip --disable-pip-version-check install gcovr pefile pytest pytest-subtests pytest-xdist
- name: Install pypy3 on x86_64
run: |
@@ -125,20 +125,9 @@ jobs:
pacman --noconfirm --needed -S mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.MSYS2_CURSES }}
fi
MSYSTEM= python3 ./tools/run_with_cov.py run_tests.py --backend=ninja
MSYSTEM= python3 ./run_tests.py --backend=ninja
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.NAME }}
path: meson-test-run.*
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "${{ matrix.NAME }}"
fail_ci_if_error: false
verbose: true

View File

@@ -36,21 +36,9 @@ jobs:
- run: |
apt-get -y purge clang gcc gdc
apt-get -y autoremove
python3 -m pip install coverage
- uses: actions/checkout@v4
- name: Run tests
run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./tools/run_with_cov.py ./run_tests.py $CI_ARGS --cross ubuntu-armhf.json --cross-only'
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "Ubuntu nonnative"
fail_ci_if_error: false
verbose: true
run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./run_tests.py $CI_ARGS --cross ubuntu-armhf.json --cross-only'
cross-cuda:
runs-on: ubuntu-latest

View File

@@ -72,18 +72,7 @@ jobs:
source /ci/env_vars.sh
cd $GITHUB_WORKSPACE
./tools/run_with_cov.py ./run_tests.py $CI_ARGS
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "OS Comp [${{ matrix.cfg.name }}]"
fail_ci_if_error: false
verbose: true
./run_tests.py $CI_ARGS
pypy:
name: 'Arch / PyPy'
@@ -172,15 +161,4 @@ jobs:
update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
./tools/run_with_cov.py ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "Ubuntu [${{ matrix.cfg.CC }} ${{ matrix.cfg.RUN_TESTS_ARGS }} ${{ matrix.cfg.MESON_ARGS }}]"
fail_ci_if_error: false
verbose: true
./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS

View File

@@ -52,22 +52,10 @@ jobs:
run: |
sudo apt update -yq
sudo apt install -yq --no-install-recommends g++ gfortran ninja-build gobjc gobjc++
python -m pip install coverage
- run: ./tools/run_with_cov.py run_project_tests.py --only cmake common fortran platform-linux "objective c" "objective c++"
- run: ./run_project_tests.py --only cmake common fortran platform-linux "objective c" "objective c++"
env:
MESON_CI_JOBNAME: linux-ubuntu-gcc-werror
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "UnusedMissingReturn"
fail_ci_if_error: false
verbose: true
windows:
runs-on: windows-latest
steps:
@@ -76,23 +64,11 @@ jobs:
with:
python-version: '3.x'
- run: pip install ninja pefile coverage
- run: pip install ninja pefile
- run: python ./tools/run_with_cov.py run_project_tests.py --only platform-windows
- run: python ./run_project_tests.py --only platform-windows
env:
CC: gcc
CXX: g++
FC: gfortran
MESON_CI_JOBNAME: msys2-gcc-werror
- name: Aggregate coverage reports
run: ./ci/combine_cov.sh
shell: C:\msys64\usr\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: .coverage/coverage.xml
name: "UnusedMissingReturn Windows"
fail_ci_if_error: false
verbose: true

View File

@@ -114,8 +114,3 @@ jobs:
filePath: .\ci\run.ps1
env:
MESON_CI_JOBNAME: azure-$(System.JobName)
- task: PowerShell@2
displayName: Gathering coverage report
inputs:
targetType: 'filePath'
filePath: .\ci\coverage.ps1

View File

@@ -1,10 +0,0 @@
#!/bin/bash
echo "Combining coverage reports..."
coverage combine
echo "Generating XML report..."
coverage xml
echo "Printing report"
coverage report

View File

@@ -1,14 +0,0 @@
echo ""
echo ""
echo "=== Gathering coverage report ==="
echo ""
python3 -m coverage combine
python3 -m coverage xml
python3 -m coverage report
# Currently codecov.py does not handle Azure, use this fork of a fork to get it
# working without requiring a token
git clone https://github.com/mensinda/codecov-python
python3 -m pip install --ignore-installed ./codecov-python
python3 -m codecov -f .coverage/coverage.xml -n "VS$env:compiler $env:arch $env:backend" -c $env:SOURCE_VERSION

View File

@@ -92,7 +92,7 @@ python --version
# Needed for running unit tests in parallel.
echo ""
python -m pip --disable-pip-version-check install --upgrade pefile pytest-xdist pytest-subtests fastjsonschema coverage
python -m pip --disable-pip-version-check install --upgrade pefile pytest-xdist pytest-subtests fastjsonschema
# Needed for running the Cython tests
python -m pip --disable-pip-version-check install cython
@@ -102,6 +102,6 @@ echo "=== Start running tests ==="
# Starting from VS2019 Powershell(?) will fail the test run
# if it prints anything to stderr. Python's test runner
# does that by default so we need to forward it.
cmd /c "python 2>&1 ./tools/run_with_cov.py run_tests.py --backend $env:backend $env:extraargs"
cmd /c "python 2>&1 run_tests.py --backend $env:backend $env:extraargs"
exit $LastExitCode

View File

@@ -1,5 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 The Meson development team
import coverage
coverage.process_startup()

View File

@@ -1,42 +0,0 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 The Meson development team
import subprocess
import coverage
import os
import sys
from pathlib import Path
root_path = Path(__file__).parent.parent.absolute()
# Python magic so we can import mesonlib
sys.path.append(root_path.as_posix())
from mesonbuild import mesonlib
def generate_coveragerc() -> Path:
i_file = (root_path / 'data' / '.coveragerc.in')
o_file = (root_path / '.coveragerc')
raw = i_file.read_text(encoding='utf-8')
raw = raw.replace('@ROOT@', root_path.as_posix())
o_file.write_text(raw, encoding='utf-8')
return o_file
def main() -> int:
# Remove old run data
out_dir = root_path / '.coverage'
mesonlib.windows_proof_rmtree(out_dir.as_posix())
out_dir.mkdir(parents=True, exist_ok=True)
# Setup coverage
python_path = (root_path / 'ci').as_posix()
os.environ['PYTHONPATH'] = os.pathsep.join([python_path, os.environ.get('PYTHONPATH', '')])
os.environ['COVERAGE_PROCESS_START'] = generate_coveragerc().as_posix()
coverage.process_startup()
# Run the actual command
cmd = mesonlib.python_command + sys.argv[1:]
return subprocess.run(cmd, env=os.environ.copy()).returncode
if __name__ == '__main__':
raise SystemExit(main())