Danger: Ensure that Dangerfiles have test coverage
Problem
We've seen an incident in #412442 (closed) where Danger failed due to a bug in Dangerfile
.
Proposed solution
Static analysis
Create a
In a danger/**/Dangerfile
:
# bad
return if helper.ci?
MESSAGE = "Some message"
markdown MESSAGE
# good
# Create and test Danger::MyMessage plugin
my_message.send_message
Runtime
This feels like a maintenancetest-gap.
- Run
danger
with code coverage enabled - Ensure that changed (in this MR)
Dangerfile
s have a code coverage of 100%.
Dangefile
s are covered by specs. This could be achieved by:
- Move all logic from
Dangerfile
stooling/
and add specs. - Add specs to utilize
Dangerfile
files.
Edited by Peter Leitzen