Skip to content

Commit

Permalink
Publish coverage information also from envsitedir
Browse files Browse the repository at this point in the history
This is needed because otherwise we do not publish the
coverage information of the unit tests, but only those
coming from the aliBuild commands.
  • Loading branch information
ktf committed Oct 17, 2023
1 parent 3d5e0a4 commit 083e829
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions alibuild_helpers/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class SpecError(Exception):

asList = lambda x : x if type(x) == list else [x]

# This function is only needed to check the coverage of the testsuite
# is really happening and we did not made a mistake in tox.ini
def check_coverage():
return True

def resolve_store_path(architecture, spec_hash):
"""Return the path where a tarball with the given hash is to be stored.
Expand Down
7 changes: 7 additions & 0 deletions tests/test_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import unittest
from alibuild_helpers.utilities import check_coverage

class FooTest(unittest.TestCase):
def test_foo(self):
self.assertTrue(check_coverage())

6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,13 @@ commands =
coverage run --source={toxinidir} -a {toxinidir}/aliBuild init zlib
touch zlib/foo
coverage run --source={toxinidir} -a {toxinidir}/aliBuild -a {env:ARCHITECTURE} --no-system --disable GCC-Toolchain build zlib
coverage run --source={envsitepackagesdir} -a -m unittest discover {toxinidir}/tests

[coverage:run]
branch = True
omit =
*/.tox/*/lib/*
include =
*/alibuild*/*
*/.tox/*/lib/*/alibuild_helpers/*

[coverage:report]
exclude_lines =
Expand Down

0 comments on commit 083e829

Please sign in to comment.