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

Change test fsp for another repo and better teardown #162

Merged
merged 2 commits into from
Aug 24, 2023

Conversation

gduperrey
Copy link
Contributor

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.

Copy link
Contributor

@ydirson ydirson left a 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"

Comment on lines -100 to +102
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/'
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Member

@stormi stormi Aug 24, 2023

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.

Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Member

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.

@gduperrey gduperrey force-pushed the gdy-correct-tests-fsp branch 2 times, most recently from 1d6db78 to dfe0e86 Compare August 24, 2023 13:33
We changed the test for fsp to use repo on repo.vates.tech.

Signed-off-by: Gael Duperrey <[email protected]>
Previous implementation would leave a repo file on the server when yum
install failed during setup.

Signed-off-by: Gael Duperrey <[email protected]>
@stormi stormi merged commit a11e67b into master Aug 24, 2023
4 checks passed
@stormi stormi deleted the gdy-correct-tests-fsp branch August 24, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants