coreos / butane

Butane translates human-readable Butane Configs into machine-readable Ignition Configs.
https://coreos.github.io/butane/
Apache License 2.0
255 stars 70 forks source link

tests: verify that report paths are valid #458

Closed bgilbert closed 1 year ago

bgilbert commented 1 year ago

A common mistake is to create ContextPaths that aren't valid references to an item in the config. DebugVerifyCoverage() should catch such paths in a TranslationSet, but validation errors (during either the validation or translation passes) may add paths to a report without a corresponding TranslationSet entry. Add helper functions to validate paths in a report, and use them in every test case.

In particular, call the helpers even in tests that expect empty reports, to reduce the risk that a test created in the future will omit the check.

Fix context paths for forbidden field errors in all versions of the r4e spec.