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

test: allow downgrades when install debs #4941

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

TheRealFalcon
Copy link
Member

Proposed Commit Message

test: allow downgrades when install debs

Additional Context

noble cloud-init has a pre-release of 24.1. Running bddeb has a 23.4+ release number until we release. Without the flag we can't apt install a deb on noble.

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@a-dubs
Copy link
Collaborator

a-dubs commented Feb 22, 2024

I assume the change from "".format() to an f-string was just a stylistic change? Are f-strings preferred over "".format()? Or is it situational? Just curious for future use!

@a-dubs
Copy link
Collaborator

a-dubs commented Feb 22, 2024

Also did you test out the change locally to ensure that this worked as expected? Just checking since there's no mention of test procedure in the PR description.

@TheRealFalcon
Copy link
Member Author

I assume the change from "".format() to an f-string was just a stylistic change? Are f-strings preferred over "".format()? Or is it situational? Just curious for future use!

Not official project policy, but yes, I will switch to f-strings when I can. They're faster, easier to read, and generally the preferred way to do string interpolation. Some linters will flag any other method as an issue.

Also did you test out the change locally to ensure that this worked as expected? Just checking since there's no mention of test procedure in the PR description.

Yeah. It roughly looks like:

DEB_BUILD_OPTIONS=nocheck packages/bddeb -d
CLOUD_INIT_OS_IMAGE=noble CLOUD_INIT_CLOUD_INIT_SOURCE=cloud-init_all.deb pytest <any_integration_test>

Without this change the apt install of the deb will fail.

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that we want this regardless of the current state of Noble releases vs local builds. If I tell integration tests to validate a given deb, I want to force it- upgrade or downgrade.
Validated the failure/retries of any integration test locally on apt install. And success across this changeset

make deb
CLOUD_INIT_OS_IMAGE=noble CLOUD_INIT_CLOUD_INIT_SOURCE=cloud-init_all.deb .tox/integration-tests/bin/pytest tests/integration_tests/test_paths.py

@TheRealFalcon TheRealFalcon merged commit 89ebcc3 into canonical:main Feb 22, 2024
29 checks passed
@TheRealFalcon TheRealFalcon deleted the allow-downgrades branch February 22, 2024 21:16
holmanb pushed a commit to holmanb/cloud-init that referenced this pull request Mar 5, 2024
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.

3 participants