-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add RPM Repository tests #39
Conversation
This PR isn't quite ready for a merge yet. But I'd like to get some early review from @dkliban, or anyone else with expertise with RPM repositories. I've reworked the exact form of these tests pretty heavily from when they were first prototyped, and it'd be good to know if I broke anything. Also, the |
_delete(cls.cfg, attrs['_href']) | ||
|
||
|
||
class SyncFeedTestCase(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be SyncInvalidFeedTestCase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SyncFeedTestCase
and SyncInvalidFeedTestCase
have basically identical set-up procedures. I might as well just combine the two classes. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I'm not sure I really even need any methods from this class except test_status_code
. Calling _poll_tasks()
implicitly ensures that tasks have been spawned.
Add RPM repository tests. Module `pulp_smash.tests.rpm.api_v2.test_repo_create` includes the following test cases: * `CreateTestCase` ensures it is possible to create repositories with and without feeds. * `SyncValidFeedTestCase` and `SyncInvalidFeedTestCase` ensure that Pulp correctly handles sync requests, regardless of whether the feed is valid. * `PublishTestCase` ensures it is possible to upload an RPM file to a repository, copy the repository's contents to a second repository, add a distributor to the first repository, publish the first repository, and download the original RPM. Test results: $ python -m unittest2 pulp_smash.tests.rpm.api_v2.test_sync_publish .............s........ ---------------------------------------------------------------------- Ran 22 tests in 27.118s OK (skipped=1) Many thanks to @dkliban for help with designing these tests.
This test has been updated and is ready for a full review and merge. |
"""Indicates that polling a task timed out.""" | ||
|
||
|
||
def _poll_tasks(server_config, href): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to put this in some place that is shared by other tests? We need to poll tasks for other plugins also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But I'd like to do that in a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several of the other helper functions can also be extracted from this module too.
I started putting comments on everything that I thought could live outside the test. I think it would be perfectly OK to move those methods in a separate commit. This looks good to merge. |
Add RPM repository tests. Module
pulp_smash.tests.rpm.api_v2.test_repo_create
includes the following test cases:
CreateTestCase
ensures it is possible to create repositories with andwithout feeds.
SyncValidFeedTestCase
andSyncInvalidFeedTestCase
ensure that Pulpcorrectly handles sync requests, regardless of whether the feed is valid.
PublishTestCase
ensures it is possible to upload an RPM file to arepository, copy the repository's contents to a second repository, add a
distributor to the first repository, publish the first repository, and
download the original RPM.
Test results:
Many thanks to @dkliban for help with designing these tests.