)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"b15127f863a4cc0adace443e87e619c1c38d91aa","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"self.clients and self.admin_clients are mocked out in all sorts of fun"},{"line_number":10,"context_line":"and interesting ways in the Scenario test cases, but rarely is it done"},{"line_number":11,"context_line":"the same way twice. Many of the tests fail to distinguish between a"},{"line_number":12,"context_line":"call to self.clients and a call to self.admin_clients, and all (or"},{"line_number":13,"context_line":"nearly all) don\u0027t distinguish between clients -- that is, if a test"},{"line_number":14,"context_line":"expects a call to self.clients(\"nova\").foo, that would be satisfied by"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3afb71cf_3a4cb041","line":11,"updated":"2015-06-06 17:27:00.000000000","message":"LOLLLL","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"}],"rally/plugins/openstack/scenarios/designate/utils.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c14853028bf6ee301106088a2ed67e3c68928f15","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if atomic_action:"},{"line_number":94,"context_line":"            with base.AtomicAction(self, \"designate.delete_record\"):"},{"line_number":95,"context_line":"                client.records.delete(domain_id, record_id)"},{"line_number":96,"context_line":"        else:"},{"line_number":97,"context_line":"            client.records.delete(domain_id, record_id)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @base.atomic_action_timer(\"designate.create_server\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_da691c8d","line":96,"updated":"2015-06-06 17:47:03.000000000","message":"ouch...\n\nWe should split this in separate patch and link a bug.","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a70749d39366f352769c49c604f352c976b5f431","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if atomic_action:"},{"line_number":94,"context_line":"            with base.AtomicAction(self, \"designate.delete_record\"):"},{"line_number":95,"context_line":"                client.records.delete(domain_id, record_id)"},{"line_number":96,"context_line":"        else:"},{"line_number":97,"context_line":"            client.records.delete(domain_id, record_id)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @base.atomic_action_timer(\"designate.create_server\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_2fd7b0ee","line":96,"in_reply_to":"3afb71cf_da691c8d","updated":"2015-06-08 15:59:14.000000000","message":"Done","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"}],"rally/plugins/openstack/scenarios/sahara/utils.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c14853028bf6ee301106088a2ed67e3c68928f15","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                        return net[\"id\"]"},{"line_number":127,"context_line":"                # If the name is not found in the list. Exit with error."},{"line_number":128,"context_line":"                raise exceptions.BenchmarkSetupFailure("},{"line_number":129,"context_line":"                    \"Could not resolve Floating IP Pool name %s to id\" %"},{"line_number":130,"context_line":"                    name_or_id)"},{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            # Pool is not provided. Using the one set as GW for current router."}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_5a140cf4","line":129,"updated":"2015-06-06 17:47:03.000000000","message":"We should do this in separated patch and make hacking rule for it: \n\nhttps://github.com/openstack/rally/tree/master/tests/hacking","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a70749d39366f352769c49c604f352c976b5f431","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                        return net[\"id\"]"},{"line_number":127,"context_line":"                # If the name is not found in the list. Exit with error."},{"line_number":128,"context_line":"                raise exceptions.BenchmarkSetupFailure("},{"line_number":129,"context_line":"                    \"Could not resolve Floating IP Pool name %s to id\" %"},{"line_number":130,"context_line":"                    name_or_id)"},{"line_number":131,"context_line":"        else:"},{"line_number":132,"context_line":"            # Pool is not provided. Using the one set as GW for current router."}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_aa5b8ef5","line":129,"in_reply_to":"3afb71cf_5a140cf4","updated":"2015-06-08 15:59:14.000000000","message":"Moved to a separate patch.\n\nUnfortunately I don\u0027t think flake8/hacking is powerful enough to actually check for this sort of thing in all cases. For instance, consider:\n\n    vars \u003d {\"name\": name_or_id}\n    raise exceptions.BenchmarkSetupFailure(\"Could not resolve Floating IP Pool name %(name)s to id\" % vars)\n\nThe logical \u0027raise\u0027 line there is, as far as flake8 is concerned, identical to the one that I fixed in this patch. The only way you can tell if that string formatting is valid is to do type inspection on \u0027vars\u0027, which flake8 doesn\u0027t do.","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"}],"tests/unit/test.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"d2d89c15379cec1e0c19fa82680e035536b09dd6","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        return self.clients(client_type, version\u003dversion, admin\u003dTrue)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def client_created(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":79,"context_line":"        \"\"\"Determine if a client has been created."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        This can be used to see if a scenario calls"},{"line_number":82,"context_line":"        \u0027self.clients(\"foo\")\u0027, without checking to see what was done"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_7ae7c8e4","line":79,"updated":"2015-06-06 18:00:52.000000000","message":"Okay I am not sure that we need to have this method at all. \n\nIf we are using this class (instead of direct mocking) this method will just check that logic of clients() and admin_clients() are proper..","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a70749d39366f352769c49c604f352c976b5f431","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        return self.clients(client_type, version\u003dversion, admin\u003dTrue)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def client_created(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":79,"context_line":"        \"\"\"Determine if a client has been created."},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        This can be used to see if a scenario calls"},{"line_number":82,"context_line":"        \u0027self.clients(\"foo\")\u0027, without checking to see what was done"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_6afeb639","line":79,"in_reply_to":"3afb71cf_7ae7c8e4","updated":"2015-06-08 15:59:14.000000000","message":"This function is only used in one test, to verify the keystone authentication scenario, where we need to ensure that `self.clients(\"keystone\")\u0027 was called. Nothing is done with the keystone client in the scenario. How would we structure that unit test without this function?","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"d2d89c15379cec1e0c19fa82680e035536b09dd6","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def setUp(self):"},{"line_number":89,"context_line":"        super(TestCase, self).setUp()"},{"line_number":90,"context_line":"        self.use_fake_clients \u003d False"},{"line_number":91,"context_line":"        self._fake_clients \u003d fakes.FakeClients()"},{"line_number":92,"context_line":"        self._clients \u003d {}"},{"line_number":93,"context_line":"        self._client_mocks \u003d ["}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_9ae284d4","line":90,"updated":"2015-06-06 18:00:52.000000000","message":"I would prefer to inherit this class and create one more class \n\n  class FakeClientsTestCase(ClientTestCase): \n      self.use_fake_clients \u003d True \n\n\nSo we won\u0027t make nasty typos..","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a70749d39366f352769c49c604f352c976b5f431","unresolved":false,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def setUp(self):"},{"line_number":89,"context_line":"        super(TestCase, self).setUp()"},{"line_number":90,"context_line":"        self.use_fake_clients \u003d False"},{"line_number":91,"context_line":"        self._fake_clients \u003d fakes.FakeClients()"},{"line_number":92,"context_line":"        self._clients \u003d {}"},{"line_number":93,"context_line":"        self._client_mocks \u003d ["}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_0a618239","line":90,"in_reply_to":"3afb71cf_9ae284d4","updated":"2015-06-08 15:59:14.000000000","message":"Done.","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"d2d89c15379cec1e0c19fa82680e035536b09dd6","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            patcher.start()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def tearDown(self):"},{"line_number":103,"context_line":"        super(TestCase, self).tearDown()"},{"line_number":104,"context_line":"        for patcher in self._client_mocks:"},{"line_number":105,"context_line":"            patcher.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_da735c4c","line":103,"updated":"2015-06-06 18:00:52.000000000","message":"There is rule to put super.tearDown() call at the last line of tearDown() method. \n\nE.g. \n\n   A1.setUp()\n      A2.setUp()\n        A3.setUp()\n        A3.tearDown()\n      A2.tearDown()\n   A1.tearDown()","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"a70749d39366f352769c49c604f352c976b5f431","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            patcher.start()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def tearDown(self):"},{"line_number":103,"context_line":"        super(TestCase, self).tearDown()"},{"line_number":104,"context_line":"        for patcher in self._client_mocks:"},{"line_number":105,"context_line":"            patcher.stop()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_aa294e39","line":103,"in_reply_to":"3afb71cf_da735c4c","updated":"2015-06-08 15:59:14.000000000","message":"Done","commit_id":"ab7a1c1a597123c2b53f060122635786ba05cc98"},{"author":{"_account_id":13609,"name":"Pavel Boldin","email":"pboldin@mirantis.com","username":"pboldin"},"change_message_id":"8e94522007e4c4bc82f14d9eac1f86da79b4fb5b","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def client_factory(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":65,"context_line":"        \"\"\"Create a new client object.\"\"\""},{"line_number":66,"context_line":"        return mock.MagicMock()"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def clients(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":69,"context_line":"        \"\"\"Get a mocked client.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3afb71cf_88b86c76","line":66,"updated":"2015-06-10 15:08:12.000000000","message":"Let\u0027s pass client_type, version and admin to the mock:\n return mock.MagicMock(_client_type\u003dclient_type etc)","commit_id":"148be973a33b0e8f8b5db5f9fca851374b865167"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"dfab5cac8301d1883b17771afd73fafede1f28a0","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def client_factory(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":65,"context_line":"        \"\"\"Create a new client object.\"\"\""},{"line_number":66,"context_line":"        return mock.MagicMock()"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def clients(self, client_type, version\u003dNone, admin\u003dFalse):"},{"line_number":69,"context_line":"        \"\"\"Get a mocked client.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3afb71cf_8ea4f5b9","line":66,"in_reply_to":"3afb71cf_88b86c76","updated":"2015-06-10 15:14:47.000000000","message":"I\u0027ve gone with just \u0027client_type\u0027, etc., instead of \u0027_client_type\u0027, principally for \u0027version\u0027, which is a real attribute on many (most?) client objects. I don\u0027t believe client_type or admin will clobber any real attributes of any client objects.","commit_id":"148be973a33b0e8f8b5db5f9fca851374b865167"}]}
