-
Notifications
You must be signed in to change notification settings - Fork 5
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
Change test fsp for another repo and better teardown #162
Conversation
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.
Also, commit says "We con't"
def add_xcpng_repo(self, name): | ||
def add_xcpng_repo(self, name, base_repo='xcp-ng'): | ||
assert base_repo in ['xcp-ng', 'vates'] | ||
base_repo_url = 'http://mirrors.xcp-ng.org/' if base_repo == 'xcp-ng' else 'https://repo.vates.tech/xcp-ng/' |
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.
if we're going to name then, we likely want to avoid that eg. a typo selects the fallback. Suggestion:
base_repo_url = {
'xcp-ng': 'http://mirrors.xcp-ng.org/',
'vates': 'https://repo.vates.tech/xcp-ng/',
}[base_repo]
repo_id
would also be more descriptive than base_repo
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.
There's an assert, so no typo will select the fallback. We can rework the code if/when we add a third component.
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.
Regarding repo_id
, this evokes an identifier for a specific yum repository, to me, so I don't find it more descriptive than base_repo
.
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.
There's an assert, so no typo will select the fallback. We can rework the code if/when we add a third component.
The idiom with assert makes it so that things have to be changed in 2 places; the dict idiom only one single place.
And I think it's much more visual.
Regarding repo_id
repo_nickname
would be more on the point?
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.
repo_nickname would be more on the point?
It's really a "base" something. The thing is repo may have several meanings. Either a location on a mirror for a whole distro, or a specific yum repository such as https://updates.xcp-ng.org/8/8.3/lab/x86_64/
There must be a better name than base_repo
, but here it's just good enough and the other suggestions don't look better to me. Let's keep base_repo
.
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.
There's an assert, so no typo will select the fallback. We can rework the code if/when we add a third component.
The idiom with assert makes it so that things have to be changed in 2 places; the dict idiom only one single place. And I think it's much more visual.
This is true, but if we change it now, we already consume one change so you're back to two. And it's definitely not like we're going to have trouble changing it the way it is now if we need to.
1d6db78
to
dfe0e86
Compare
We changed the test for fsp to use repo on repo.vates.tech. Signed-off-by: Gael Duperrey <[email protected]>
dfe0e86
to
fd3c22d
Compare
Previous implementation would leave a repo file on the server when yum install failed during setup. Signed-off-by: Gael Duperrey <[email protected]>
fd3c22d
to
d4343d9
Compare
We changed the test for fsp to use repo on repo.vates.tech and to have a better teardown when the test failed. We con't want that the repo file stayed on the test server.