[Core] fix core tests failed under certain profiles #13136
Merged
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.
Description
Make tests of
src/azure-cli-core/azure/cli/core/tests/test_help.pycomplete pass core under different profiles.Currently, jobs like Automation Test running under different profiles didn't run with azure-cli-core module, which is incomplete for our tests and it would fail if running under 2019 and 2017 profiles.
I discovered it with the latest change on azdev Azure/azure-cli-dev-tools#188, and the tests
src/azure-cli-core/azure/cli/core/tests/test_help.py::TestHelpLoadswould fail if running under profile 2019-03-01-hybrid beause of the help entries would behave differently under 2019 and 2017 profiles but the tests are expected to assert everything under every profile.That's why they failed.
Testing Guide
On original branch, switch to other 2019-03-01-hybrid profile:
az cloud update --profile 2019-03-01-hybrid,then run tests with:
pytest -x -v --log-level=WARN src/azure-cli-core/azure/cli/core/tests/test_help.py::TestHelpLoadsthe 4 tests under this test Class should fail.
After checking out my changes,
run it again, the 4 tests should pass.
History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.