-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Remove utils/documentation_tests.txt
#25680
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
Conversation
| # These are files not doctested yet. | ||
| with open("utils/not_doctested.txt") as fp: | ||
| not_doctested = set(fp.read().strip().split("\n")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to the new get_all_doctest_files above
|
|
||
| # 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 not in not_doctested and x not in slow_documentation_tests] | ||
|
|
||
| # The file `utils/not_doctested.txt` doesn't contain all files that are not doc-tested, so we need more filters. | ||
| # 1. only include files in `src` or `docs/source/en/` | ||
| test_files_to_run = [x for x in test_files_to_run if x.startswith(("src/", "docs/source/en/"))] | ||
| # 2. not include init files | ||
| test_files_to_run = [x for x in test_files_to_run if not x.endswith(("__init__.py",))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
| # only include files in `src` or `docs/source/en/` | ||
| test_files_to_run = [x for x in test_files_to_run if x.startswith(("src/", "docs/source/en/"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have docs/source/es/quicktour.md tested so far with documentation_tests on daily CI. But the logic becomes a bit complex if to deal with language other than en. Let me know your preference.
| - name: Get doctest files | ||
| run: | | ||
| $(python3 -c 'from utils.tests_fetcher import get_all_doctest_files; to_test = get_all_doctest_files(); to_test = " ".join(to_test); fp = open("doc_tests.txt", "w"); fp.write(to_test); fp.close()') | ||
| - name: Run doctests | ||
| run: | | ||
| python3 -m pytest -v --make-reports doc_tests_gpu --doctest-modules $(cat utils/documentation_tests.txt) -sv --doctest-continue-on-failure --doctest-glob="*.md" | ||
| python3 -m pytest -v --make-reports doc_tests_gpu --doctest-modules $(cat doc_tests.txt) -sv --doctest-continue-on-failure --doctest-glob="*.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the new get_all_doctest_files defined below
| return code_diff | ||
|
|
||
|
|
||
| def get_all_doctest_files() -> List[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for daily doctest CI to use
ArthurZucker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool. Hope we won't have surprises in the ci daily
Co-authored-by: Arthur <[email protected]>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
* fix * fix * fix * fix * fix * fix * Apply suggestions from code review Co-authored-by: Arthur <[email protected]> --------- Co-authored-by: ydshieh <[email protected]> Co-authored-by: Arthur <[email protected]>
What does this PR do?
Let's remove
utils/documentation_tests.txtand just keepnot_doctested.txt