Skip to content

Enable p4orch unit test for test workflow.#2375

Merged
prsunny merged 4 commits intosonic-net:masterfrom
pins:p4orch_unit_test
Jul 22, 2022
Merged

Enable p4orch unit test for test workflow.#2375
prsunny merged 4 commits intosonic-net:masterfrom
pins:p4orch_unit_test

Conversation

@mint570
Copy link
Contributor

@mint570 mint570 commented Jul 13, 2022

What I did
Enable p4orch unit test for test workflow. This will run the p4orch unit test and sanitizer test. It will also include the p4orch unit test coverage into the swss code coverage.

Why I did it
Today the p4orch unit test does not run. And the coverage data is not included.

How I verified it
Presubmit run.

Details if related

@mint570 mint570 requested a review from prsunny as a code owner July 13, 2022 19:11
@mint570 mint570 force-pushed the p4orch_unit_test branch 5 times, most recently from 7722b9d to d36a171 Compare July 14, 2022 17:55
@mint570 mint570 force-pushed the p4orch_unit_test branch 2 times, most recently from 561edc7 to 18ec850 Compare July 15, 2022 19:03
@prsunny prsunny requested a review from theasianpianist July 15, 2022 20:56
@mint570 mint570 force-pushed the p4orch_unit_test branch 2 times, most recently from 8164f4e to 39dd2f9 Compare July 17, 2022 18:02
mint570 added 3 commits July 17, 2022 11:04
Change-Id: I43e57820c357507bb29e476ed9c7bf7928aa489a
Change-Id: I2b578e40aaec39eea35afafd47bbfb7930efec37
Change-Id: Iad9510e2f1408c0de2ef5f952d1139c0bf1e050b
@mint570 mint570 force-pushed the p4orch_unit_test branch 4 times, most recently from fee8813 to f4ea92a Compare July 18, 2022 04:50
@mint570 mint570 force-pushed the p4orch_unit_test branch from f4ea92a to 47be3d7 Compare July 18, 2022 17:03
@mint570
Copy link
Contributor Author

mint570 commented Jul 19, 2022

@prsunny @theasianpianist
Everything looks good now. This PR is ready for review.

@prsunny
Copy link
Collaborator

prsunny commented Jul 21, 2022

Thanks @mint570 for this PR. Can you please provide a generic PR that can enable code coverage for the unit-tests? Currently that is missing.

@mint570
Copy link
Contributor Author

mint570 commented Jul 22, 2022

Thanks @mint570 for this PR. Can you please provide a generic PR that can enable code coverage for the unit-tests? Currently that is missing.

If the unit test is run in debian build, the code coverage will be included after this PR.
Currently there are some unit tests in tests/mock_tests. Their coverage is included with the p4orch unit tests.
And all unit tests coverage are merged together with the pytest coverage.

We explicitly exclude certain test files in the final report. (They are just unit test codes. This is to stop the coverage complain on unit test codes and fake codes.):
orchagent/p4orch/tests/*
tests/*

@prsunny prsunny merged commit e9984d8 into sonic-net:master Jul 22, 2022
@mint570 mint570 deleted the p4orch_unit_test branch July 22, 2022 16:37
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
* Enable p4orch unit test for test workflow.
* Add unit test coverage into coverage report.
* Remove unit test files from coverage report.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* Enable p4orch unit test for test workflow.
* Add unit test coverage into coverage report.
* Remove unit test files from coverage report.
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.

3 participants