CI: Flaky check fix failure on deleted tests

This commit is contained in:
Max K 2024-06-22 19:07:30 +02:00
parent 831b574c22
commit c30fcf5783
2 changed files with 7 additions and 2 deletions

View File

@ -122,6 +122,10 @@ def _get_statless_tests_to_run(pr_info: PRInfo) -> List[str]:
for fpath in pr_info.changed_files: for fpath in pr_info.changed_files:
if re.match(r"tests/queries/0_stateless/[0-9]{5}", fpath): if re.match(r"tests/queries/0_stateless/[0-9]{5}", fpath):
path_ = Path(REPO_COPY + "/" + fpath)
if not path_.exists():
logging.info("File '%s' is removed - skip", fpath)
continue
logging.info("File '%s' is changed and seems like a test", fpath) logging.info("File '%s' is changed and seems like a test", fpath)
fname = fpath.split("/")[3] fname = fpath.split("/")[3]
fname_without_ext = os.path.splitext(fname)[0] fname_without_ext = os.path.splitext(fname)[0]

View File

@ -13,7 +13,7 @@ from typing import List, Tuple, Union
import magic import magic
from docker_images_helper import get_docker_image, pull_image from docker_images_helper import get_docker_image, pull_image
from env_helper import IS_CI, REPO_COPY, TEMP_PATH from env_helper import IS_CI, REPO_COPY, TEMP_PATH, GITHUB_EVENT_PATH
from git_helper import GIT_PREFIX, git_runner from git_helper import GIT_PREFIX, git_runner
from pr_info import PRInfo from pr_info import PRInfo
from report import ERROR, FAILURE, SUCCESS, JobReport, TestResults, read_test_results from report import ERROR, FAILURE, SUCCESS, JobReport, TestResults, read_test_results
@ -216,7 +216,8 @@ def main():
status=state, status=state,
start_time=stopwatch.start_time_str, start_time=stopwatch.start_time_str,
duration=stopwatch.duration_seconds, duration=stopwatch.duration_seconds,
additional_files=additional_files, # add GITHUB_EVENT_PATH json file to have it in style check report. sometimes it's needed for debugging.
additional_files=additional_files + [Path(GITHUB_EVENT_PATH)],
).dump() ).dump()
if state in [ERROR, FAILURE]: if state in [ERROR, FAILURE]: