{"name": "test_sku_batch_upload_update_sku", "status": "skipped", "statusDetails": {"message": "XFAIL https://jira.dailymail-tech.uz/browse/FF-109\n\nAssertionError: Handler: POST https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch; \n Expected status code: 200; \n Actual status code: 500; \n Response body: {\"message\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\",\"localizedMessage\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\"}; \n X-Aer-Trace-Id:", "trace": "self = <tests.fulfillment.test_supply.test_sku.TestSKUBatch object at 0x727cdc5454d0>\nget_ff_supply_auth_header = {'Authorization': 'Bearer 8dca8284-9530-4f92-9858-c569bd0e9c7a', 'x-aer-mesh': 'dm-hub-service-package:master;dm-hub-s...hub-internal:master;dm-hub-workflow-integration:master;dm-hub-workflow-package:master;dm-hub-workflow-tracking:master'}\n\n    @pytest.mark.xfail(reason=\"https://jira.dailymail-tech.uz/browse/FF-109\")\n    def test_sku_batch_upload_update_sku(self, get_ff_supply_auth_header):\n        with allure.step(\"Get existing external SKU id and prepare data for batch upload\"):\n            existing_external_sku_ids = FFSupplyQueries().get_external_ids_by_type(\n                _type=FFSupplyShadedIdType.SKU_ID, limit_number=SKU_NUMBERS_FOR_BATCH_FILE\n            )\n            list_sku_for_batch_file = [\n                SKUBatch(is_price_float=False, external_sku_id=existing_external_sku_id).to_dict()\n                for existing_external_sku_id in existing_external_sku_ids\n            ]\n            sorted_list_sku_for_batch_file = sorted(list_sku_for_batch_file, key=lambda i: i[\"external_sku_id\"])\n    \n        with allure.step(\"Batch upload\"):\n>           SKUBuilder(headers=get_ff_supply_auth_header).batch_upload(data=list_sku_for_batch_file)\n\ntests/fulfillment/test_supply/test_sku.py:87: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nsrc/framework/fulfillment/builders/supply/sku.py:96: in batch_upload\n    wait_sku_batch_upload(headers=self.headers, file=prepared_file)\nsrc/framework/common/utils/utils.py:218: in wrapped_f\n    return Retrying(\n/usr/local/lib/python3.11/site-packages/retrying.py:289: in call\n    raise attempt.get()\n          ^^^^^^^^^^^^^\n/usr/local/lib/python3.11/site-packages/retrying.py:326: in get\n    raise exc.with_traceback(tb)\n/usr/local/lib/python3.11/site-packages/retrying.py:273: in call\n    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)\n                      ^^^^^^^^^^^^^^^^^^^\nsrc/framework/fulfillment/validation/waiters/sku_batch.py:13: in wait_sku_batch_upload\n    assert SkuApi(headers=headers).api_v1_sku_batch_post(file=file).status == HTTPStatus.OK\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py:355: in api_v1_sku_batch_post\n    return self.api_v1_sku_batch_post_with_http_info(**kwargs)  # noqa: E501\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py:422: in api_v1_sku_batch_post_with_http_info\n    return self.api_client.call_api(\n/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py:339: in call_api\n    return self.__call_api(resource_path, method,\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <qacl_dm_ff_be_service_supply.api_client.ApiClient object at 0x727cdb187810>\nresource_path = '/api/v1/sku/batch', method = 'POST', path_params = {}\nquery_params = []\nheader_params = {'Accept': 'application/json', 'Authorization': 'Bearer 8dca8284-9530-4f92-9858-c569bd0e9c7a', 'User-Agent': 'Swagger-Codegen/1.0.224+develop/python', 'x-aer-app-name': 'python-autotests', ...}\nbody = None\npost_params = [('file', ('tmpho782git.xlsx', b'PK\\x03\\x04\\x14\\x00\\x00\\x00\\x08\\x00\\xfd\\xba\\x86\\\\F\\xc7MH\\x95\\x00\\x00\\x00\\xcd\\x00\\x00\\x...x00\\t\\x00>\\x02\\x00\\x00\\xaf\\x15\\x00\\x00\\x00\\x00', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'))]\nfiles = {'file': '/tmp/tmpho782git.xlsx'}, response_type = 'object'\nauth_settings = ['wms-authorization'], _return_http_data_only = False\ncollection_formats = {}, _preload_content = True, _request_timeout = None\nexpected_status_code = <HTTPStatus.OK: 200>\n\n    def __call_api(\n            self, resource_path, method, path_params=None,\n            query_params=None, header_params=None, body=None, post_params=None,\n            files=None, response_type=None, auth_settings=None,\n            _return_http_data_only=None, collection_formats=None,\n            _preload_content=True, _request_timeout=None,\n            expected_status_code=HTTPStatus.OK):\n    \n        config = self.configuration\n    \n        # header parameters\n        header_params = header_params or {}\n        header_params.update(self.default_headers)\n        if self.cookie:\n            header_params['Cookie'] = self.cookie\n        if header_params:\n            header_params = self.sanitize_for_serialization(header_params)\n            header_params = dict(self.parameters_to_tuples(header_params,\n                                                           collection_formats))\n    \n        # path parameters\n        if path_params:\n            path_params = self.sanitize_for_serialization(path_params)\n            path_params = self.parameters_to_tuples(path_params,\n                                                    collection_formats)\n            for k, v in path_params:\n                # specified safe chars, encode everything\n                resource_path = resource_path.replace(\n                    '{%s}' % k,\n                    quote(str(v), safe=config.safe_chars_for_path_param)\n                )\n    \n        # query parameters\n        if query_params:\n            query_params = self.sanitize_for_serialization(query_params)\n            query_params = self.parameters_to_tuples(query_params,\n                                                     collection_formats)\n    \n        # post parameters\n        if post_params or files:\n            post_params = self.prepare_post_parameters(post_params, files)\n            post_params = self.sanitize_for_serialization(post_params)\n            post_params = self.parameters_to_tuples(post_params,\n                                                    collection_formats)\n    \n        # auth setting\n        self.update_params_for_auth(header_params, query_params, auth_settings)\n    \n        # body\n        if body:\n            body = self.sanitize_for_serialization(body)\n    \n        # request url\n        url = self.configuration.host + resource_path\n    \n        # perform request and return response\n        response_data = self.request(\n            method, url, query_params=query_params, headers=header_params,\n            post_params=post_params, body=body,\n            _preload_content=_preload_content,\n            _request_timeout=_request_timeout)\n    \n        self.last_response = response_data\n    \n        return_data = response_data\n    \n        try:\n            response_data.data\n            trace_id = response_data.urllib3_response.headers.get('x-aer-trace-id', \"\")\n        except:\n            assert response_data.status == expected_status_code, \\\n                f'Handler: {method} {url}; \\n ' \\\n                f'Expected status code: {expected_status_code}; \\n ' \\\n                f'Actual status code: {response_data.status}'\n        else:\n>           assert response_data.status == expected_status_code, \\\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                f'Handler: {method} {url}; \\n ' \\\n                f'Expected status code: {expected_status_code}; \\n ' \\\n                f'Actual status code: {response_data.status}; \\n ' \\\n                f'Response body: {response_data.data}; \\n ' \\\n                f'X-Aer-Trace-Id: {trace_id}'\nE           AssertionError: Handler: POST https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch; \nE            Expected status code: 200; \nE            Actual status code: 500; \nE            Response body: {\"message\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\",\"localizedMessage\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\"}; \nE            X-Aer-Trace-Id:\n\n/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py:172: AssertionError"}, "steps": [{"name": "Get existing external SKU id and prepare data for batch upload", "status": "passed", "steps": [{"name": "SQLAlchemy query UNDEFINED ", "status": "passed", "attachments": [{"name": "query", "source": "d802cf8f-4223-4d01-a04f-53484d6b771b-attachment.txt", "type": "text/plain"}, {"name": "params", "source": "2eaae3a9-3e2f-4673-9885-95d14ecc68bc-attachment.json", "type": "application/json"}], "start": 1775517839827, "stop": 1775517839827}, {"name": "SQLAlchemy query UNDEFINED ", "status": "passed", "attachments": [{"name": "query", "source": "5c2cdf08-2d6b-426a-b9c1-a810d44c373b-attachment.txt", "type": "text/plain"}, {"name": "params", "source": "294c8237-6bba-4721-a8a8-d5d98b817692-attachment.json", "type": "application/json"}], "start": 1775517839827, "stop": 1775517839827}, {"name": "SQLAlchemy query UNDEFINED ", "status": "passed", "attachments": [{"name": "query", "source": "536cf640-3601-4f54-af35-240d09366759-attachment.txt", "type": "text/plain"}, {"name": "params", "source": "d21626b6-0008-46d5-b5bf-d47ef9e6539a-attachment.json", "type": "application/json"}], "start": 1775517839828, "stop": 1775517839828}], "start": 1775517839815, "stop": 1775517839850}, {"name": "Batch upload", "status": "failed", "statusDetails": {"message": "AssertionError: Handler: POST https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch; \n Expected status code: 200; \n Actual status code: 500; \n Response body: {\"message\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\",\"localizedMessage\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\"}; \n X-Aer-Trace-Id: \n", "trace": "  File \"/app/tests/fulfillment/test_supply/test_sku.py\", line 87, in test_sku_batch_upload_update_sku\n    SKUBuilder(headers=get_ff_supply_auth_header).batch_upload(data=list_sku_for_batch_file)\n  File \"/app/src/framework/fulfillment/builders/supply/sku.py\", line 96, in batch_upload\n    wait_sku_batch_upload(headers=self.headers, file=prepared_file)\n  File \"/app/src/framework/common/utils/utils.py\", line 218, in wrapped_f\n    return Retrying(\n           ^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 289, in call\n    raise attempt.get()\n          ^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 326, in get\n    raise exc.with_traceback(tb)\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 273, in call\n    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)\n                      ^^^^^^^^^^^^^^^^^^^\n  File \"/app/src/framework/fulfillment/validation/waiters/sku_batch.py\", line 13, in wait_sku_batch_upload\n    assert SkuApi(headers=headers).api_v1_sku_batch_post(file=file).status == HTTPStatus.OK\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py\", line 355, in api_v1_sku_batch_post\n    return self.api_v1_sku_batch_post_with_http_info(**kwargs)  # noqa: E501\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py\", line 422, in api_v1_sku_batch_post_with_http_info\n    return self.api_client.call_api(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py\", line 339, in call_api\n    return self.__call_api(resource_path, method,\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py\", line 172, in __call_api\n    assert response_data.status == expected_status_code, \\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"}, "steps": [{"name": "Waiter function: wait_sku_batch_upload", "status": "failed", "statusDetails": {"message": "AssertionError: Handler: POST https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch; \n Expected status code: 200; \n Actual status code: 500; \n Response body: {\"message\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\",\"localizedMessage\":\"could not execute statement; SQL [n/a]; constraint [idx_shaded_id_external]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement\"}; \n X-Aer-Trace-Id: \n", "trace": "  File \"/app/src/framework/common/utils/utils.py\", line 218, in wrapped_f\n    return Retrying(\n           ^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 289, in call\n    raise attempt.get()\n          ^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 326, in get\n    raise exc.with_traceback(tb)\n  File \"/usr/local/lib/python3.11/site-packages/retrying.py\", line 273, in call\n    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)\n                      ^^^^^^^^^^^^^^^^^^^\n  File \"/app/src/framework/fulfillment/validation/waiters/sku_batch.py\", line 13, in wait_sku_batch_upload\n    assert SkuApi(headers=headers).api_v1_sku_batch_post(file=file).status == HTTPStatus.OK\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py\", line 355, in api_v1_sku_batch_post\n    return self.api_v1_sku_batch_post_with_http_info(**kwargs)  # noqa: E501\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api/sku_api.py\", line 422, in api_v1_sku_batch_post_with_http_info\n    return self.api_client.call_api(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py\", line 339, in call_api\n    return self.__call_api(resource_path, method,\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/qacl_dm_ff_be_service_supply/api_client.py\", line 172, in __call_api\n    assert response_data.status == expected_status_code, \\\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"}, "steps": [{"name": "POST → https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch", "status": "passed", "steps": [{"name": "Request", "status": "passed", "attachments": [{"name": "request.headers", "source": "72b7154b-de7d-4d13-bf76-e6241bbf1bbe-attachment.json", "type": "application/json"}], "start": 1775517840010, "stop": 1775517840010}, {"name": "Response → 500, trace_id: None", "status": "passed", "attachments": [{"name": "response.headers", "source": "f1e18149-f799-4ee7-8899-844c925bcb60-attachment.json", "type": "application/json"}, {"name": "response.body", "source": "cb8b1a89-c288-4921-a790-74631463e1ef-attachment.json", "type": "application/json"}], "start": 1775517840011, "stop": 1775517840011}], "attachments": [{"name": "cURL", "source": "c0b6ae84-5612-4214-8e8a-f4dbb0975c17-attachment.txt", "type": "text/plain"}], "start": 1775517840010, "stop": 1775517840011}, {"name": "POST → https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch", "status": "passed", "steps": [{"name": "Request", "status": "passed", "attachments": [{"name": "request.headers", "source": "2ad0d0b3-f7c1-4d07-8579-013c5c7d19f1-attachment.json", "type": "application/json"}], "start": 1775517860039, "stop": 1775517860039}, {"name": "Response → 500, trace_id: None", "status": "passed", "attachments": [{"name": "response.headers", "source": "71485aeb-853d-4d47-b797-2cbb0c57f5b2-attachment.json", "type": "application/json"}, {"name": "response.body", "source": "5f57accc-85a4-416f-addb-e456dce6557f-attachment.json", "type": "application/json"}], "start": 1775517860039, "stop": 1775517860039}], "attachments": [{"name": "cURL", "source": "52152eee-b029-473f-953c-1c86825634c3-attachment.txt", "type": "text/plain"}], "start": 1775517860039, "stop": 1775517860039}, {"name": "POST → https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch", "status": "passed", "steps": [{"name": "Request", "status": "passed", "attachments": [{"name": "request.headers", "source": "a0e06802-d671-444b-87b5-a3b9dfedfddb-attachment.json", "type": "application/json"}], "start": 1775517880073, "stop": 1775517880073}, {"name": "Response → 500, trace_id: None", "status": "passed", "attachments": [{"name": "response.headers", "source": "b2b83f33-873c-478d-9b21-a192a0843e81-attachment.json", "type": "application/json"}, {"name": "response.body", "source": "fc0d24be-fea7-4d12-bce6-f04d7d61d88b-attachment.json", "type": "application/json"}], "start": 1775517880073, "stop": 1775517880073}], "attachments": [{"name": "cURL", "source": "33031604-9f4e-457c-9d6c-635eb22c8bf4-attachment.txt", "type": "text/plain"}], "start": 1775517880073, "stop": 1775517880073}, {"name": "POST → https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch", "status": "passed", "steps": [{"name": "Request", "status": "passed", "attachments": [{"name": "request.headers", "source": "32a8c1e0-abfb-4a99-a41c-96f0107859c4-attachment.json", "type": "application/json"}], "start": 1775517900107, "stop": 1775517900107}, {"name": "Response → 500, trace_id: None", "status": "passed", "attachments": [{"name": "response.headers", "source": "fdb1e8e5-26b4-44c0-a3bb-be8a3bfbacfa-attachment.json", "type": "application/json"}, {"name": "response.body", "source": "fe3984ee-92db-48c6-9bb8-8b8057ff957a-attachment.json", "type": "application/json"}], "start": 1775517900107, "stop": 1775517900107}], "attachments": [{"name": "cURL", "source": "31daec7c-a0fe-4eaf-87ba-4ef51f7c0b3d-attachment.txt", "type": "text/plain"}], "start": 1775517900107, "stop": 1775517900107}, {"name": "POST → https://dm-ff-be-service-supply.k8s-review.dailymail-tech.uz/api/v1/sku/batch", "status": "passed", "steps": [{"name": "Request", "status": "passed", "attachments": [{"name": "request.headers", "source": "b4336014-3386-48d8-a9d5-73144e4566bc-attachment.json", "type": "application/json"}], "start": 1775517920140, "stop": 1775517920141}, {"name": "Response → 500, trace_id: None", "status": "passed", "attachments": [{"name": "response.headers", "source": "6b2f2d7a-6e89-4ffa-acae-61285090cda9-attachment.json", "type": "application/json"}, {"name": "response.body", "source": "0d38369c-2ae4-42c6-ae75-670d43147a82-attachment.json", "type": "application/json"}], "start": 1775517920141, "stop": 1775517920142}], "attachments": [{"name": "cURL", "source": "9a2b0447-5b18-429f-bc68-dd7e23f4a6bf-attachment.txt", "type": "text/plain"}], "start": 1775517920140, "stop": 1775517920142}], "start": 1775517839883, "stop": 1775517920144}], "start": 1775517839850, "stop": 1775517920145}], "attachments": [{"name": "log", "source": "69fa33c6-be22-4a3d-a66c-b992022c65c2-attachment.txt", "type": "text/plain"}], "start": 1775517839815, "stop": 1775517920146, "uuid": "d6b76fa7-75b1-48e0-bb88-829c4e1fedcc", "historyId": "5b8363e826b9c7f481b73567f6503152", "testCaseId": "5b8363e826b9c7f481b73567f6503152", "fullName": "tests.fulfillment.test_supply.test_sku.TestSKUBatch#test_sku_batch_upload_update_sku", "labels": [{"name": "tag", "value": "dm-ff-be-service-supply"}, {"name": "parentSuite", "value": "tests.fulfillment.test_supply"}, {"name": "suite", "value": "test_sku"}, {"name": "subSuite", "value": "TestSKUBatch"}, {"name": "host", "value": "runner-1rdl4o-mi-project-9-concurrent-1-nf7l5zqw"}, {"name": "thread", "value": "45-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "tests.fulfillment.test_supply.test_sku"}], "titlePath": ["tests", "fulfillment", "test_supply", "test_sku.py", "TestSKUBatch"]}