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 convenience functions to generated p4info code #508

Merged
merged 34 commits into from Feb 28, 2022

Conversation

EmanueleGallone
Copy link
Contributor

@EmanueleGallone EmanueleGallone commented Feb 21, 2022

  • Make consts that define p4constants.go structure private.
  • Build maps and lists of IDs to be able to iterate over p4 constants.
  • Add CI verification step to assert that p4 constants are in sync with p4info file.
  • Add unit test for generator script

* build maps and lists of IDs
@EmanueleGallone EmanueleGallone marked this pull request as draft February 21, 2022 16:05
@EmanueleGallone EmanueleGallone marked this pull request as ready for review February 21, 2022 16:25
pudelkoM
pudelkoM previously approved these changes Feb 23, 2022
Copy link
Member

@pudelkoM pudelkoM left a comment

Choose a reason for hiding this comment

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

LGTM

Generator code could be structured into smaller functions, but until we write tests this will not be a problem.

osinstom
osinstom previously approved these changes Feb 23, 2022
Copy link
Contributor

@osinstom osinstom left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@pudelkoM pudelkoM left a comment

Choose a reason for hiding this comment

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

Actually, since it's not urgent, can we add tests for the generator code?

@EmanueleGallone
Copy link
Contributor Author

EmanueleGallone commented Feb 24, 2022

Actually, since it's not urgent, can we add tests for the generator code?

It's not urgent but this PR is blocking #501. Can I add them in a subsequent PR (#517)?

Edit: Disregard that PR. It requires a major rewriting (generate() is now splitted into several other functions) and doesn't make sense to make these changes in another PR.

@pudelkoM pudelkoM changed the title Improve P4 constant generator Add convenience functions to generated p4info code Feb 28, 2022
@pudelkoM pudelkoM merged commit 384e569 into omec-project:master Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants