Run code coverage no matter if tests failed or succeeded.

pull/4217/head
Adele Zhou 9 years ago
parent 73081d1582
commit 803af15b58
  1. 9
      tools/run_tests/run_tests.py

@ -862,6 +862,7 @@ def _build_and_run(
port_server_port = 32767 port_server_port = 32767
_start_port_server(port_server_port) _start_port_server(port_server_port)
resultset = None resultset = None
num_test_failures = 0
try: try:
infinite_runs = runs_per_test == 0 infinite_runs = runs_per_test == 0
one_run = set( one_run = set(
@ -885,7 +886,7 @@ def _build_and_run(
else itertools.repeat(massaged_one_run, runs_per_test)) else itertools.repeat(massaged_one_run, runs_per_test))
all_runs = itertools.chain.from_iterable(runs_sequence) all_runs = itertools.chain.from_iterable(runs_sequence)
number_failures, resultset = jobset.run( num_test_failures, resultset = jobset.run(
all_runs, check_cancelled, newline_on_success=newline_on_success, all_runs, check_cancelled, newline_on_success=newline_on_success,
travis=args.travis, infinite_runs=infinite_runs, maxjobs=args.jobs, travis=args.travis, infinite_runs=infinite_runs, maxjobs=args.jobs,
stop_on_failure=args.stop_on_failure, stop_on_failure=args.stop_on_failure,
@ -902,8 +903,6 @@ def _build_and_run(
do_newline=True) do_newline=True)
else: else:
jobset.message('PASSED', k, do_newline=True) jobset.message('PASSED', k, do_newline=True)
if number_failures:
return 2
finally: finally:
for antagonist in antagonists: for antagonist in antagonists:
antagonist.kill() antagonist.kill()
@ -913,8 +912,8 @@ def _build_and_run(
number_failures, _ = jobset.run( number_failures, _ = jobset.run(
post_tests_steps, maxjobs=1, stop_on_failure=True, post_tests_steps, maxjobs=1, stop_on_failure=True,
newline_on_success=newline_on_success, travis=args.travis) newline_on_success=newline_on_success, travis=args.travis)
if number_failures: if num_test_failures or number_failures:
return 3 return 2
if cache: cache.save() if cache: cache.save()

Loading…
Cancel
Save