-
Notifications
You must be signed in to change notification settings - Fork 23
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
Sumo 233810 fix unit testing automation #69
Sumo 233810 fix unit testing automation #69
Conversation
self.assertTrue(self.filter_logs(logs, 'message', self.successful_sent_message)) | ||
|
||
def check_error_log(self, logs): | ||
self.assertTrue(not self.filter_logs(logs, 'severityLevel', '3')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be we can assertFalse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add messages otherwise we don't know what failed
self.asserTrue(self.filter_logs(logs, 'message', self.successful_sent_message), "No success message found in azure function logs")
add messages self.asserFalse(self.filter_logs(logs, 'severityLevel', '3'), "Error messages found in azure function logs")
add messages self.asserFalse(self.filter_logs(logs, 'severityLevel', '2'), "Warning messages found in azure function logs")
row_dict = {str(col): str(item) for col, item in zip(table.columns, row)} | ||
result.append(row_dict) | ||
except Exception as e: | ||
print("An unexpected error occurred during the test:") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove redundant print statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -24,24 +24,21 @@ def test_pipeline(self): | |||
self.assertTrue(self.resource_group_exists(self.RESOURCE_GROUP_NAME)) | |||
self.table_service = self.get_table_service() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove get_table_service since this method is removed already and make this similar to metrics test_pipeline function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
self.successful_sent_message = 'Sent all data to Sumo. Exit now.'
self.expected_resource_count = 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
# print("inserting %s" % (mock_logs)) | ||
self.send_event_data_list(self.event_hub_namespace_prefix, self.eventhub_name, event_data_list) | ||
|
||
print("Event inserted") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
No description provided.