Query is to retrieve failed test case matching with exception message. Out of 6 failed test case, one test as exception and rest of them are skipped with message 'Test was skipped'. Below data of ...
See more...
Query is to retrieve failed test case matching with exception message. Out of 6 failed test case, one test as exception and rest of them are skipped with message 'Test was skipped'. Below data of one event. {
"suite_build_id": "20241015.12",
"suite_build_name": "pipeline_name",
"unit_test_name_failed": [
{
"message": "Failed to save the shipping address. An unexpected error occurred. Please try again later or contact HP Support for assistance.",
"test_rail_name": "test_printer_order_placement_magento",
"test_result": "fail"
},
{
"message": "Test was skipped",
"test_rail_name": "test_updation_of_access_token",
},
{
"message": "Test was skipped",
"test_name": "test_printer_and_user_details",
"test_rail_name": "test_printer_and_user_details",
}
]
} Now, I want to display result to show test_rail_name and exception_message which matches exception. Below is the query that I tried. index="eqt-e2e" suite_build_name="pipeline-name" suite_build_number="20241015.12"
| mvexpand unit_test_name_failed{}.message
| mvexpand unit_test_name_failed{}.test_rail_name
| search unit_test_name_failed{}.message="Failed to save the shipping address. An unexpected error occurred. Please try again later or contact HP Support for assistance."
| table suite_build_number, suite_build_start_time, unit_test_name_failed{}.test_rail_name, unit_test_name_failed{}.message
| rename suite_build_number AS "Pipeline Number", suite_build_start_time AS "Pipeline Date", unit_test_name_failed{}.test_rail_name AS "Test Name", unit_test_name_failed{}.message AS "Exception Message" In the result, it should have been 1 event, but retrieve 6 events. I understand, mvexpand works only on one multivalue fields, and here I have 2 multivalue fields. Let me know if there is any solution on retrieving the data.