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

Sumo 233810 fix unit testing automation #69

Merged

Conversation

priyansh-sumo
Copy link
Collaborator

No description provided.

@priyansh-sumo priyansh-sumo requested a review from a team as a code owner January 11, 2024 23:22
test_utils/basetest.py Outdated Show resolved Hide resolved
test_utils/basetest.py Outdated Show resolved Hide resolved
test_utils/basetest.py Outdated Show resolved Hide resolved
test_utils/basetest.py Outdated Show resolved Hide resolved
test_utils/basetest.py Outdated Show resolved Hide resolved
EventHubs/requirements.txt Outdated Show resolved Hide resolved
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'))
Copy link
Collaborator

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

Copy link
Collaborator

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:")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove redundant print statements

Copy link
Collaborator Author

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()
Copy link
Collaborator

@himanshu219 himanshu219 Jan 19, 2024

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

Copy link
Collaborator

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

Copy link
Collaborator Author

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")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove print statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@himanshu219 himanshu219 merged commit f095ff5 into azure-metrics-upgrade-v2 Jan 19, 2024
@npande npande deleted the SUMO-233810-fix-unit-testing-automation branch May 10, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants