-
Notifications
You must be signed in to change notification settings - Fork 116
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
Adding mirror true check for rpm/file plugin #42
Conversation
a362065
to
779425a
Compare
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.
test_multiple_plugins.py
is a general name, it is not explicit which kind of test is being done on that module. I suggest renaming to
test_sync_multiple_plugins.py
or
test_sync_from_multiple_plugins.py
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
==========================================
+ Coverage 65.63% 65.73% +0.09%
==========================================
Files 65 65
Lines 3009 3009
==========================================
+ Hits 1975 1978 +3
+ Misses 1034 1031 -3
Continue to review full report at Codecov.
|
Hi @rochacbruno , Have made those changes. Let me know if this is fine. Thanks! |
# Step 2 | ||
rpm_remote_body = gen_remote(url=RPM_UNSIGNED_FIXTURE_URL) | ||
rpm_remote = self.client.post(RPM_REMOTE_PATH, rpm_remote_body) | ||
self.addCleanup(self.client.delete, rpm_remote['_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.
Not required, just a suggestion, I would avoid unnecessary memory allocation here.
Instead of
rpm_remote_body = gen_remote(url=RPM_UNSIGNED_FIXTURE_URL)
rpm_remote = self.client.post(RPM_REMOTE_PATH, rpm_remote_body)
I would do
rpm_remote = self.client.post(
RPM_REMOTE_PATH,
gen_remote(url=RPM_UNSIGNED_FIXTURE_URL)
)
Because that _body
variable is used just in one place.
rpm_remote = self.client.post(RPM_REMOTE_PATH, rpm_remote_body) | ||
self.addCleanup(self.client.delete, rpm_remote['_href']) | ||
|
||
file_remote_body = gen_remote(url=FILE_FIXTURE_MANIFEST_URL) |
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.
same suggestion
FWIW, |
@@ -65,3 +65,30 @@ | |||
|
|||
FILE2_URL = urljoin(FILE2_FIXTURE_URL, '1.iso') | |||
"""The URL to an ISO file at :data:`FILE2_FIXTURE_URL`.""" | |||
|
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.
Depending on how many future tests will use the RPM plugin from Pulpcore, it might be worth re-evaluating the general strategy being used with the constants, e.g. import them directly from the plugin instead of having independent copies. There's benefits and drawbacks either way but now that a second plugin is being added to these tests it's a good thing to think about.
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.
@dralley +1 for importing the existing constants from plugins. I already did that on Pulp-Certguard test case.
Reason: If constant change on the other plugin it changes/break here.
Long term plans
In long-term we need to re-evaluate all the way Pulp-Smash deals with constants, my suggestion will be to get rid of API and URL paths in constants.
Create some more O.O based approach to have pulp instances and fixtures urls available from pulp-smash across all the plugins tests.
example:
from pulp_smash.entities import Repository, Remote
from pulp_smash.fixtures import Fixture
repo = Repository()
repo.sync(remote=Remote(url=Fixture.FIXTURE_NAME))
On the above example all the classes on .entities
already knows its own endpoints no need to pass in constant located urls.
And the Fixtures
is not a class, it is a runtime generated ENUM
containing entries for each of the pulp-fixtures URLS.
Borderline cases will still need constants, but that should be the minimum.
This effort is tracked on pulp/pulp-smash#1182 and probably will be a Pulp3 only.
cls.client = api.Client(cls.cfg, api.json_handler) | ||
cls.travis = 'TRAVIS' in os.environ | ||
|
||
@skip_if(bool, 'travis', True) |
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.
What happens if I run the functional test suite locally but I don't have the rpm plugin installed? Seems like we should skipping this test on the basis of whether rpm is installed.
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.
Hi @kersommoura @rochacbruno, Are we skipping any tests in any of the plugins depending on the availability of the plugin itself. Else, any idea on how to implement this. I guess this functionality should be implemented in pulp-smash.
Please, Let me know you'r comments.
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.
@ragabala, yes.
See:
def set_up_module(): |
We can add another function to verify the RPM plugin as well.
149036b
to
a1f9715
Compare
Hi Team, The above issues have been addressed. |
Looks like you have some flake8 errors. Also, can you remove the Travis-specific bits now that you are checking for the RPM plugin? Other than that, LGTM. |
This commit will test cross plugin scenario. If the user syncs multiple plugin contents into the same repo with the option mirror=True, the existing content should be overwritten. closes pulp#4448
Thank you @ragabala! 🎉👯♂️👍 |
This commit will test cross plugin scenario. If the user syncs multiple
plugin contents into the same repo with the option mirror=True, the
existing content should be overwritten.
Closes #4448
Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/en/3.0/nightly/contributing/pull-request-walkthrough.html