-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[sonic-yang-models]: fix unit test failure #7436
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thx for fixing this.
seems upgrading to 2.4.0 also resolve the issue. let's use that one. I'll hold on this one. |
Cool, but this is highly recommend to put the search path in pyang command, so I guess we should add -p as well and list the contents of directory in case of failure, it will be easier to debug that way in future. |
it is not quite understood why the unit test suddenly failed as below. but add ietf yang model explicitly to the build process fix the test failure. tests/test_sonic_yang_models.py .F [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree ----------------------------- Captured stderr call ----------------------------- ./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path ./yang-models/sonic-device_metadata.yang:8: error: module "ietf-yang-types" not found in search path Signed-off-by: Guohan Lu <[email protected]>
Upgrading to pyang 2.4.0 did not seem to fix this unit test failure when building for the marvell-armhf platform. As a test I cherry-picked this change from Gouhan's fork and I no longer see the failure. I agree that we should move forward with this PR. |
Agree. |
The breakage is coming from pip version 21.1. https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93 throws an exception with pip 21.1 |
@joyas-joseph I presume you are saying that this problem is related to PR #7450 which is in Draft state. |
With pip21.1, we see the below exception. The code is from pyang2.4.0 - https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93
The same code works with pip 21.0.1.
|
FWIW I have observed that a fresh build of the marvell-armhf platform on the 202012 branch succeeds.
When I cherry-pick this commit from lguohan:pyang I no longer see the unit test failure. |
Would have preferred #7450 over this. |
https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93 throws an exception with pip 21.1 add ietf yang model explicitly to the build process fix the test failure. tests/test_sonic_yang_models.py .F [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree ----------------------------- Captured stderr call ----------------------------- ./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path ./yang-models/sonic-device_metadata.yang:8: error: module "ietf-yang-types" not found in search path Signed-off-by: Guohan Lu <[email protected]>
https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93 throws an exception with pip 21.1 add ietf yang model explicitly to the build process fix the test failure. tests/test_sonic_yang_models.py .F [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree ----------------------------- Captured stderr call ----------------------------- ./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path ./yang-models/sonic-device_metadata.yang:8: error: module "ietf-yang-types" not found in search path Signed-off-by: Guohan Lu <[email protected]>
https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93 throws an exception with pip 21.1 add ietf yang model explicitly to the build process fix the test failure. tests/test_sonic_yang_models.py .F [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree ----------------------------- Captured stderr call ----------------------------- ./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path ./yang-models/sonic-device_metadata.yang:8: error: module "ietf-yang-types" not found in search path Signed-off-by: Guohan Lu <[email protected]>
https://github.com/mbj4668/pyang/blob/master/pyang/repository.py#L93 throws an exception with pip 21.1 add ietf yang model explicitly to the build process fix the test failure. tests/test_sonic_yang_models.py .F [ 66%] tests/yang_model_tests/test_yang_model.py . [100%] Failed: pyang -f tree ./yang-models/*.yang > ./yang-models/sonic_yang_tree ----------------------------- Captured stderr call ----------------------------- ./yang-models/sonic-acl.yang:8: error: module "ietf-inet-types" not found in search path ./yang-models/sonic-device_metadata.yang:8: error: module "ietf-yang-types" not found in search path Signed-off-by: Guohan Lu <[email protected]>
Signed-off-by: Guohan Lu [email protected]
Why I did it
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)