mirror of https://github.com/zulip/zulip.git
node tests: Fix bug with zero-coverage case.
If a file that had 100% coverage somehow regressed to 0% coverage, we would report an error to the console, but we weren't treating it as an actual failure. We've probably always had this bug, but it probably rarely was an issue, since devs might have seen the error locally, or hopefully whatever crazy thing you did to totally remove coverage would have had other symptoms. If this was intentional, I suspect it might have had something to do with wanting to get coverage reports when you just run individual tests. But a while back we changed it so that when you run individual tests, we don't do the line coverage enforcement.
This commit is contained in:
parent
2ff41bf9e5
commit
fe48ede9cf
|
@ -195,6 +195,7 @@ def enforce_proper_coverage(coverage_json: Any) -> bool:
|
|||
for relative_path in enforce_fully_covered:
|
||||
path = ROOT_DIR + "/" + relative_path
|
||||
if not (path in coverage_json):
|
||||
coverage_lost = True
|
||||
print("ERROR: %s has no node test coverage" % (relative_path,))
|
||||
continue
|
||||
line_coverage = coverage_json[path]['s']
|
||||
|
|
Loading…
Reference in New Issue