It is a bit trickier with system roles.  We use https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/test_scripts/runcoveralls.sh which then calls https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/test_scripts/custom_coveralls.py instead of using the `coveralls` command directly.  Not sure why we used a custom python script using the coveralls api, rather than using the `coveralls` command directly.

On Wed, Jul 21, 2021 at 1:40 PM Jiri Kucera <jkucera@redhat.com> wrote:
Hello,

those that are using tox for testing system roles and send the test coverage reports to coveralls.io via coveralls pypi package may struggle with empty code view in coveralls.io web UI (see network role view for example[1]).

Since 3.1.0, coveralls has introduced the --basedir option. This option allows you to strip the base directory from reported paths. To demonstrate it on network role, if coveralls is run with

$ coveralls --basedir=/home/runner/work/network/network

the reported path will be library/network_connections.py, which is the existing path on GitHub[2], so the coveralls.io should be able to display a view showing the lines covered.

Sometimes, sources can be placed inside src/ (or similar) directory. This can be seen in several pure Python packages. To handle these kind of situations, PR with --srcdir option support was opened and merged[3] recently.

This option allow to specify the directory with sources relative to GitHub project so coveralls.io is able to see them.

Regards
Jiri

_______________________________________________
systemroles mailing list -- systemroles@lists.fedorahosted.org
To unsubscribe send an email to systemroles-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/systemroles@lists.fedorahosted.org
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure