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

Improve verify_clean_boot() #5671

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented Sep 5, 2024

Additional Context

See commit messages for details.

verify_clean_boot()

  • add support for deprecated calls
  • verify cloud-init status return code

Also add verify_clean_boot() alongside each verify_clean_log() call.

Test Steps

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 added a commit to holmanb/cloud-init that referenced this pull request Sep 5, 2024
Also verify that cloud-init status has a valid return code.
holmanb added a commit to holmanb/cloud-init that referenced this pull request Sep 5, 2024
Also verify that cloud-init status has a valid return code.
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

One inline call needs to be updated along with a future suggestion, but otherwise LGTM.

tests/integration_tests/modules/test_ansible.py Outdated Show resolved Hide resolved
@@ -70,16 +71,20 @@ def test_clean_log(self, class_client: IntegrationInstance):
version_boundary = get_feature_flag_value(
class_client, "DEPRECATION_INFO_BOUNDARY"
)
boundary_message = "Deprecated cloud-config provided:"
Copy link
Member

Choose a reason for hiding this comment

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

This feels overly cumbersome for the caller and feels slightly worse than what we had before. Ideally, we'd have some function like verify_schema_deprecations(version="22.2", messages=[...]). That could probably be folded into verify_clean_boot(), but it makes more sense as a separate function to me. I don't think it's a blocker for this PR, but I think there's still more work that can be done here.

Copy link
Member Author

@holmanb holmanb Sep 9, 2024

Choose a reason for hiding this comment

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

Agreed. This pattern repeats itself a couple of times in tests and I'd love to make testing this easier.

That could probably be folded into verify_clean_boot(), but it makes more sense as a separate function to me.

+1 - Trying to pack that functionality into verify_clean_boot()'s signature would make the signature too messy and take on more scope than I'd like it to. In cases like this it would be cleaner / simpler to verify_clean_boot(ignore_deprecations=True) and then use a helper like you suggest.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's a blocker for this PR, but I think there's still more work that can be done here.

Agreed, this is is a rough edge that I'd love to make more ergonomic. I might try to tackle that in a follow-up PR sometime soon.

holmanb added a commit to holmanb/cloud-init that referenced this pull request Sep 9, 2024
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM!

@holmanb holmanb merged commit 313390f into canonical:main Sep 9, 2024
21 checks passed
holmanb added a commit that referenced this pull request Sep 9, 2024
Also verify that cloud-init status has a valid return code.
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.

2 participants