-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Refactor doctest #30210
Refactor doctest #30210
Conversation
148d4f4
to
6628163
Compare
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
.github/workflows/doctest_job.yml
Outdated
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.
A new workflow file that contain the doctest job definition (logic copied from existing file doctests.yml
.github/workflows/doctests.yml
Outdated
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 the doctest job definition to the new workflow file. Now, this workflow only get the list of files to run doctest and how we run it (using GitHub Actions matrix)
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.
Nothing really changed: previously, we only have one artifact but now we have multiple artifacts. The change here is just to taking into account of this fact to aggregate the information (test results) across multiple reports.
""" | ||
This script is used to get the files against which we will run doc testing. | ||
This uses `tests_fetcher.get_all_doctest_files` then groups the test files by their directory paths. | ||
|
||
The files in `docs/source/en/model_doc` or `docs/source/en/tasks` are **NOT** grouped together with other files in the | ||
same directory: the objective is to run doctest against them in independent GitHub Actions jobs. | ||
|
||
Assume we are under `transformers` root directory: | ||
To get a map (dictionary) between directory (or file) paths and the corresponding files | ||
```bash | ||
python utils/split_doctest_jobs.py | ||
``` | ||
or to get a list of lists of directory (or file) paths | ||
```bash | ||
python utils/split_doctest_jobs.py --only_return_keys --num_splits 4 | ||
``` | ||
(this is used to allow GitHub Actions to generate more than 256 jobs using matrix) | ||
""" |
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.
check here
# change to use "/" as path separator | ||
test_files_to_run = ["/".join(Path(x).parts) for x in test_files_to_run] |
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.
make everything using /
: so it will works on Windows
too
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.
Looks clean! Thanks @ydshieh!
Merge now :-) |
What does this PR do?
Main changes:
docs/source/en/model_doc
ordocs/source/en/tasks
are NOT grouped together with other files in thesame directory: the objective is to run doctest against them in independent GitHub Actions jobs.
A file
doc_test_results
is saved and uploaded as artifact so we can always have a way to check.A (example) run page: see here
A full run page: see here