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

Force cache build in automation #907

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

jmartin-tech
Copy link
Collaborator

@jmartin-tech jmartin-tech commented Sep 6, 2024

If no existing cache is found for a test run as would be the case for test automation, request a cache instance. This will cause the cache to build once if any test is run by pytest.

If no existing cache is found for a test run as would be the case
for test automation, request a cache instance. This will cause the
cache to once if any test is run by `pytest`.

Signed-off-by: Jeffrey Martin <[email protected]>
Copy link
Collaborator

@leondz leondz left a comment

Choose a reason for hiding this comment

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

One question re: if this works as intended


# force a local cache file to exist when this top level import is loaded
if not os.path.isfile(_plugins.PluginCache._user_plugin_cache_filename):
_plugins.PluginCache.instance()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this not trigger _plugins.py#L63 ?

    def _load_plugin_cache(self):
        assert os.path.exists(
            self._plugin_cache_filename
        ), f"{self._plugin_cache_filename} is missing or corrupt."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, the _plugin_cache_filename will always exists as part of the repo checkout, this is looking for _user_plugin_cache_filename in the user's cache dir.

Copy link
Collaborator

@erickgalinkin erickgalinkin left a comment

Choose a reason for hiding this comment

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

LGTM

@jmartin-tech jmartin-tech merged commit 87addcb into NVIDIA:main Sep 9, 2024
8 checks passed
@jmartin-tech jmartin-tech deleted the fix/test-use-updated-cache branch September 9, 2024 15:10
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants