tests: do not assert instance.pull_file().ok()#1246
Merged
Conversation
Test pycloudlib's BaseInstance.pull_file doesn't return a Result object. So we can't call ok() on the response in integration tests. Leave the try/except handling as pull_file will raise an IOError if there is an error connecting via paramiko's sftp.get.
TheRealFalcon
approved these changes
Feb 7, 2022
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Test pycloudlib's BaseInstance.pull_file doesn't return a Result
object. So we can't call ok() on the None response in integration tests.
When an integration test failes, this error results in _collect_logs incorrectly reporting that a pull_file has failed
leaving an uncompressed tarfile which was correctly downloaded.
Leave the try/except handling as pull_file will raise an
IOError if there is an error connecting via paramiko's sftp.get.
Proposed Commit Message
Additional Context
Test Steps
Run the following failing test locally on main and notice that the generated logs in /tmp/cloud_init_test_logs/ are still compressed and that we receive an ERROR logged to the console incorrectly saying
2022-02-04 21:47:56 ERROR integration_testing:conftest.py:212 Failed to pull logs: 'NoneType' object has no attribute 'ok'Checklist: