)]}'
{"keystone/tests/unit/test_backend_sql.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"4ba64c56a3404efa12452e63c93872f0c150c24b","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        _exercise_project_api(uuid.uuid4().hex)"},{"line_number":603,"context_line":"        _exercise_project_api(resource.NULL_DOMAIN_ID)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_list_users_call_count(self):"},{"line_number":606,"context_line":"        \"\"\"There should not be O(N) queries\"\"\""},{"line_number":607,"context_line":"        for i in range(15):"},{"line_number":608,"context_line":"            user \u003d unit.new_user_ref(domain_id\u003dCONF.identity.default_domain_id)"},{"line_number":609,"context_line":"            self.identity_api.create_user(user)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"        class CallCounter(object):"},{"line_number":612,"context_line":"            def __init__(self):"},{"line_number":613,"context_line":"                self.calls \u003d 0"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"            def query_counter(self, query):"},{"line_number":616,"context_line":"                self.calls +\u003d 1"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"        counter \u003d CallCounter()"},{"line_number":619,"context_line":"        sqlalchemy.event.listen(sqlalchemy.orm.query.Query, \u0027before_compile\u0027,"},{"line_number":620,"context_line":"                                counter.query_counter)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        self.identity_api.list_users()"},{"line_number":623,"context_line":"        self.assertThat(counter.calls, matchers.LessThan(10))"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"class SqlTrust(SqlTests, trust_tests.TrustTests):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_23119aad","line":623,"range":{"start_line":605,"start_character":4,"end_line":623,"end_character":61},"updated":"2016-07-27 20:00:12.000000000","message":"it would be nice to add comments inline \n\n  # create 15 users\n\n  # sqlalchemy allows a class to listen ..\n\n  # ensure we have less than 10 calls to ...","commit_id":"f46e9a06e3a6c32974bd056b2d30cd7961c817a0"},{"author":{"_account_id":8978,"name":"Marek Denis","email":"marek.denis+openstack@gmail.com","username":"marek-denis"},"change_message_id":"e270b4a7eb470f22d5fffac9acc41b6f3c6c795c","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        _exercise_project_api(uuid.uuid4().hex)"},{"line_number":603,"context_line":"        _exercise_project_api(resource.NULL_DOMAIN_ID)"},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"    def test_list_users_call_count(self):"},{"line_number":606,"context_line":"        \"\"\"There should not be O(N) queries.\"\"\""},{"line_number":607,"context_line":"        for i in range(15):"},{"line_number":608,"context_line":"            user \u003d unit.new_user_ref(domain_id\u003dCONF.identity.default_domain_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_21d05d53","line":605,"updated":"2016-07-28 08:12:20.000000000","message":"I think you owe some explanation to the readers. What\u0027s the relation between numbers 10 and 15? I can imagine 15 is some random number, but why there should be less calls than 10?","commit_id":"1eb87dc4bee16de0133832a3378b8c2c4660d78c"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"c03e3e89d3d517d0863f185a39d89bf310f2ca6a","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                                counter.query_counter)"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"        self.identity_api.list_users()"},{"line_number":627,"context_line":"        # ensure that we have less than 15 calls. It would mean that there is"},{"line_number":628,"context_line":"        # no linear complexity"},{"line_number":629,"context_line":"        self.assertThat(counter.calls, matchers.LessThan(15))"},{"line_number":630,"context_line":""},{"line_number":631,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_0c91fef0","line":628,"range":{"start_line":627,"start_character":10,"end_line":628,"end_character":30},"updated":"2016-07-28 13:47:32.000000000","message":"Wouldn\u0027t be linear even with 10, 11, 12, 13 and 14 calls? In this way I think you need to check the query itself and verify that \"list_user query\" and whatever is needed to \"build\" it (like querying its subtables) was triggered only once.","commit_id":"d1615827ae5fe3d0581046f43367cba4d748f609"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"024aa383dfc2dff9598334a64b6ace22ab23513f","unresolved":false,"context_lines":[{"line_number":637,"context_line":"        # ensure that the number of calls does not depend on the number of"},{"line_number":638,"context_line":"        # users fetched."},{"line_number":639,"context_line":"        self.assertNotEqual(len(first_call_users), len(second_call_users))"},{"line_number":640,"context_line":"        self.assertEqual(first_call_counter, counter.calls)"},{"line_number":641,"context_line":""},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"class SqlTrust(SqlTests, trust_tests.TrustTests):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bacf61ea_b01be01a","line":640,"updated":"2016-07-28 14:22:48.000000000","message":"nice!","commit_id":"8246fc2c359e75ec436e53ae82c9a01ccf6831c0"}]}
