-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[yang]Adding a tool for generating documentation based on yang model #11291
Conversation
This pull request introduces 3 alerts when merging c6d0814 into 05f1c6f - view on LGTM.com new alerts:
|
This tool is very helpful to improve the user experience and dev productivity. Love this idea and thanks for the contribution! |
def test_single_table(self): | ||
argument = '-t AUTO_TECHSUPPORT' | ||
output = self.run_script(argument) | ||
self.assertEqual(output, techsupport_table_output) |
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.
If we modify techsupport yang model, this unit test will fail?
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.
Yes. We need to update this test as well.
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.
Maybe we can create some dummy yang models for unit test.
And then we can modify Yang model, and don't need to update this unit test.
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.
Hi @ganglyu ,
I prefer to use any active yang model rather than introducing a dummy for the test. We do have instances of such tests in other repositories where if schema is changed, the UT needs to be updated.
I don't think the yang model I chosen would change quite often. Even if someone changes it and accidentally misses to update UT, it will be caught during build time and build will fail, forcing the user to modify the test.
Related work items: sonic-net#284, sonic-net#288, sonic-net#624, sonic-net#630, sonic-net#640, sonic-net#2164, sonic-net#2206, sonic-net#2207, sonic-net#2233, sonic-net#2234, sonic-net#2238, sonic-net#8857, sonic-net#10034, sonic-net#10519, sonic-net#10685, sonic-net#10711, sonic-net#10987, sonic-net#10990, sonic-net#11047, sonic-net#11070, sonic-net#11117, sonic-net#11186, sonic-net#11207, sonic-net#11213, sonic-net#11215, sonic-net#11220, sonic-net#11221, sonic-net#11257, sonic-net#11291, sonic-net#11298, sonic-net#11301, sonic-net#11326, sonic-net#11333, sonic-net#11335, sonic-net#11341, sonic-net#11344, sonic-net#11347, sonic-net#11359, sonic-net#11366, sonic-net#11368, sonic-net#11370, sonic-net#11372, sonic-net#11375, sonic-net#11385, sonic-net#11386, sonic-net#11394, sonic-net#11397, sonic-net#11401, sonic-net#11402, sonic-net#11403, sonic-net#11405, sonic-net#11414
Why I did it
Added a tool to generate configuration based on yang model
How I did it
Parse the yang model and create documentation based on description field.
How to verify it
Added UT to verify it.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)