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.
Description of changes:
This change adds snapshot report functionality.
Before this change, codebases were left with the binary option of enforcing full coverage of requirements or not with the
--ci
flag. This isn't ideal, since it assumes that all of the requirements are covered already. As such, we need something to preserve the expected state of the requirement coverage in time and then assert it matches what we want it to in CI.Codebases wanting to use this functionality would first enable the snapshot reports in their config:
Next, they run
duvet report
. This will write a snapshot file to.duvet/snapshot.txt
. They should check this in to version control to ensure it stays in sync with the codebase.Finally in CI, running
duvet report --ci
will ensure the current state of the requirement coverage matches the snapshot file. If not, an error is returned and the job fails:duvet/integration/snapshots/report-snapshot-out-of-date_stderr.snap
Lines 5 to 33 in 5e0b2b9
The snapshot format is a very simple text format that works well with tools like
git diff
. It consists of the following structure:By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.