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

tests: Fix wsl test file mocks, set defaults for optional os-release fields #5008

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented Mar 5, 2024

Proposed Commit Message

tests: Fix wsl test

Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes GH-5002

Additional Context

Fixes GH-5002

Test Steps

Comment out VERSION_ID in the host system's os-release file, run

tox -e py3 -- tests/unittests/test_ds_identify.py::TestWSL

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>)

@holmanb
Copy link
Member Author

holmanb commented Mar 5, 2024

Requesting review from @rvandegrift and @CarlosNihelton.

Copy link
Contributor

@CarlosNihelton CarlosNihelton left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

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.

Ship it

tools/ds-identify Outdated Show resolved Hide resolved
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.

Found a bug here with previous code. ds-identify should have been matching "${ID}-${VERSION_ID}.user-data"

@holmanb holmanb requested a review from blackboxsw March 6, 2024 03:36
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.

Thanks @holmanb I added a diff suggestion unit test changes and a fallback to VERSION_CODENAME to help with debian /etc/os-release on trixie. let me know what you think

@holmanb holmanb force-pushed the holmanb/fix-ds-identify-wsl branch from 0687670 to 3e5c785 Compare March 6, 2024 05:21
@holmanb
Copy link
Member Author

holmanb commented Mar 6, 2024

I added a diff suggestion unit test changes and a fallback to VERSION_CODENAME to help with debian /etc/os-release on trixie. let me know what you think

Looks good, that works for me!

@holmanb holmanb requested a review from blackboxsw March 6, 2024 05:22
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.

LGTM!

@rvandegrift
Copy link

@holmanb thanks, works for me

@holmanb
Copy link
Member Author

holmanb commented Mar 6, 2024

Thanks for the reviews @rvandegrift @blackboxsw @CarlosNihelton!

@holmanb holmanb merged commit 538412a into canonical:main Mar 6, 2024
29 checks passed
holmanb added a commit to holmanb/cloud-init that referenced this pull request Mar 9, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes canonicalGH-5002
holmanb added a commit to holmanb/cloud-init that referenced this pull request Mar 9, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes canonicalGH-5002
holmanb added a commit to holmanb/cloud-init that referenced this pull request Mar 9, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes canonicalGH-5002
@holmanb holmanb mentioned this pull request Mar 9, 2024
1 task
catmsred pushed a commit to catmsred/cloud-init that referenced this pull request Mar 11, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes canonicalGH-5002
holmanb added a commit that referenced this pull request Mar 11, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes GH-5002
holmanb added a commit to holmanb/cloud-init that referenced this pull request Mar 12, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes canonicalGH-5002
holmanb added a commit that referenced this pull request Mar 12, 2024
Force ds-identify to use the correct file mocks
Set defaults for optional os-release fields [1]

VERSION_ID and ID might not be set; set defaults.

[1] man 5 os-release

Fixes GH-5002
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.

two faliing WSL tests in 24.1
4 participants