refactor config tests to be in CI and use run_cmd instead of aws#7211
refactor config tests to be in CI and use run_cmd instead of aws#7211dlm6693 merged 2 commits intoaws:developfrom
run_cmd instead of aws#7211Conversation
Moving to functional suite so that they run in GitHub CI. They can be moved because no actual HTTP requests are made using the `configure` command. These tests either silently failed or weren't run at all in a release that allowed a bug to be introduced to customers using the latest version of v1.
| def __init__(self, session, stream=None, error_stream=None): | ||
| super(ConfigureGetCommand, self).__init__(session) | ||
| if stream is None: | ||
| stream = sys.stdout | ||
| if error_stream is None: | ||
| error_stream = sys.stderr |
There was a problem hiding this comment.
This was updated because of the method default variable bug that every python programmer encounters from time to time. Because these defaults are evaluated before runtime, they are not properly mocked out by the test runner. Same issue for list.py.
| section = profile_to_section(profile) | ||
| updated_config = {'__section__': section, varname: value} | ||
| self._config_writer.update_config(updated_config, config_filename) | ||
| return 0 |
There was a problem hiding this comment.
The new test class test_configure inherits from expects a return code for ALL commands.
Codecov Report
@@ Coverage Diff @@
## develop #7211 +/- ##
========================================
Coverage 92.91% 92.91%
========================================
Files 205 205
Lines 16416 16424 +8
========================================
+ Hits 15253 15261 +8
Misses 1163 1163
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
kyleknap
left a comment
There was a problem hiding this comment.
Looks great! Thanks for doing this. I realize this was likely tedious to port. I only had small comments and suggestions on improvements on the previous test content.
* release-1.25.62: Bumping version to 1.25.62 Update changelog based on model updates Add note for Tagged Unions refactor config tests to be in CI and use `run_cmd` instead of `aws` (#7211) Update sidebar AWS logo in refs
…ws#7211) * refactor config tests to be in CI and use `run_cmd` instead of `aws` Moving to functional suite so that they run in GitHub CI. They can be moved because no actual HTTP requests are made using the `configure` command. These tests either silently failed or weren't run at all in a release that allowed a bug to be introduced to customers using the latest version of v1.
…ws#7211) * refactor config tests to be in CI and use `run_cmd` instead of `aws` Moving to functional suite so that they run in GitHub CI. They can be moved because no actual HTTP requests are made using the `configure` command. These tests either silently failed or weren't run at all in a release that allowed a bug to be introduced to customers using the latest version of v1.
This PR moves the tests for the
configurecommand to the functional suite. This was done for a few reasons. First and foremost, these tests silently failed or were not run at all in a recent release of the CLI v1 that allowed a bug to be introduced to customers. Additionally, this command doesn't actually make any HTTP requests over the wire so they can be run in the GitHub CI.These tests were also refactored to use the
run_cmdtest function instead ofaws, which provides a more robust mocking of CLI commands.Some light amount of changes were made to custom
configuresubcommands to comply with the new test suite.