Skip to content
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

Fix CI issue with gcov #1823

Merged
merged 30 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b21b6cd
Copy of Eric's fixes
darbyjohnston Jan 16, 2025
6833071
Exclude rapidjson from coverage
darbyjohnston Jan 16, 2025
85a98d8
Try fixing regex
darbyjohnston Jan 16, 2025
1d7ed8f
Try adding lcov exception
darbyjohnston Jan 16, 2025
e58b36f
Try adding lcov exception
darbyjohnston Jan 16, 2025
f5e80fe
Try ignoring the geninfo errors
darbyjohnston Jan 16, 2025
0d0d540
Try ignoring the geninfo errors
darbyjohnston Jan 16, 2025
0bce96f
Try excluding typeRegistry.h from coverage
darbyjohnston Jan 16, 2025
1d527ce
Path fix
darbyjohnston Jan 16, 2025
560dd7f
Path fix
darbyjohnston Jan 16, 2025
cf105a3
Path fix
darbyjohnston Jan 16, 2025
9e3aa8d
Path fix
darbyjohnston Jan 16, 2025
85d861e
Add path
darbyjohnston Jan 16, 2025
3c15128
Add path
darbyjohnston Jan 16, 2025
e228948
Add path
darbyjohnston Jan 16, 2025
202fef3
Add path
darbyjohnston Jan 17, 2025
1e354aa
Add path
darbyjohnston Jan 17, 2025
3e1da11
Add path
darbyjohnston Jan 17, 2025
8f456ba
Add path
darbyjohnston Jan 17, 2025
02e7d13
Remove redundant filtering
darbyjohnston Jan 17, 2025
a30dc74
Debugging
darbyjohnston Jan 17, 2025
a473e02
Add comment
darbyjohnston Jan 17, 2025
aaedcc6
Try no_exception_branch
darbyjohnston Jan 17, 2025
dfed0cf
Add path
darbyjohnston Jan 17, 2025
caa7fbe
Add path
darbyjohnston Jan 17, 2025
887dc4e
Try ignoring errors
darbyjohnston Jan 17, 2025
897f989
Try removing pip install
darbyjohnston Jan 17, 2025
fea49ee
Try adding command line flag
darbyjohnston Jan 17, 2025
71c73e3
Remove outdated comment
darbyjohnston Jan 18, 2025
f9f2739
Remove outdated comment
darbyjohnston Jan 18, 2025
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
12 changes: 4 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ jobs:
if: matrix.os == env.GH_COV_OS && github.actor != env.GH_DEPENDABOT
run: |
cd ${{ env.OTIO_BUILD_DIR }}
lcov --capture -b . --directory . --output-file=coverage.info -q
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory . --output-file=coverage.info -q
cat coverage.info | sed "s/SF:.*src/SF:src/g" > coverage.filtered.info
lcov --remove coverage.filtered.info '*/usr/*' --output-file=coverage.filtered.info -q
lcov --remove coverage.filtered.info '*/deps/*' --output-file=coverage.filtered.info -q
lcov --remove coverage.filtered.info '*/tests/*' --output-file=coverage.filtered.info -q
lcov --list coverage.filtered.info
# \todo Should the Codecov web pages show the results of the C++ or Python tests?
Expand Down Expand Up @@ -98,6 +96,7 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
include:
- { os: ubuntu-latest, shell: bash }
- { os: ubuntu-22.04, shell: bash, python-version: 3.7 }
- { os: macos-latest, shell: bash }
- { os: macos-13, shell: bash }
- { os: windows-latest, shell: pwsh }
Expand All @@ -106,6 +105,7 @@ jobs:
- { os: macos-latest, python-version: 3.7 }
- { os: macos-latest, python-version: 3.8 }
- { os: macos-latest, python-version: 3.9 }
- { os: ubuntu-latest, python-version: 3.7 }

defaults:
run:
Expand All @@ -131,9 +131,6 @@ jobs:
mingw-w64-x86_64-cmake
make
git
- name: Ensure MSYS2 pip is updated
if: matrix.python-version == 'mingw64'
run: curl -sS https://bootstrap.pypa.io/get-pip.py | python
- name: Set up Python ${{ matrix.python-version }}
if: matrix.python-version != 'mingw64'
uses: actions/[email protected]
Expand All @@ -151,8 +148,7 @@ jobs:
run: make ci-prebuild
- name: Build and Install
run: |
# compile and install into virtualenv/virtual machine (verbosely)
pip install .[dev] -v
pip install .[dev] -v --break-system-packages
- name: Run tests w/ python coverage
run: make ci-postbuild
# (only on ubuntu/pyhton3.7)
Expand Down
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# required by RTD
version: 2

sphinx:
# Path to your Sphinx configuration file.
configuration: docs/conf.py

build:
os: "ubuntu-20.04"
tools:
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(OTIO_CXX_COVERAGE AND NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
# Note that we exclude some OTIO files from code coverage since they are
# causing errors like this:
# geninfo: ERROR: mismatched end line for PyInit__opentime at opentime_bindings.cpp:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic -fprofile-exclude-files='/usr/*;src/deps/*'")
# this causes cmake to produce file.gcno instead of file.cpp.gcno
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
message(STATUS "Building C++ with Coverage: ON")
Expand Down
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ ifndef OTIO_CXX_BUILD_TMP_DIR
C++ coverage will not work, because intermediate build products will \
not be found.)
endif
lcov --rc lcov_branch_coverage=1 --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
lcov --rc lcov_branch_coverage=1 --rc no_exception_branch=1 --ignore-errors mismatch --capture -b . --directory ${OTIO_CXX_BUILD_TMP_DIR} \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.info -q
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g"\
cat ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info | sed "s/SF:.*src/SF:src/g" \
> ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '/usr/*' \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
lcov --rc lcov_branch_coverage=1 --remove ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info '*/deps/*' \
--output-file=${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info -q
rm ${OTIO_CXX_BUILD_TMP_DIR}/coverage.info
lcov --list ${OTIO_CXX_BUILD_TMP_DIR}/coverage.filtered.info

Expand Down
14 changes: 10 additions & 4 deletions tests/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ def test_str(self):

self.assertMultiLineEqual(
str(cl),
'Clip("test_clip", MissingReference(\'\', None, None, {}), None, {})'
'Clip("test_clip", '
'MissingReference(\'\', None, None, {}), None, {}, [], [])'
)
self.assertMultiLineEqual(
repr(cl),
'otio.schema.Clip('
"name='test_clip', "
'media_reference={}, '
'source_range=None, '
'metadata={{}}'
'metadata={{}}, '
'effects=[], '
'markers=[]'
')'.format(
repr(cl.media_reference)
)
Expand All @@ -87,7 +90,8 @@ def test_str_with_filepath(self):
self.assertMultiLineEqual(
str(cl),
'Clip('
'"test_clip", ExternalReference("/var/tmp/foo.mov"), None, {}'
'"test_clip", '
'ExternalReference("/var/tmp/foo.mov"), None, {}, [], []'
')'
)
self.assertMultiLineEqual(
Expand All @@ -98,7 +102,9 @@ def test_str_with_filepath(self):
"target_url='/var/tmp/foo.mov'"
"), "
'source_range=None, '
'metadata={}'
'metadata={}, '
'effects=[], '
'markers=[]'
')'
)

Expand Down
Loading