FieldCoverageMonitor requires that we have at least one item returned, or else it will fail. However there are situations when we accept that a spider return no items, but if items are returned, we want to ensure our field coverage.
In a project that are in production, we have dozens of real estate websites searching for locations in different neighborhoods daily. Some neighborhoods sometimes doesn't return any item in a specific day, but when data is returned we want to ensure that all the fields has the right coverage.
One possible solution (that looks simpler to implement) would be add a new setting called SPIDERMON_FIELD_COVERAGE_SKIP_IF_NO_ITEM (or something similar). If set to True and no item is returned, field coverage will not be checked, otherwise, it will work as it is now.
This is a fork of issue #339 .
FieldCoverageMonitor
requires that we have at least one item returned, or else it will fail. However there are situations when we accept that a spider return no items, but if items are returned, we want to ensure our field coverage.In a project that are in production, we have dozens of real estate websites searching for locations in different neighborhoods daily. Some neighborhoods sometimes doesn't return any item in a specific day, but when data is returned we want to ensure that all the fields has the right coverage.
One possible solution (that looks simpler to implement) would be add a new setting called
SPIDERMON_FIELD_COVERAGE_SKIP_IF_NO_ITEM
(or something similar). If set to True and no item is returned, field coverage will not be checked, otherwise, it will work as it is now.