Made meta.yaml tests raise parsing errors and enforce accuracy #25729
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors how the meta.yaml files are processed in tests so that we're able to catch errors in loading the metadata (for example parsing errors like the one fixed by GoogleCloudPlatform/magic-modules#16100).
I wasn't sure how much of the logged errors are a contract that TGC's later parsing requires; I tried to keep the output as similar as possible.
I removed the "statistic" approach since at this point we need to expect 100% correctness in meta.yaml files.
Note: There are some metadata issues that will need to be fixed before this can be merged. I'll fix them in a follow-on commit, but for now they can serve to demonstrate that the logic works.
Primarily want review from @zli82016 on this as TGC owner, but cc @ScottSuarez if you want to verify that it all looks correct.
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.
Derived from GoogleCloudPlatform/magic-modules#16102