You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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
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
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.
The text was updated successfully, but these errors were encountered: