Skip to content

Conversation

@gante
Copy link
Member

@gante gante commented Aug 30, 2024

What does this PR do?

See title :)

This PR addresses two problems:

  • missing return
  • writing empty files

missing return

The filter_tests(tests, module=module) call always returned None, because it is missing a return. This None would then cause the fetcher to fail: https://app.circleci.com/pipelines/github/huggingface/transformers/102546/workflows/5e358605-da6b-4c2f-886f-84c9e455a211/jobs/1365782

With this return, the failing job above no longer happens, and CI runs as expected :) (see this PR)

writing empty files

The test fetcher can write empty files for a given job (e.g. test_preparation/tests_torch_and_tf_test_list.txt). This caused a downstream error because:

  • CircleCI skips uploads of empty files (see here, in Uploading artifacts)
  • We trigger a job when there is a file (before upload)
  • The job tried to download a file that didn't exist, causing a failure in the curl step (see here)

As such, this PR changes our test fetcher to skip writing a test file if the file is empty 🤗 No file -> no job -> no problem

@gante gante requested a review from ArthurZucker August 30, 2024 19:22
@gante
Copy link
Member Author

gante commented Aug 30, 2024

@gante gante changed the title Text fetcher: missing return on filtered tests Test fetcher: missing return on filtered tests Aug 30, 2024
@HuggingFaceDocBuilderDev

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.

@gante gante changed the title Test fetcher: missing return on filtered tests Test fetcher: missing return on filtered tests; don't write empty files Aug 30, 2024
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

thanks! If the test list is empty, we should not even have the job start! I think this was fixed on main by #33220

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Actually saw that this was a different failure

@ArthurZucker ArthurZucker merged commit 746104b into huggingface:main Aug 30, 2024
@gante gante deleted the missing_return branch August 31, 2024 07:59
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
…es (huggingface#33224)

* missing return

* skip files without contents

* test 2

* dbg

* dbg

* how about this?
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.

3 participants