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

Use basename with extension as OSD test case class name #5116

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/report_workflow/test_report_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def get_failed_tests(product_name: str, test_result: str, test_result_files: lis
class_name = "DefaultClassName"
for testsuite in soup.find_all("testsuite"):
if testsuite["name"] == "Root Suite":
class_name = testsuite["file"].replace("cypress/", "").replace(".js", "")
class_name = os.path.basename(testsuite["file"])
testsuite_failures = int(testsuite["failures"])
if testsuite_failures > 0:
for testcase in testsuite.find_all("testcase"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ def test_runner_component_entry_url_failed_test(self, report_args_mock: MagicMoc
test_report_component_dict = TestReportRunner(report_args_mock, self.TEST_MANIFEST_OPENSEARCH_DASHBOARDS).component_entry("alertingDashboards")
self.assertEqual(test_report_component_dict.get("configs")[0]["status"], "FAIL")
self.assertEqual(test_report_component_dict.get("configs")[0]["name"], "with-security")
self.assertEqual(test_report_component_dict.get("configs")[0]["failed_test"][0], "integration/plugins/alerting-dashboards-plugin/acknowledge_alerts_modal_spec#AcknowledgeAlertsModal "
self.assertEqual(test_report_component_dict.get("configs")[0]["failed_test"][0], "acknowledge_alerts_modal_spec.js#AcknowledgeAlertsModal "
"\"before all\" hook for \"Acknowledge button disabled when more than 1 trigger selected\"")

self.assertEqual(test_report_component_dict.get("configs")[1]["status"], "FAIL")
self.assertEqual(test_report_component_dict.get("configs")[1]["name"], "without-security")
self.assertEqual(test_report_component_dict.get("configs")[1]["failed_test"][1], "integration/plugins/alerting-dashboards-plugin/alert_spec#Alerts can be in 'Active' state "
self.assertEqual(test_report_component_dict.get("configs")[1]["failed_test"][1], "alert_spec.js#Alerts can be in 'Active' state "
"\"before each\" hook for \"after the monitor starts running\"")

@patch("report_workflow.report_args.ReportArgs")
Expand Down Expand Up @@ -181,10 +181,10 @@ def test_runner_component_entry_local_failed_test(self, report_args_mock: MagicM
test_report_component_dict = TestReportRunner(report_args_mock, self.TEST_MANIFEST_OPENSEARCH_DASHBOARDS).component_entry("indexManagementDashboards")
self.assertEqual(test_report_component_dict.get("configs")[0]["status"], "FAIL")
self.assertEqual(test_report_component_dict.get("configs")[0]["name"], "with-security")
self.assertEqual(test_report_component_dict.get("configs")[0]["failed_test"][0], "integration/plugins/index-management-dashboards-plugin/aliases#Aliases can be "
self.assertEqual(test_report_component_dict.get("configs")[0]["failed_test"][0], "aliases.js#Aliases can be "
"searched / sorted / paginated \"before each\" hook for \"successfully\"")

self.assertEqual(test_report_component_dict.get("configs")[1]["status"], "FAIL")
self.assertEqual(test_report_component_dict.get("configs")[1]["name"], "without-security")
self.assertEqual(test_report_component_dict.get("configs")[1]["failed_test"][1], "integration/plugins/index-management-dashboards-plugin/create_index#Create Index "
self.assertEqual(test_report_component_dict.get("configs")[1]["failed_test"][1], "create_index.js#Create Index "
"can be created and updated \"before each\" hook for \"Create a index successfully\"")
Loading