)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"5e864ce4ee5fa60e9d74b7f04f3525724051f1b2","unresolved":true,"context_lines":[{"line_number":10,"context_line":"`record_resources()` function. These unit tests are tied with the"},{"line_number":11,"context_line":"tempest cleanup --resource-list option. The issue was the creation"},{"line_number":12,"context_line":"of None file and resource_list.json file while running unit tests."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Id8ff96606b30d52ad4c8a6bd31bcb09ae03cc963"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"11b689f5_b9b67d6e","line":13,"updated":"2024-07-02 15:30:15.000000000","message":"Closes-Bug: #2070449\n\nadd this ^^ please here, example in https://wiki.openstack.org/wiki/GitCommitMessages - search for \"Summary of Git commit message structure\" title ... this way the LP will get updated and closed automatically when this patch is merged.","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"29c2bd57ba0b282baee75a3e264261d9912a4809","unresolved":false,"context_lines":[{"line_number":10,"context_line":"`record_resources()` function. These unit tests are tied with the"},{"line_number":11,"context_line":"tempest cleanup --resource-list option. The issue was the creation"},{"line_number":12,"context_line":"of None file and resource_list.json file while running unit tests."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Id8ff96606b30d52ad4c8a6bd31bcb09ae03cc963"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"63e6bb30_589d234d","line":13,"in_reply_to":"11b689f5_b9b67d6e","updated":"2024-07-08 13:00:29.000000000","message":"Done","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":36227,"name":"Katarina Strenkova","email":"kstrenko@redhat.com","username":"kstrenko"},"change_message_id":"5ed5be58b4a3f9dcee0c0531d7b53f7eb3c0c63b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"956969b6_50e58d53","updated":"2024-07-03 14:09:35.000000000","message":"Thank you for the review. I will add the Closes-bug in the next patch, but first I want to discuss what changes should I do for the code in this patch.","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"5e864ce4ee5fa60e9d74b7f04f3525724051f1b2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6b4f4bb0_0c76150d","updated":"2024-07-02 15:30:15.000000000","message":"a few minor details, however, i confirm that the initial problem is fixed","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":36227,"name":"Katarina Strenkova","email":"kstrenko@redhat.com","username":"kstrenko"},"change_message_id":"55c8326f43876d54c42385babb454b195a6467eb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"db543725_b8c41939","updated":"2024-07-08 12:41:34.000000000","message":"I have mocked the resource_list.json file in this patchset. It may look like I added a lot of lines of code, but it was just needed to add indents.\n\nI checked and the resource_list.json file should not be created anymore and no tearDown is needed anymore. I hope the change makes sense.","commit_id":"69f622b1085c23313c81db34e6b03193f28a6ac4"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"29c2bd57ba0b282baee75a3e264261d9912a4809","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0175fe54_a0b23624","updated":"2024-07-08 13:00:29.000000000","message":"great, thank you, the LP is fixed and the tests don\u0027t work with actual files now .. lgtm","commit_id":"69f622b1085c23313c81db34e6b03193f28a6ac4"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"99110965a14dccd0fbde60f6ea205e22467166fd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ae935845_f563bfb0","updated":"2024-07-08 22:18:39.000000000","message":"recheck connectivity issues \"v3.4.27/etcd-v3.4.27-linux-amd64.tar.gz could not be downloaded\"","commit_id":"69f622b1085c23313c81db34e6b03193f28a6ac4"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"dbe4b5d9a3fd52255711c8a14abd4cfdf883b734","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"56b1654f_30cf73b8","updated":"2024-07-09 07:06:40.000000000","message":"recheck test_volume_swap test in tempest-slow-py3 failed to reach available status","commit_id":"69f622b1085c23313c81db34e6b03193f28a6ac4"}],"tempest/lib/common/rest_client.py":[{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"5e864ce4ee5fa60e9d74b7f04f3525724051f1b2","unresolved":true,"context_lines":[{"line_number":46,"context_line":"JSONSCHEMA_VALIDATOR \u003d jsonschema_validator.JSONSCHEMA_VALIDATOR"},{"line_number":47,"context_line":"FORMAT_CHECKER \u003d jsonschema_validator.FORMAT_CHECKER"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"RESOURCE_LIST_JSON \u003d \"resource_list.json\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class RestClient(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"51f2c720_b58a420d","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":18},"updated":"2024-07-02 15:30:15.000000000","message":"any particular reason we need these changes for?","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"29c2bd57ba0b282baee75a3e264261d9912a4809","unresolved":false,"context_lines":[{"line_number":46,"context_line":"JSONSCHEMA_VALIDATOR \u003d jsonschema_validator.JSONSCHEMA_VALIDATOR"},{"line_number":47,"context_line":"FORMAT_CHECKER \u003d jsonschema_validator.FORMAT_CHECKER"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"RESOURCE_LIST_JSON \u003d \"resource_list.json\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class RestClient(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"039b57d9_4fce9d39","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":18},"in_reply_to":"20cade1b_381ebdda","updated":"2024-07-08 13:00:29.000000000","message":"Acknowledged","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":36227,"name":"Katarina Strenkova","email":"kstrenko@redhat.com","username":"kstrenko"},"change_message_id":"5ed5be58b4a3f9dcee0c0531d7b53f7eb3c0c63b","unresolved":true,"context_lines":[{"line_number":46,"context_line":"JSONSCHEMA_VALIDATOR \u003d jsonschema_validator.JSONSCHEMA_VALIDATOR"},{"line_number":47,"context_line":"FORMAT_CHECKER \u003d jsonschema_validator.FORMAT_CHECKER"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"RESOURCE_LIST_JSON \u003d \"resource_list.json\""},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"class RestClient(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"20cade1b_381ebdda","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":18},"in_reply_to":"51f2c720_b58a420d","updated":"2024-07-03 14:09:35.000000000","message":"The reason for this change was so we could change the location of resource_list.json file in unit tests. I also think it was not a great code practice as the functions opening the resource_list.json file got a string instead of variable.","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"}],"tempest/tests/lib/common/test_rest_client.py":[{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"5e864ce4ee5fa60e9d74b7f04f3525724051f1b2","unresolved":true,"context_lines":[{"line_number":762,"context_line":"        super(TestRecordResources, self).setUp()"},{"line_number":763,"context_line":"        self.rest_client.rec_rw_lock \u003d mock.MagicMock()"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    def tearDown(self):"},{"line_number":766,"context_line":"        # clear test_resource_list.json file"},{"line_number":767,"context_line":"        with open(self.test_resource_list, \u0027w\u0027) as f:"},{"line_number":768,"context_line":"            f.write(\u0027{}\u0027)"},{"line_number":769,"context_line":"        super(TestRecordResources, self).tearDown()"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"    def test_post_record_resources(self):"},{"line_number":772,"context_line":"        self.rest_client.record_resources \u003d True"},{"line_number":773,"context_line":"        __, return_dict \u003d self.rest_client.post(self.url, {}, {})"}],"source_content_type":"text/x-python","patch_set":1,"id":"2248958b_847e38c0","line":770,"range":{"start_line":765,"start_character":4,"end_line":770,"end_character":0},"updated":"2024-07-02 15:30:15.000000000","message":"when we use @patch, shouldn\u0027t it provide a \"virtual\" file? If yes, we wouldn\u0027t need the teardown\n\nsee, e.g. how the @patch is used here https://opendev.org/openinfra/python-tempestconf/src/branch/master/config_tempest/tests/test_accounts.py#L34 to simulate accounts.yaml file","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":36227,"name":"Katarina Strenkova","email":"kstrenko@redhat.com","username":"kstrenko"},"change_message_id":"5ed5be58b4a3f9dcee0c0531d7b53f7eb3c0c63b","unresolved":true,"context_lines":[{"line_number":762,"context_line":"        super(TestRecordResources, self).setUp()"},{"line_number":763,"context_line":"        self.rest_client.rec_rw_lock \u003d mock.MagicMock()"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    def tearDown(self):"},{"line_number":766,"context_line":"        # clear test_resource_list.json file"},{"line_number":767,"context_line":"        with open(self.test_resource_list, \u0027w\u0027) as f:"},{"line_number":768,"context_line":"            f.write(\u0027{}\u0027)"},{"line_number":769,"context_line":"        super(TestRecordResources, self).tearDown()"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"    def test_post_record_resources(self):"},{"line_number":772,"context_line":"        self.rest_client.record_resources \u003d True"},{"line_number":773,"context_line":"        __, return_dict \u003d self.rest_client.post(self.url, {}, {})"}],"source_content_type":"text/x-python","patch_set":1,"id":"80b0ba9b_6931822e","line":770,"range":{"start_line":765,"start_character":4,"end_line":770,"end_character":0},"in_reply_to":"2248958b_847e38c0","updated":"2024-07-03 14:09:35.000000000","message":"I am not very familiar with patching, so I have used the method to replace the path to the resource list and create one for testing there. In this case, the tearDown is needed (it can maybe be replaced with os.remove, but I didn\u0027t want to import os just for that).\n\nIn these test we want to test if the resource_list.json is created properly after giving the function different responses, so maybe mocking the file would not test it\u0027s functionality? But I want to hear your opinion on that, maybe I am overlooking something.","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"},{"author":{"_account_id":22873,"name":"Martin Kopec","email":"mkopec@redhat.com","username":"mkopec"},"change_message_id":"24bfffd85a9cae06990435d2fdd379a390da643d","unresolved":true,"context_lines":[{"line_number":762,"context_line":"        super(TestRecordResources, self).setUp()"},{"line_number":763,"context_line":"        self.rest_client.rec_rw_lock \u003d mock.MagicMock()"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"    def tearDown(self):"},{"line_number":766,"context_line":"        # clear test_resource_list.json file"},{"line_number":767,"context_line":"        with open(self.test_resource_list, \u0027w\u0027) as f:"},{"line_number":768,"context_line":"            f.write(\u0027{}\u0027)"},{"line_number":769,"context_line":"        super(TestRecordResources, self).tearDown()"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"    def test_post_record_resources(self):"},{"line_number":772,"context_line":"        self.rest_client.record_resources \u003d True"},{"line_number":773,"context_line":"        __, return_dict \u003d self.rest_client.post(self.url, {}, {})"}],"source_content_type":"text/x-python","patch_set":1,"id":"59e523fa_b4fafa0c","line":770,"range":{"start_line":765,"start_character":4,"end_line":770,"end_character":0},"in_reply_to":"80b0ba9b_6931822e","updated":"2024-07-04 10:23:37.000000000","message":"try check these resources:\nhttps://docs.python.org/3/library/unittest.mock-examples.html#creating-a-mock-from-an-existing-object\nor maybe even better:\nhttps://docs.python.org/3/library/unittest.mock-examples.html#patch-decorators\n\nThe point is that in the test you can patch a call (e.g. \u0027builtin.open\u0027, \u0027tempest.lib.some_super.function\u0027) - that means that when the execution gets to the point when it would call that function, the patch prevents actual call - it intercepts it and simulates given data. Basicall with patch, your telling python that whenever you\u0027re about to call X, don\u0027t do it, and use Y data as an output (imagine you would call it and got returned Y)","commit_id":"0b1953faef1ed0f91f267674f156f780ef45355d"}]}
