tern
tern copied to clipboard
Proposal: Investigate cuelang to validate output documents
Problem Statement Although tests for tern manage to catch issues with analysis, it doesn't validate whether the documents created have the expected content. There isn't much out there that can help with this with regards to python.
Describe the Proposal Take a look at https://cuelang.org/ to validate tern's document contents.
Steps to Implement Proposal Take one of the default documents that we have trouble validating by hand and see if we can write cuelang validation tests for it. Then maintainers can make a decision on whether this is feasible to implement for all the document types we support.
@nishakm A little more insight will be helpful, maybe I can be of some help
@sayantani11 I'm actually not sure how much cue would be able to help with checking if our output documents match our expectations. If you'd like you can try writing something in cuelang to check a default document. To get one of these run:
tern report -i debian:buster -o test_doc.txt
Then write some cue code to check if this line is present:
info: Found 'Debian GNU/Linux 10 (buster)' in /etc/os-release.
You can put your findings in a comment here.