detect unmarked long tests in flaky check

This commit is contained in:
Alexander Kuzmenkov 2021-02-04 15:06:48 +03:00
parent 227698ea1c
commit 858043cd53
4 changed files with 23 additions and 9 deletions

View File

@ -428,15 +428,23 @@ def run_tests_array(all_tests_with_params):
status += print_test_time(total_time) status += print_test_time(total_time)
status += " - result differs with reference:\n{}\n".format(diff) status += " - result differs with reference:\n{}\n".format(diff)
else: else:
passed_total += 1 if args.test_runs > 1 and total_time > 30 and 'long' not in name:
failures_chain = 0 # We're in Flaky Check mode, check the run time as well while we're at it.
status += MSG_OK failures += 1
status += print_test_time(total_time) failures_chain += 1
status += "\n" status += MSG_FAIL
if os.path.exists(stdout_file): status += print_test_time(total_time)
os.remove(stdout_file) status += " - Long test not marked as 'long'"
if os.path.exists(stderr_file): else:
os.remove(stderr_file) passed_total += 1
failures_chain = 0
status += MSG_OK
status += print_test_time(total_time)
status += "\n"
if os.path.exists(stdout_file):
os.remove(stdout_file)
if os.path.exists(stderr_file):
os.remove(stderr_file)
if status and not status.endswith('\n'): if status and not status.endswith('\n'):
status += '\n' status += '\n'

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# remove this comment before merge
set -e set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# remove this comment before merge
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh # shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh . "$CURDIR"/../shell_config.sh

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# remove this comment before merge
set -e set -e
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)