Skip to content

ci(coverage): adding mandatory 80% level of coverage for diff (#239)#288

Open
guzmud wants to merge 3 commits into
mainfrom
ci/239-minimum-coverage-for-new-code
Open

ci(coverage): adding mandatory 80% level of coverage for diff (#239)#288
guzmud wants to merge 3 commits into
mainfrom
ci/239-minimum-coverage-for-new-code

Conversation

@guzmud

@guzmud guzmud commented Jun 12, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Adding mandatory 80% level of coverage for diff
  • Adding export and upload of junit.xml
  • More details regarding quality control in CONTRIBUTING.md

Testing Instructions

  1. Run the CI pipeline

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Copilot AI review requested due to automatic review settings June 12, 2026 09:57
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
131 2 129 0
View the top 2 failed test(s) by shortest run time
test.daemons.test_base_daemon.TestBaseDaemon::test_when_no_callback_daemon_cant_start
Stack Traces | 0.002s run time
self = <test.daemons.test_base_daemon.TestBaseDaemon testMethod=test_when_no_callback_daemon_cant_start>

    def test_when_no_callback_daemon_cant_start(self):
        daemon, mock_setup, mock_start_loop, _ = create_mock_daemon()
    
        with self.assertRaises(OpenAEVError):
>           daemon.start()

test/daemons/test_base_daemon.py:68: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pyoaev/daemons/base_daemon.py:109: in start
    args = parser.parse_args()
           ^^^^^^^^^^^^^^^^^^^
........./usr/lib/python3.12/argparse.py:1911: in parse_args
    self.error(msg % ' '.join(argv))
........./usr/lib/python3.12/argparse.py:2677: in error
    self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def exit(self, status=0, message=None):
        if message:
            self._print_message(message, _sys.stderr)
>       _sys.exit(status)
E       SystemExit: 2

........./usr/lib/python3.12/argparse.py:2664: SystemExit
test.daemons.test_base_daemon.TestBaseDaemon::test_when_callback_daemon_can_start
Stack Traces | 0.004s run time
self = <test.daemons.test_base_daemon.TestBaseDaemon testMethod=test_when_callback_daemon_can_start>

    def test_when_callback_daemon_can_start(self):
        daemon, mock_setup, mock_start_loop, _ = create_mock_daemon(lambda: None)
    
>       daemon.start()

test/daemons/test_base_daemon.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pyoaev/daemons/base_daemon.py:109: in start
    args = parser.parse_args()
           ^^^^^^^^^^^^^^^^^^^
........./usr/lib/python3.12/argparse.py:1911: in parse_args
    self.error(msg % ' '.join(argv))
........./usr/lib/python3.12/argparse.py:2677: in error
    self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ArgumentParser(prog='__main__.py', usage=None, description='parse daemon options', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
status = 2
message = '__main__.py: error: unrecognized arguments: --junitxml=junit.xml\n'

    def exit(self, status=0, message=None):
        if message:
            self._print_message(message, _sys.stderr)
>       _sys.exit(status)
E       SystemExit: 2

........./usr/lib/python3.12/argparse.py:2664: SystemExit

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@guzmud guzmud changed the title Ci/239 minimum coverage for new code ci(coverage): adding mandatory 80% level of coverage for diff (#239) Jun 12, 2026
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces Codecov configuration and CI workflow updates to enforce a minimum coverage threshold on new/changed code, publish test results, and document the project’s quality gates for contributors.

Changes:

  • Add codecov.yml to enforce a patch (diff) coverage target of 80%.
  • Update the coverage GitHub Actions workflow to generate junit.xml and upload test results to Codecov.
  • Document CI quality checks and add junit.xml to .gitignore.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
CONTRIBUTING.md Documents CI code-quality and coverage expectations for contributors.
codecov.yml Configures Codecov status checks (project informational, patch target 80%).
.gitignore Ignores generated junit.xml.
.github/workflows/coverage.yml Generates JUnit XML output and uploads coverage/test results to Codecov.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread codecov.yml
comment:
layout: "diff, files, condensed_footer"
hide_project_coverage: true # set to true
require_changes: "coverage_drop AND uncovered_patch"
Comment on lines +49 to +52
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
Comment thread CONTRIBUTING.md
Comment on lines +24 to +28
In order to maintain a certain standard regarding code quality, this repository CI will run various tools against expectations:
- `isort` will be used to check for proper imports sorting, and the CI will fail if the checks fail
- `black` will be used to check for proper code formatting, and the CI will fail if the checks fail
- `flake8` will be used to check for proper code styling, and the CI will fail if the checks fail
- `pytest` will be used to run various levels of testing, and the CI will fail if the tests fail
Comment thread CONTRIBUTING.md
- `black` will be used to check for proper code formatting, and the CI will fail if the checks fail
- `flake8` will be used to check for proper code styling, and the CI will fail if the checks fail
- `pytest` will be used to run various levels of testing, and the CI will fail if the tests fail
- `coverage` with `codecov` will be used to check for proper code coverage, and the CI will fail if the level is below 80% for the current diff (a warning will be emitted if the level falls below 80% for the overall project)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: ensure minimum coverage level for new code

3 participants