mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	tests: Clean up test-js-with-node output on success.
This commit is contained in:
		@@ -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")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user