From 1be0145d6a045652c075fd5965d1e394cdb17654 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:08:14 +0200 Subject: [PATCH] Skip some slow tests for doctesting in PRs (Circle)CI (#24753) * fix * fix --------- Co-authored-by: ydshieh --- utils/slow_documentation_tests.txt | 1 + utils/tests_fetcher.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 utils/slow_documentation_tests.txt diff --git a/utils/slow_documentation_tests.txt b/utils/slow_documentation_tests.txt new file mode 100644 index 0000000000..680dea094e --- /dev/null +++ b/utils/slow_documentation_tests.txt @@ -0,0 +1 @@ +docs/source/en/task_summary.md diff --git a/utils/tests_fetcher.py b/utils/tests_fetcher.py index 88552a11ca..f5a2904027 100644 --- a/utils/tests_fetcher.py +++ b/utils/tests_fetcher.py @@ -310,10 +310,17 @@ def get_doctest_files(diff_with_last_commit=False): print(f"Parent commit: {commit}") test_files_to_run = get_diff_for_doctesting(repo, repo.head.commit, parent_commits) + # This is the full list of doctest tests with open("utils/documentation_tests.txt") as fp: documentation_tests = set(fp.read().strip().split("\n")) + # Not to run slow doctest tests + with open("utils/slow_documentation_tests.txt") as fp: + slow_documentation_tests = set(fp.read().strip().split("\n")) + # So far we don't have 100% coverage for doctest. This line will be removed once we achieve 100%. - test_files_to_run = [x for x in test_files_to_run if x in documentation_tests] + test_files_to_run = [ + x for x in test_files_to_run if x in documentation_tests and x not in slow_documentation_tests + ] # Make sure we did not end up with a test file that was removed test_files_to_run = [f for f in test_files_to_run if (PATH_TO_REPO / f).exists()]