Skip to content

Commit

Permalink
test-js-with-node: Add check for fully covered files that are not enf…
Browse files Browse the repository at this point in the history
…orced.
  • Loading branch information
lonerz authored and showell committed Jun 23, 2017
1 parent c625a80 commit a63fd95
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/test-js-with-node
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,27 @@ if options.coverage and ret == 0:
print("=============================================================================")
print()

print("=============================================================================")
print("Checking for fully covered files that are not enforced yet...")
ok = True
for path in coverage_json:
if '/static/js/' in path:
relative_path = os.path.relpath(path, ROOT_DIR)
line_coverage = coverage_json[path]['s']
line_mapping = coverage_json[path]['statementMap']
if check_line_coverage(line_coverage, line_mapping, log=False) \
and not (relative_path in enforce_fully_covered):
ok = False
print("ERROR: %s has complete node test coverage and is not enforced." % (relative_path,))
if ok:
print("Success: There are no fully covered files that are not enforced yet!")
else:
print("There are one or more fully covered files that are not enforced.")
print("Add the file(s) to enforce_fully_covered in `tools/test-js-with-node`.")
ret = 1
print("=============================================================================")
print()

if ret == 0:
if options.coverage:
print("View coverage reports at http://127.0.0.1:9991/node-coverage/index.html")
Expand Down

0 comments on commit a63fd95

Please sign in to comment.