Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Oct 23, 2023
1 parent 44efc5f commit b2e037b
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 11 deletions.
5 changes: 4 additions & 1 deletion res/index_mapping_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@
"launch_name": {
"type": "keyword"
},
"launch_number": {
"type": "integer"
},
"launch_id": {
"type": "keyword"
"type": "integer"
},
"launch_start_time": {
"type": "date",
Expand Down
3 changes: 3 additions & 0 deletions res/rp_aa_stats_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"launch_name": {
"type": "keyword"
},
"launch_number": {
"type": "integer"
},
"project_id": {
"type": "keyword"
},
Expand Down
5 changes: 3 additions & 2 deletions test/mock_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ def _start_server(self, test_calls):
@utils.ignore_warnings
def shutdown_server(test_calls):
"""Shutdown server and test request calls"""
assert len(httpretty.latest_requests()) == len(test_calls)
for expected_test_call, test_call in zip(test_calls, httpretty.latest_requests()):
actual_calls = httpretty.latest_requests()
assert len(actual_calls) == len(test_calls)
for expected_test_call, test_call in zip(test_calls, actual_calls):
assert expected_test_call["method"] == test_call.method
assert expected_test_call["uri"] == test_call.path
if "rq" in expected_test_call:
Expand Down
2 changes: 1 addition & 1 deletion test_res/fixtures/index_logs_rq.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"index":{"_index":"idx2","_type":"log","_id":"1_m"}}
{"issue_type":"AB001","launch_name":"Launch 1","log_level":40000,"original_message_lines":1,"original_message_words_number":2,"message":"","test_item":1,"test_item_name":"first test","start_time":"2020-01-15 10:57:43","unique_id":"unique1","test_case_hash":-1126886180,"detected_message":"","detected_message_with_numbers":"","only_numbers":"12","merged_small_logs":"message http localhost admin java.lang.noclassdeffounderror","stacktrace":"","urls":"http localhost admin","paths":"","message_params":"","potential_status_codes":"","found_exceptions":"java.lang.noclassdeffounderror","found_exceptions_extended":"java.lang.noclassdeffounderror lang.noclassdeffounderror noclassdeffounderror","found_tests_and_methods":"","stacktrace_extended":"","message_extended":"","detected_message_extended":"","detected_message_without_params_extended":"message java.lang lang.noclassdeffounderror noclassdeffounderror","message_without_params_extended":"","message_without_params_and_brackets":"","detected_message_without_params_and_brackets":"","whole_message":"Message 12 \r\n java.lang lang.NoClassDefFoundError\r\n","is_merged":true}
{"issue_type":"AB001","launch_name":"Launch 1","launch_number":0,"log_level":40000,"original_message_lines":1,"original_message_words_number":2,"message":"","test_item":1,"test_item_name":"first test","start_time":"2020-01-15 10:57:43","unique_id":"unique1","test_case_hash":-1126886180,"detected_message":"","detected_message_with_numbers":"","only_numbers":"12","merged_small_logs":"message http localhost admin java.lang.noclassdeffounderror","stacktrace":"","urls":"http localhost admin","paths":"","message_params":"","potential_status_codes":"","found_exceptions":"java.lang.noclassdeffounderror","found_exceptions_extended":"java.lang.noclassdeffounderror lang.noclassdeffounderror noclassdeffounderror","found_tests_and_methods":"","stacktrace_extended":"","message_extended":"","detected_message_extended":"","detected_message_without_params_extended":"message java.lang lang.noclassdeffounderror noclassdeffounderror","message_without_params_extended":"","message_without_params_and_brackets":"","detected_message_without_params_and_brackets":"","whole_message":"Message 12 \r\n java.lang lang.NoClassDefFoundError\r\n","is_merged":true}
4 changes: 2 additions & 2 deletions test_res/fixtures/index_logs_rq_big_messages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"index":{"_index":"2","_id":1}}
{"launch_id":1234567892,"launch_name":"Launch with test items with logs","launch_start_time":"2020-01-15 10:57:43","test_item":1,"test_item_name":"first test","unique_id":"unique1","cluster_id":"0","cluster_message":"","test_case_hash":-1126886180,"is_auto_analyzed":false,"issue_type":"ti001","log_time":"2020-01-15 10:57:43","log_level":40000,"original_message_lines":5,"original_message_words_number":9,"message":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","is_merged":false,"start_time":"2020-01-15 10:57:43","merged_small_logs":"","detected_message":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","detected_message_with_numbers":"Message 1 \r\n Message 2 \r\n Message 3 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","stacktrace":"","only_numbers":"1 2 3","found_exceptions":"java.lang.NoClassDefFoundError","whole_message":"Message 1 \r\n Message 2 \r\n Message 3 'prod_en' \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \n ","potential_status_codes":"","found_tests_and_methods":"","cluster_with_numbers":false,"urls":"","paths":"/src/prod/results.html","message_params":"prod_en","found_exceptions_extended":"java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError","detected_message_extended":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator \r","detected_message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator ","stacktrace_extended":"","message_extended":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator \r","message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator ","detected_message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator","message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator"}
{"launch_id":1234567892,"launch_name":"Launch with test items with logs","launch_number":0,"launch_start_time":"2020-01-15 10:57:43","test_item":1,"test_item_name":"first test","unique_id":"unique1","cluster_id":"0","cluster_message":"","test_case_hash":-1126886180,"is_auto_analyzed":false,"issue_type":"ti001","log_time":"2020-01-15 10:57:43","log_level":40000,"original_message_lines":5,"original_message_words_number":9,"message":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","is_merged":false,"start_time":"2020-01-15 10:57:43","merged_small_logs":"","detected_message":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","detected_message_with_numbers":"Message 1 \r\n Message 2 \r\n Message 3 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \r","stacktrace":"","only_numbers":"1 2 3","found_exceptions":"java.lang.NoClassDefFoundError","whole_message":"Message 1 \r\n Message 2 \r\n Message 3 'prod_en' \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator \n ","potential_status_codes":"","found_tests_and_methods":"","cluster_with_numbers":false,"urls":"","paths":"/src/prod/results.html","message_params":"prod_en","found_exceptions_extended":"java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError","detected_message_extended":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator \r","detected_message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator ","stacktrace_extended":"","message_extended":"Message \r\n Message 'prod_en' /src/prod/results.html \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator \r","message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator impl.MandatoryAttributesValidator MandatoryAttributesValidator ","detected_message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator","message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError\r\n de.hybris.platform.servicelayer.interceptor.impl.MandatoryAttributesValidator"}
{"index":{"_index":"2","_id":2}}
{"launch_id":1234567892,"launch_name":"Launch with test items with logs","launch_start_time":"2020-01-15 10:57:43","test_item":1,"test_item_name":"first test","unique_id":"unique1","cluster_id":"0","cluster_message":"","test_case_hash":-1126886180,"is_auto_analyzed":false,"issue_type":"ti001","log_time":"2020-01-15 10:57:43","log_level":40000,"original_message_lines":4,"original_message_words_number":7,"message":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","is_merged":false,"start_time":"2020-01-15 10:57:43","merged_small_logs":"","detected_message":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","detected_message_with_numbers":"Message 2 \r\n Message 4 \r\n Message 5 http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","stacktrace":"","only_numbers":"2 4 5","found_exceptions":"java.lang.NoClassDefFoundError","whole_message":"Message 2 \r\n Message 4 \r\n Message 5 \r\n java.lang.NoClassDefFoundError \n ","potential_status_codes":"","found_tests_and_methods":"","cluster_with_numbers":false,"urls":"http:localhost/admin","paths":"","message_params":"","found_exceptions_extended":"java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError","detected_message_extended":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r","detected_message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError ","stacktrace_extended":"","message_extended":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r","message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError ","detected_message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError","message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError"}
{"launch_id":1234567892,"launch_name":"Launch with test items with logs","launch_number":0,"launch_start_time":"2020-01-15 10:57:43","test_item":1,"test_item_name":"first test","unique_id":"unique1","cluster_id":"0","cluster_message":"","test_case_hash":-1126886180,"is_auto_analyzed":false,"issue_type":"ti001","log_time":"2020-01-15 10:57:43","log_level":40000,"original_message_lines":4,"original_message_words_number":7,"message":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","is_merged":false,"start_time":"2020-01-15 10:57:43","merged_small_logs":"","detected_message":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","detected_message_with_numbers":"Message 2 \r\n Message 4 \r\n Message 5 http : localhost/admin \r\n java.lang.NoClassDefFoundError\r","stacktrace":"","only_numbers":"2 4 5","found_exceptions":"java.lang.NoClassDefFoundError","whole_message":"Message 2 \r\n Message 4 \r\n Message 5 \r\n java.lang.NoClassDefFoundError \n ","potential_status_codes":"","found_tests_and_methods":"","cluster_with_numbers":false,"urls":"http:localhost/admin","paths":"","message_params":"","found_exceptions_extended":"java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError","detected_message_extended":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r","detected_message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError ","stacktrace_extended":"","message_extended":"Message \r\n Message http : localhost/admin \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError \r","message_without_params_extended":"Message \r\n java.lang.NoClassDefFoundError lang.NoClassDefFoundError NoClassDefFoundError ","detected_message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError","message_without_params_and_brackets":"Message \r\n java.lang.NoClassDefFoundError"}
Loading

0 comments on commit b2e037b

Please sign in to comment.