Proposal: custom tests #263
Draft
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.
Currently, we have multiple tests with code paths that are not covered by the provided test cases.
I would like to discuss if we want / need something custom unit tests to cover those code paths to increase our test coverage. As an example, I implemented this for test 6.1.15.
The test checks that for publisher category
translator, thesource_langfield must be filled. The current test cases cover:All of those test cases have a publisher category of
publisher. So an test implementation which does not even read the publisher category would wrongly pass our current test setup and then fail on the first "real" document provided to it which has nosource_langset.This is a trivial example to highlight an ongoing issue in our codebases, similiar issues appear around parsing / failing to parse more complex data structures (and I suspect in other places, too).
These tests can serve as base to discuss this with the CSAF TC, with the long-term goal being that these variants are added to the main repo as test case json files.
Also, ignore the concrete implementation, I just wanted to show my point.