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

Properly use test_fetcher for examples #13604

Merged
merged 5 commits into from
Sep 16, 2021
Merged

Properly use test_fetcher for examples #13604

merged 5 commits into from
Sep 16, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Sep 16, 2021

What does this PR do?

This PR fixes the test_fetcher util script for examples. It does so by adding the example test file whenever an example file is modified, or if said example file is modified (anything in examples/pytorch).
To avoid this being launched by the other test jobs, the default for the filters arguments is changed to "tests".

An example modification will now run the example test file: on the commit "Fake example modification", the test fetcher for the example script returns:

Master is at 421929b556aedf022a1c4a1f3b2f116b14a7b88a
Current head is at 5ba342cbf98664f5a7a98d6f02b798d78ee523f3
Branching commit: 421929b556aedf022a1c4a1f3b2f116b14a7b88a

### DIFF ###


### MODIFIED FILES ###
- examples/pytorch/language-modeling/run_clm.py
- utils/tests_fetcher.py

### IMPACTED FILES ###
- examples/pytorch/language-modeling/run_clm.py
- utils/tests_fetcher.py

### TEST TO RUN ###
- examples/pytorch/test_examples.py

In practice the examples job is run when any modification triggers any tests (so it's run when there is a real modification in the examples or the source code of transformers). Before this PR, the example modifications were ignored.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@sgugger sgugger merged commit af5c6ae into master Sep 16, 2021
@sgugger sgugger deleted the test_fetcher_examples branch September 16, 2021 19:13
Albertobegue pushed a commit to Albertobegue/transformers that referenced this pull request Jan 13, 2022
* Properly use test_fetcher for examples

* Fake example modification

* Fake modeling file modification

* Clean fake modifications

* Run example tests for any modification.
Albertobegue pushed a commit to Albertobegue/transformers that referenced this pull request Jan 27, 2022
* Properly use test_fetcher for examples

* Fake example modification

* Fake modeling file modification

* Clean fake modifications

* Run example tests for any modification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants