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

Can tests cache content? #138

Open
preethit opened this issue Feb 26, 2016 · 2 comments
Open

Can tests cache content? #138

preethit opened this issue Feb 26, 2016 · 2 comments

Comments

@preethit
Copy link

Smash tests retrieve content once from a remote source like docker hub, and then re-use it for multiple tests. Doing a new sync of content for every test case is problematic for a variety of reasons.

@Ichimonji10
Copy link
Contributor

There's at least two options for caching content.

One option is to perform caching on a per-module basis with the setUpModule and tearDownModule functions. In setUpModule, one could create a Pulp repository with the desired content and then clone that repository as needed in individual tests; or, one could download content into memory and upload it to the Pulp server into new repos as needed. One could then perform clean-up in the tearDownModule function.

A second option is to download necessary content to a cache on the host running Pulp Smash, and then upload content to Pulp repositories as needed. This only works if the relevant content type can be uploaded to a Pulp repository. (This isn't the case for Docker v2 repos.) This also requires that all content be downloaded right at the beginning of the test run. A big up-side of this approach is that downloaded content can be re-used between test runs, as you only need to download content into a cache once.

@asmacdo
Copy link
Contributor

asmacdo commented Mar 4, 2016

I think using a setUpModule would help a lot less than setting up a cache. Otherwise, tests inside of a module will depend on each other in a way that is not ideal (and it will be really hard to test deletes in the same module as the rest of CRUD).

In the end, I think that most test modules will need to create a repository more than once. And often this repo will be shared with other modules as well, so the cache would help tremendously even if the setUpModule is able to deduplicate some of that syncing.

@Ichimonji10 Ichimonji10 changed the title pulp smash tests can use caching so that content from remote source can be retrieved once and reused. Can tests cache content? Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants