Skip to content

Commit 2d7a354

Browse files
committed
make clickhouse-test crossouts optional
1 parent 452d89e commit 2d7a354

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

ci/jobs/functional_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ def start():
354354
)
355355
res = results[-1].is_ok()
356356

357+
runner_options += f" --known-fails-file-path tests/broken_tests.yaml"
358+
357359
test_result = None
358360
if res and JobStages.TEST in stages:
359361
stop_watch_ = Utils.Stopwatch()

tests/clickhouse-test

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ TEST_MAX_RUN_TIME_IN_SECONDS = 180
8888

8989

9090
@lru_cache(maxsize=1)
91-
def get_broken_tests_rules() -> dict:
92-
broken_tests_file_path = "tests/broken_tests.yaml"
91+
def get_broken_tests_rules(broken_tests_file_path: str) -> dict:
9392
if (
9493
not os.path.isfile(broken_tests_file_path)
9594
or os.path.getsize(broken_tests_file_path) == 0
@@ -129,10 +128,10 @@ def get_broken_tests_rules() -> dict:
129128
return compiled_rules
130129

131130

132-
def test_is_known_fail(test_name, test_logs, build_flags):
131+
def test_is_known_fail(test_name, test_logs, build_flags, broken_tests_file_path):
133132
matching_rules = []
134133

135-
known_broken_tests = get_broken_tests_rules()
134+
known_broken_tests = get_broken_tests_rules(broken_tests_file_path)
136135

137136
# print(f"Checking known broken tests for failed test: {test_name}")
138137
# print("Potential matching rules:")
@@ -2321,13 +2320,17 @@ class TestCase:
23212320
if result.status == TestStatus.FAIL:
23222321
result.description = self.add_info_about_settings(result.description)
23232322

2324-
# Check if the test is known to fail
2325-
known_fail_reason = test_is_known_fail(
2326-
self.name, result.description, args.build_flags
2327-
)
2328-
if known_fail_reason:
2329-
result.status = TestStatus.BROKEN
2330-
result.description += f"Marked as broken: {known_fail_reason}"
2323+
if args.known_fails_file_path:
2324+
# Check if the test is known to fail
2325+
known_fail_reason = test_is_known_fail(
2326+
self.name,
2327+
result.description,
2328+
args.build_flags,
2329+
args.known_fails_file_path,
2330+
)
2331+
if known_fail_reason:
2332+
result.status = TestStatus.BROKEN
2333+
result.description += f"Marked as broken: {known_fail_reason}"
23312334

23322335
if self.name in suite.blacklist_check:
23332336
if result.status == TestStatus.OK:
@@ -3818,6 +3821,8 @@ def parse_args():
38183821
parser.add_argument("-q", "--queries", help="Path to queries dir")
38193822
parser.add_argument("--tmp", help="Path to tmp dir")
38203823

3824+
parser.add_argument("--known-fails-file-path", help="Path to known fails file")
3825+
38213826
parser.add_argument(
38223827
"-b",
38233828
"--binary",

0 commit comments

Comments
 (0)