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

Create base for using generated code in unit tests. #841

Merged
merged 3 commits into from
May 25, 2023

Conversation

wenovus
Copy link
Collaborator

@wenovus wenovus commented May 25, 2023

Just have one unit test use it for now. Converting is very tedious since
it requires all tests to move to a _test package to avoid circular
dependency and there are a bunch of test variables shared between exported
and unexported functions' unit tests.

wenovus added 2 commits May 24, 2023 17:26
…se it

Ideally we generate this instead of handcrafting/copying it as it is
subject to change and we want to be able to catch that.

However the problem is because the generated code imports from ygot, it
creates a circular dependency. There might be a way to address it but it
should be made in a separate PR. This PR works around this by having a
handcrafted copy that doesn't import from ygot.

Later I will take a look at whether it's possible to move those ygot
definitions to a base package and doing an alias.
Just have one unit test use it for now. Converting is very tedious since
it requires all tests to move to a `_test` package to avoid circular
dependency.
@coveralls
Copy link

coveralls commented May 25, 2023

Coverage Status

Coverage: 89.982%. Remained the same when pulling e1762f5 on gencode-to-testutil into 9e21f82 on master.

@wenovus wenovus requested a review from DanG100 May 25, 2023 01:47
@wenovus wenovus merged commit 5994119 into master May 25, 2023
@wenovus wenovus deleted the gencode-to-testutil branch May 25, 2023 17:57
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