From 0f58f20ad872339eeb145c6c3afa175364d298f5 Mon Sep 17 00:00:00 2001 From: Joshua Pan Date: Sat, 24 Mar 2018 23:53:40 -0700 Subject: [PATCH] tests: Clean up test-js-with-node output on success. --- tools/test-js-with-node | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tools/test-js-with-node b/tools/test-js-with-node index f9899c7c1a..7a7b034fd6 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -150,9 +150,6 @@ if options.coverage and ret == 0: except IOError: print(NODE_COVERAGE_PATH + " doesn't exist. Cannot enforce fully covered files.") raise - print() - print("=============================================================================") - print("Checking enforced fully covered files...") for relative_path in enforce_fully_covered: path = ROOT_DIR + "/" + relative_path if not (path in coverage_json): @@ -163,17 +160,12 @@ if options.coverage and ret == 0: if not check_line_coverage(line_coverage, line_mapping): ret = 1 if ret: + print() print("It looks like your changes lost 100% test coverage in one or more files.") print("Usually, the right fix for this is to add some tests.") print("But also check out the include/exclude lists in `tools/test-js-with-node`.") print("To run this check locally, use `test-js-with-node --coverage`.") - else: - print("Success: All enforced fully covered files still have 100% test coverage!") - 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: @@ -184,15 +176,13 @@ if options.coverage and ret == 0: 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: + if not ok: + print() 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() +print() if ret == 0: if options.coverage: print("View coverage reports at http://127.0.0.1:9991/node-coverage/index.html")