-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Migrate instrumentation_key to connection_string for spring-cloud extension #3467
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
4 commits
Select commit
Hold shift + click to select a range
5c2b959
For extension: Spring-Cloud Application-Insights, migration instrumen…
jiec-msft 89c81df
1. Update azext.minCliCoreVersion to latest version; 2. Update help info
jiec-msft 34a2040
Merge branch 'master' into jiec/ipa_ga-connection_str
jiec-msft cd75dd3
Update version number and add release notes
jiec-msft 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
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
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
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "azext.isPreview": false, | ||
| "azext.minCliCoreVersion": "2.0.67" | ||
| "azext.minCliCoreVersion": "2.25.0" | ||
| } |
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
43 changes: 43 additions & 0 deletions
43
src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_ut.py
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,43 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| import unittest | ||
| from azext_spring_cloud.custom import get_connection_string_or_instrumentation_key | ||
|
|
||
| class SimplifiedApplicationInsightsCompoent: | ||
| def __init__(self): | ||
| self.connection_string = None | ||
| self.instrumentation_key = None | ||
|
|
||
|
|
||
| class AzureSpringCloudTestCase(unittest.TestCase): | ||
| def setUp(self): | ||
| self._connection_string = "InstrumentationKey=11111111-0000-0000-0000-000000000000;IngestionEndpoint=https://11111111.00.0000000000000000000.00000.000/" | ||
| self._instrumentation_key = "11111111-0000-0000-0000-000000000000" | ||
|
|
||
|
|
||
| def test_get_conenction_string_or_instrumentation_key_case_1_connection_string_exists(self): | ||
| appinsights = SimplifiedApplicationInsightsCompoent() | ||
| appinsights.connection_string = self._connection_string | ||
| appinsights.instrumentation_key = self._instrumentation_key | ||
| self.assertEqual(self._connection_string, get_connection_string_or_instrumentation_key(appinsights)) | ||
|
|
||
|
|
||
| def test_get_conenction_string_or_instrumentation_key_case_2_connection_string_not_exist(self): | ||
| appinsights = SimplifiedApplicationInsightsCompoent() | ||
| appinsights.connection_string = None | ||
| appinsights.instrumentation_key = self._instrumentation_key | ||
| self.assertEqual(self._instrumentation_key, get_connection_string_or_instrumentation_key(appinsights)) | ||
|
|
||
|
|
||
| def test_get_conenction_string_or_instrumentation_key_case_3_no_credential(self): | ||
| appinsights = SimplifiedApplicationInsightsCompoent() | ||
| appinsights.connection_string = None | ||
| appinsights.instrumentation_key = None | ||
| self.assertIsNone(get_connection_string_or_instrumentation_key(appinsights)) | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
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
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.
Uh oh!
There was an error while loading. Please reload this page.