Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix in files locating for Bugfix validate check #46368

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 11 additions & 3 deletions tests/ci/functional_test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import csv
import logging
import os
import re
import subprocess
import sys
import atexit
Expand Down Expand Up @@ -111,17 +112,24 @@ def get_run_command(


def get_tests_to_run(pr_info):
result = set([])
result = set()

if pr_info.changed_files is None:
return []

for fpath in pr_info.changed_files:
if "tests/queries/0_stateless/0" in fpath:
logging.info("File %s changed and seems like stateless test", fpath)
if re.match(r"tests/queries/0_stateless/[0-9]{5}", fpath):
logging.info("File '%s' is changed and seems like a test", fpath)
fname = fpath.split("/")[3]
fname_without_ext = os.path.splitext(fname)[0]
# add '.' to the end of the test name not to run all tests with the same prefix
# e.g. we changed '00001_some_name.reference'
# and we have ['00001_some_name.sh', '00001_some_name_2.sql']
# so we want to run only '00001_some_name.sh'
result.add(fname_without_ext + ".")
elif "tests/queries/" in fpath:
# log suspicious changes from tests/ for debugging in case of any problems
logging.info("File '%s' is changed, but it doesn't look like a test", fpath)
return list(result)


Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ci-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ def run_flaky_check(self, repo_path, build_path, should_fail=False):

tests_to_run = get_changed_tests_to_run(pr_info, repo_path)
if not tests_to_run:
logging.info("No tests to run found")
logging.info("No integration tests to run found")
return "success", NO_CHANGES_MSG, [(NO_CHANGES_MSG, "OK")], ""

self._install_clickhouse(build_path)
Expand Down