)]}'
{"monasca_tempest_tests/tests/api/helpers.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"223def8517ea2d8aefb8c39d6123df3a861ae33c","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    return alarm_definition"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def create_alarms_for_test_alarms(cls, num):"},{"line_number":84,"context_line":"    alarm_definition_ids \u003d []"},{"line_number":85,"context_line":"    for i in xrange(num):"},{"line_number":86,"context_line":"        # create an alarm definition"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_a2019e3b","line":83,"updated":"2015-11-13 03:41:10.000000000","message":"This comment applies to several functions. If these functions are specific to test_alarms, then I think they should be moved to test_alarms.py.\n\nAlso, I think I would prefer passing in the \"monasca_client\" rather than \"cls\". Or possibly, the first parameter shoudl be \"self\" and these methods should be methods in the class TestAlarms.\n\nhelpers.py is usually for functions that are common across a number of tests. So, if the function that you are writing is specific to one set of tests, such as TestAlarms, then it probably belongs there.","commit_id":"37275fc58ec64fdc6248902c2a8a5ea0b09df02a"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"c6ba8dca89f34bf8ac177668a1aaaa6b384f3744","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    return alarm_definition"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def delete_alarm_definitions(cls):"},{"line_number":92,"context_line":"    # Delete alarm definitions"},{"line_number":93,"context_line":"    resp, response_body \u003d cls.monasca_client.list_alarm_definitions()"},{"line_number":94,"context_line":"    elements \u003d response_body[\u0027elements\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_08a92224","line":91,"updated":"2015-11-18 18:17:39.000000000","message":"I think you should pass \"monasca_client\" as a parameter into this function, not cls.","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"}],"monasca_tempest_tests/tests/api/test_alarms.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"d3509250a2cd8d83d59356f71ad495de883663a6","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    @test.attr(type\u003d\"gate\")"},{"line_number":37,"context_line":"    def test_list_alarms(self):"},{"line_number":38,"context_line":"        alarm_definition_ids \u003d self._create_alarms_for_test_alarms(num\u003d1)"},{"line_number":39,"context_line":"        query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + str(alarm_definition_ids[0])"},{"line_number":40,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":41,"context_line":"        self._test_list_alarms_elements(resp, response_body,"},{"line_number":42,"context_line":"                                        expect_num_elements\u003d1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_c7aa9970","line":39,"updated":"2015-11-17 00:04:54.000000000","message":"Given the name of this test and the name of the next one \"test_list_alarms_by_alarm_definition_id\", I would expect it to do a simple list and not have a alarm_definition_id\u003d parameter. Of course, if there are multiple alarms, that makes the test harder, but it is something that should be tested","commit_id":"93991474cb0ff9fca3dc9e8ee341cc5d09617bbd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"d3509250a2cd8d83d59356f71ad495de883663a6","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                             \u0027state_updated_timestamp\u0027,"},{"line_number":52,"context_line":"                             \u0027updated_timestamp\u0027,"},{"line_number":53,"context_line":"                             \u0027created_timestamp\u0027]) \u003d\u003d"},{"line_number":54,"context_line":"                        set(element))"},{"line_number":55,"context_line":"        for metric in element[\u0027metrics\u0027]:"},{"line_number":56,"context_line":"            target_metric \u003d helpers.create_metric()"},{"line_number":57,"context_line":"            self.assertEqual(target_metric[\u0027name\u0027], metric[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_c7b6193d","line":54,"updated":"2015-11-17 00:04:54.000000000","message":"This assertTrue should be a helper method so you can reuse it below","commit_id":"93991474cb0ff9fca3dc9e8ee341cc5d09617bbd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"d3509250a2cd8d83d59356f71ad495de883663a6","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":66,"context_line":"        self._test_list_alarms_elements(resp, response_body,"},{"line_number":67,"context_line":"                                        expect_num_elements\u003d1)"},{"line_number":68,"context_line":"        element \u003d response_body[\u0027elements\u0027][0]"},{"line_number":69,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":70,"context_line":"        self._test_list_alarms_elements(resp, response_body,"},{"line_number":71,"context_line":"                                        expect_num_elements\u003d1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_07cf4157","line":68,"updated":"2015-11-17 00:04:54.000000000","message":"Why don\u0027t you validate the metrics here?","commit_id":"93991474cb0ff9fca3dc9e8ee341cc5d09617bbd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"d3509250a2cd8d83d59356f71ad495de883663a6","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_parms)"},{"line_number":87,"context_line":"        self._test_list_alarms_elements(resp, response_body,"},{"line_number":88,"context_line":"                                        expect_num_elements\u003d1)"},{"line_number":89,"context_line":"        first_element \u003d response_body[\u0027elements\u0027][0]"},{"line_number":90,"context_line":"        self.assertEqual(first_element, element)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    @test.attr(type\u003d\"gate\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_87301158","line":89,"updated":"2015-11-17 00:04:54.000000000","message":"Why don\u0027t you validate the metrics here?","commit_id":"93991474cb0ff9fca3dc9e8ee341cc5d09617bbd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91db068cec90d6e751031516e38ede19c622e483","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + str(alarm_definition_ids[0])"},{"line_number":69,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":70,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"},{"line_number":71,"context_line":"                                          expect_num_elements\u003d1)"},{"line_number":72,"context_line":"        query_parms \u003d \u0027?metric_name\u003d\u0027 + str(test_name)"},{"line_number":73,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_parms)"},{"line_number":74,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_cda32cb1","line":71,"updated":"2015-11-18 18:41:09.000000000","message":"The above three lines are the same as those in test_list_alarms_by_alarm_definition_id. What value are they adding?","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":18179,"name":"Kaiyan Sheng","email":"kaiyan.sheng@hpe.com","username":"kaiyan-sheng"},"change_message_id":"88dce8681a4eb54de766f5fef9112fad3b6aad51","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + str(alarm_definition_ids[0])"},{"line_number":69,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":70,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"},{"line_number":71,"context_line":"                                          expect_num_elements\u003d1)"},{"line_number":72,"context_line":"        query_parms \u003d \u0027?metric_name\u003d\u0027 + str(test_name)"},{"line_number":73,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_parms)"},{"line_number":74,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_7c4ae227","line":71,"in_reply_to":"ba8a016a_cda32cb1","updated":"2015-11-19 00:14:41.000000000","message":"I just wanted to make sure I get the specific alarm which just created before actually test anything. I think it\u0027s duplicated since there is a test_list_alarms_by_alarm_definition_id to do this job.","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91db068cec90d6e751031516e38ede19c622e483","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + str(alarm_definition_ids[0])"},{"line_number":87,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_param)"},{"line_number":88,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"},{"line_number":89,"context_line":"                                          expect_num_elements\u003d1)"},{"line_number":90,"context_line":"        query_parms \u003d \u0027?metric_dimensions\u003d\u0027 + test_key + \u0027:\u0027 + test_value"},{"line_number":91,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms(query_parms)"},{"line_number":92,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_ad9ca85d","line":89,"updated":"2015-11-18 18:41:09.000000000","message":"See above","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"c6ba8dca89f34bf8ac177668a1aaaa6b384f3744","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    @test.attr(type\u003d\"gate\")"},{"line_number":101,"context_line":"    def test_list_alarms_by_state(self):"},{"line_number":102,"context_line":"        helpers.delete_alarm_definitions(self)"},{"line_number":103,"context_line":"        self._create_alarms_for_test_alarms(num\u003d3)"},{"line_number":104,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms()"},{"line_number":105,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_033343f7","line":102,"updated":"2015-11-18 18:17:39.000000000","message":"You should probably just pass the monasca_client into the helper function.\n\nThe helpers are supposed to be working on many classes. If you are passing in self, then your helper is dependent on whatever class is being passed in having a variable called \"monasca_client\" in it. \n\nAdditionally, the helper methods don\u0027t require anything else in the class.","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":18179,"name":"Kaiyan Sheng","email":"kaiyan.sheng@hpe.com","username":"kaiyan-sheng"},"change_message_id":"88dce8681a4eb54de766f5fef9112fad3b6aad51","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    @test.attr(type\u003d\"gate\")"},{"line_number":101,"context_line":"    def test_list_alarms_by_state(self):"},{"line_number":102,"context_line":"        helpers.delete_alarm_definitions(self)"},{"line_number":103,"context_line":"        self._create_alarms_for_test_alarms(num\u003d3)"},{"line_number":104,"context_line":"        resp, response_body \u003d self.monasca_client.list_alarms()"},{"line_number":105,"context_line":"        self._verify_list_alarms_elements(resp, response_body,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_9c0c66ed","line":102,"in_reply_to":"ba8a016a_033343f7","updated":"2015-11-19 00:14:41.000000000","message":"Yes thank you!","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91db068cec90d6e751031516e38ede19c622e483","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                                          expect_num_elements\u003d1)"},{"line_number":262,"context_line":"        elements \u003d response_body[\u0027elements\u0027]"},{"line_number":263,"context_line":"        alarm_id \u003d elements[0][\u0027id\u0027]"},{"line_number":264,"context_line":"        updated_state \u003d \"UNDETERMINED\""},{"line_number":265,"context_line":"        resp, response_body \u003d self.monasca_client.patch_alarm("},{"line_number":266,"context_line":"            id\u003dalarm_id, state\u003dupdated_state)"},{"line_number":267,"context_line":"        self.assertEqual(200, resp.status)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_9e44681b","line":264,"updated":"2015-11-18 18:41:09.000000000","message":"There is a finite chance that the Threshold Engine will change this from UNDETERMINED to another state between the patch and the get. Not likely, but possible. Maybe you should use a different field to test patch","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91db068cec90d6e751031516e38ede19c622e483","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self.assertEqual(200, resp.status)"},{"line_number":268,"context_line":"        self._verify_alarm_keys(response_body)"},{"line_number":269,"context_line":"        # Validate the field patched"},{"line_number":270,"context_line":"        self.assertEqual(updated_state, response_body[\u0027state\u0027])"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"    @test.attr(type\u003d\"gate\")"},{"line_number":273,"context_line":"    def test_delete_alarm(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_1e687886","line":270,"updated":"2015-11-18 18:41:09.000000000","message":"You should also get the alarm just to make sure it wasn\u0027t just updated in the response from patch but was actually updated in the database","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":18179,"name":"Kaiyan Sheng","email":"kaiyan.sheng@hpe.com","username":"kaiyan-sheng"},"change_message_id":"88dce8681a4eb54de766f5fef9112fad3b6aad51","unresolved":false,"context_lines":[{"line_number":267,"context_line":"        self.assertEqual(200, resp.status)"},{"line_number":268,"context_line":"        self._verify_alarm_keys(response_body)"},{"line_number":269,"context_line":"        # Validate the field patched"},{"line_number":270,"context_line":"        self.assertEqual(updated_state, response_body[\u0027state\u0027])"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"    @test.attr(type\u003d\"gate\")"},{"line_number":273,"context_line":"    def test_delete_alarm(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_26568b2a","line":270,"in_reply_to":"ba8a016a_1e687886","updated":"2015-11-19 00:14:41.000000000","message":"That\u0027s a great point! Thanks. I will do that on test_update_alarm too.","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91db068cec90d6e751031516e38ede19c622e483","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        for j in xrange(num):"},{"line_number":425,"context_line":"            for i in xrange(60):"},{"line_number":426,"context_line":"                metric \u003d helpers.create_metric(name\u003dmetric_name,"},{"line_number":427,"context_line":"                                               dimensions\u003d{key: value})"},{"line_number":428,"context_line":"                self.monasca_client.create_metrics(metric)"},{"line_number":429,"context_line":"                time.sleep(1)"},{"line_number":430,"context_line":"                query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + \\"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_2de1989a","line":427,"updated":"2015-11-18 18:41:09.000000000","message":"Does metric vary within the loops? If not, it should be created out of the loops. Also, if it doesn\u0027t, you could return it instead of metric_name, key, value which would be more succinct and then you could pass the metric as expected_metric to self._verify_metric_in_alarm() which would also be more succinct","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"},{"author":{"_account_id":18179,"name":"Kaiyan Sheng","email":"kaiyan.sheng@hpe.com","username":"kaiyan-sheng"},"change_message_id":"88dce8681a4eb54de766f5fef9112fad3b6aad51","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        for j in xrange(num):"},{"line_number":425,"context_line":"            for i in xrange(60):"},{"line_number":426,"context_line":"                metric \u003d helpers.create_metric(name\u003dmetric_name,"},{"line_number":427,"context_line":"                                               dimensions\u003d{key: value})"},{"line_number":428,"context_line":"                self.monasca_client.create_metrics(metric)"},{"line_number":429,"context_line":"                time.sleep(1)"},{"line_number":430,"context_line":"                query_param \u003d \u0027?alarm_definition_id\u003d\u0027 + \\"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_26752bf9","line":427,"in_reply_to":"ba8a016a_2de1989a","updated":"2015-11-19 00:14:41.000000000","message":"metrics vary on time stamp but since we are not testing it, your way is absolutely better!","commit_id":"503c0b38ae49f7746b7970ac1dce78855df75d9b"}]}
