-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add integration test for #868 #901
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Ensure no Traceback when 'chef_license' is set""" | ||
| import pytest | ||
| from tests.integration_tests.instances import IntegrationInstance | ||
|
|
||
|
|
||
| USERDATA = """\ | ||
| #cloud-config | ||
| chef: | ||
| install_type: omnibus | ||
| chef_license: accept | ||
| server_url: https://chef.yourorg.invalid | ||
| validation_name: some-validator | ||
| """ | ||
|
|
||
|
|
||
| @pytest.mark.user_data(USERDATA) | ||
| def test_chef_license(client: IntegrationInstance): | ||
| log = client.read_from_file('/var/log/cloud-init.log') | ||
| assert 'Traceback' not in log | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are there any concerns about this being in an integration test? This causes chef to install from
https://www.chef.io/chef/install.shThere 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.
I like this test because it tests a realworld application/use-case all the way to the source.
All good to have the remote script source. I don't mind this for two reasons:
Are there other concerns you had in mind?
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.
Just from a "good steward" point of view, but I can't image our jenkins runs would be more than a blip compared to the number of hits it receives.
Only reason I thought of it was because we have an older cloud test for chef that is disabled because it relies on a 3rd party repo. https://github.com/canonical/cloud-init/blob/master/tests/cloud_tests/testcases/examples/install_run_chef_recipes.yaml#L4
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.
I'm okay with us keeping this for now. That commit where we disabled was pointing to https://bugs.launchpad.net/cloud-init/+bug/1678145 which was basically a "don't let things on the internet break us when they change". If this ends up breaking repeatedly and causing maintenance problems, We can spend time to remedy/cache it or something else.