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

Add coverage to requirements-dev.txt and enable it at pipeline #164

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NexSabre
Copy link
Contributor

Coverage check at the pipeline, will fail under 28%.

Checking coverage...
python -m coverage report --fail-under=28
Name                            Stmts   Miss  Cover
---------------------------------------------------
src/ptf/__init__.py                27     17    37%
src/ptf/afpacket.py                50     28    44%
src/ptf/base_tests.py              20     20     0%
src/ptf/dataplane.py              488    349    28%
src/ptf/mask.py                    70     24    66%
src/ptf/netutils.py                26     11    58%
src/ptf/packet.py                   9      1    89%
src/ptf/packet_scapy.py           121     23    81%
src/ptf/parse.py                   40     33    18%
src/ptf/pcap_writer.py             24     14    42%
src/ptf/platforms/__init__.py       0      0   100%
src/ptf/platforms/dummy.py          2      2     0%
src/ptf/platforms/eth.py            7      7     0%
src/ptf/platforms/local.py          9      9     0%
src/ptf/platforms/nn.py             6      6     0%
src/ptf/platforms/remote.py         4      4     0%
src/ptf/ptfutils.py                64     41    36%
src/ptf/testutils.py              855    701    18%
src/ptf/thriftutils.py             70     70     0%
---------------------------------------------------
TOTAL                            1892   1360    28%

@NexSabre
Copy link
Contributor Author

NexSabre commented Jan 3, 2022

@saynb @slicking @antoninbas can I please you for review?

.PHONY: coverage-check
coverage-check:
@echo "Checking coverage..."
python -m coverage report --fail-under=28
Copy link
Member

Choose a reason for hiding this comment

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

I know that 28 is the current coverage level, but as it is, it seems to be coming out of nowhere. I believe all code coverage tools have some mechanism to ensure that coverage for a PR hasn't decreased compared to the base branch. Is it possible to use this instead of setting an arbitrary target?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can certainly do that, but for now, it is enough to increase it from time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants