Skip to content
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

Azure - nightly functional - Fix for resource group and Cosmos #4748

Merged

Conversation

jomalsan
Copy link
Collaborator

@jomalsan jomalsan commented Sep 6, 2019

  1. Lowered max-resource-percent for test to be valid for the large number of resource groups in a functional test
  2. Fixes for CosmosDB to support the automated naming of the account deployed by the ARM template. Also had to add waits when running against real resources to get the results of actions

@@ -301,7 +301,14 @@ def _replace_subscription_id(s):
r"[\da-zA-Z]{8}-([\da-zA-Z]{4}-){3}[\da-zA-Z]{12}" \
% '|'.join(['(%s)' % p for p in prefixes])

return re.sub(regex, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID, s)
match = re.search(regex, s)
s = re.sub(regex, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID, s)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I wonder if re.sub is the same as s.replace(re.search(regex, s), NEW) anyway. e.g. can we replace this line with s = s.replace(match, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID) to avoid doing the regex search twice. The method runs a very large number of times so might have some measurable impact.

self.assertEqual(throughput, offer['content']['offerThroughput'])


def live_session_wait():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we could add this to BaseTest in azure_common.py - most methods there already check if self.is_playback(): so we could have def test_sleep(self, interval) that does nothing if self.is_playback() - then it'll run during cassette recording or live tests only. I'm sure others will end up needing it eventually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named the functions sleep_in_live_mode. I tried test_sleep but then it got picked up as a test for each running class, which added a ton of time

@stefangordon stefangordon merged commit aec7dd6 into cloud-custodian:master Sep 10, 2019
@jomalsan jomalsan deleted the bug/nightly-functional-fixes branch September 10, 2019 16:21
fidelito pushed a commit to fidelito/cloud-custodian that referenced this pull request May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants