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

[cleanup] Unique constants in tests + env variable for inference tests #2855

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Feb 13, 2025

In this PR:

  • Adds an autouse function-scoped fixture that overwrites the default HF_HOME with a temporary directory for each single test => all tests are made independent + it won't mess-up with local cache at all anymore. Let's check it doesn't break anything in CI.
  • Sets the tokens for inference tests to HF_INFERENCE_TEST_TOKEN instead of HF_TOKEN. The problem of HF_TOKEN is that it is overwritten in pyproject.toml to "", making it ineffective. To update VCR tests locally, one has to manually edit pyproject.toml which is annoying.
    • => in practice, VCR tests seem to be skipped in CI because no token is set => this is independent from this PR and @hanouticelina is working on it (right?)
  • Removes deprecated _old_token_path. Used only internally and deprecated since Nov. 2022 Store user token in huggingface home folder #1232

@hanouticelina
Copy link
Contributor

in practice, VCR tests seem to be skipped in CI because no token is set => this is independent from this PR and @hanouticelina is working on it (right?)

yes, i will open the PR in a moment.
PS: I hate VCR 😄

@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.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

looks good, thank you!

@@ -106,9 +106,9 @@
},
}
API_KEY_ENV_VARIABLES = {
Copy link
Contributor

Choose a reason for hiding this comment

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

in #2858, I removed completely API_KEY_ENV_VARIABLES to use HF_INFERENCE_TEST_TOKEN for all providers.
There are also other tests using HF_TOKEN, I updated them to use HF_INFERENCE_TEST_TOKEN instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice!

@Wauplin Wauplin merged commit 0c1e566 into main Feb 13, 2025
17 checks passed
@Wauplin Wauplin deleted the cleanup-some-tests branch February 13, 2025 16:41
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