From b883d516a1aef7ccd812db41cc7eaedf5de65009 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 3 Oct 2021 21:50:49 +0200 Subject: [PATCH] yolo: When checking runtime warnings in level 7, ignore stuff happening during upgrades from previous versions --- lib/analyze_test_results.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/analyze_test_results.py b/lib/analyze_test_results.py index 20851f6..3b2f25c 100644 --- a/lib/analyze_test_results.py +++ b/lib/analyze_test_results.py @@ -151,10 +151,13 @@ def level_7(tests): """ linter_tests = [t for t in tests if t["test_type"] == "PACKAGE_LINTER"] - too_many_warnings = any(t["results"].get("too_many_warnings") for t in tests) - unsafe_install_dir_perms = any(t["results"].get("install_dir_permissions") for t in tests) - alias_traversal = any(t["results"].get("alias_traversal") for t in tests) - witness = any(t["results"].get("witness") for t in tests) + + # For runtime warnings, ignore stuff happening during upgrades from previous versions + tests_on_which_to_check_for_runtime_warnings = [t for t in tests if not (t["test_type"] == "TEST_UPGRADE" and t["test_arg"])] + too_many_warnings = any(t["results"].get("too_many_warnings") for t in tests_on_which_to_check_for_runtime_warnings) + unsafe_install_dir_perms = any(t["results"].get("install_dir_permissions") for t in tests_on_which_to_check_for_runtime_warnings) + alias_traversal = any(t["results"].get("alias_traversal") for t in tests_on_which_to_check_for_runtime_warnings) + witness = any(t["results"].get("witness") for t in tests_on_which_to_check_for_runtime_warnings) return all(t["results"]["main_result"] == "success" for t in tests) \ and linter_tests != [] \