)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d49244add74307eda387c5e71f3514825988a428","unresolved":false,"context_lines":[{"line_number":19,"context_line":"Following scenario specific to least routers scheduler is added:"},{"line_number":20,"context_line":"1. Router is scheduled to agent hosting least routers"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"For each of Chance and Least Router schedulers auto scheduling is also verified. "},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"A total of 22 test cases are added."},{"line_number":25,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3acd31a7_9c96d4ee","line":22,"updated":"2015-05-04 16:48:24.000000000","message":"super nit: blank at end of line.","commit_id":"9ca37974a007680cdb4bbf349faccf65bc84b28b"}],"neutron/tests/functional/scheduler/test_l3_agent_scheduler.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d49244add74307eda387c5e71f3514825988a428","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"class L3ChanceSchedulerTestCase(L3SchedulerBaseTest):"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    \"\"\"Test various scenarios for chance schedule."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        agent_count"},{"line_number":62,"context_line":"            Number of l3 agents (also number of hosts)."}],"source_content_type":"text/x-python","patch_set":4,"id":"3acd31a7_7c1c1877","line":59,"updated":"2015-05-04 16:48:24.000000000","message":"nit: schedule -\u003e scheduler","commit_id":"9ca37974a007680cdb4bbf349faccf65bc84b28b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d49244add74307eda387c5e71f3514825988a428","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class L3LeastRoutersSchedulerTestCase(L3SchedulerBaseTest):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    \"\"\"Test various scenarios for least router schedule."},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        agent_count"},{"line_number":190,"context_line":"            Number of l3 agents (also number of hosts)."}],"source_content_type":"text/x-python","patch_set":4,"id":"3acd31a7_cfba5023","line":187,"updated":"2015-05-04 16:48:24.000000000","message":"nit: scheduler","commit_id":"9ca37974a007680cdb4bbf349faccf65bc84b28b"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e18137f19d96fbae71517aba7335ad3e7eb6e9f","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            router_to_schedule \u003d self._create_router(\u0027schd_rtr\u0027)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        # schedule:"},{"line_number":147,"context_line":"        actual_scheduled_agent \u003d self.scheduler.schedule(self.plugin,"},{"line_number":148,"context_line":"                                                     self.adminContext,"},{"line_number":149,"context_line":"                                                     router_to_schedule[\u0027id\u0027])"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1aca2d91_ea6e38c8","line":147,"updated":"2015-05-07 20:25:02.000000000","message":"nit: bring it to the next line.","commit_id":"4a1644d35f1caa1f1f0f6bcc675f10b5c4e94968"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e18137f19d96fbae71517aba7335ad3e7eb6e9f","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        did_it_schedule \u003d False"},{"line_number":172,"context_line":"        # Try scheduling on each host"},{"line_number":173,"context_line":"        for host in self.hosts:"},{"line_number":174,"context_line":"            did_it_schedule \u003d self.scheduler.auto_schedule_routers(self.plugin,"},{"line_number":175,"context_line":"                                                       self.adminContext, host,"},{"line_number":176,"context_line":"                                                       router_ids)"},{"line_number":177,"context_line":"            if did_it_schedule:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aca2d91_6a6348dd","line":174,"updated":"2015-05-07 20:25:02.000000000","message":"nit: ditto","commit_id":"4a1644d35f1caa1f1f0f6bcc675f10b5c4e94968"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e18137f19d96fbae71517aba7335ad3e7eb6e9f","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            # For cases where no router is scheduled or expected."},{"line_number":280,"context_line":"            router_to_schedule \u003d self._create_router(\u0027schd_rtr\u0027)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        actual_scheduled_agent \u003d self.scheduler.schedule(self.plugin,"},{"line_number":283,"context_line":"                                                      self.adminContext,"},{"line_number":284,"context_line":"                                                      router_to_schedule[\u0027id\u0027])"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1aca2d91_6aba2825","line":282,"updated":"2015-05-07 20:25:02.000000000","message":"nit: ditto","commit_id":"4a1644d35f1caa1f1f0f6bcc675f10b5c4e94968"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e18137f19d96fbae71517aba7335ad3e7eb6e9f","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                               message\u003d\u0027The expected agent was not scheduled\u0027)"},{"line_number":295,"context_line":"        else:"},{"line_number":296,"context_line":"            self.assertIsNone(actual_scheduled_agent,"},{"line_number":297,"context_line":"                              message\u003d\u0027Expeced no agent to be scheduled,\u0027"},{"line_number":298,"context_line":"                                      \u0027 but it got scheduled\u0027)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def test_auto_schedule_routers(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aca2d91_caf6dcf8","line":297,"updated":"2015-05-07 20:25:02.000000000","message":"nit: Typo. \"Expected\".","commit_id":"4a1644d35f1caa1f1f0f6bcc675f10b5c4e94968"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3e18137f19d96fbae71517aba7335ad3e7eb6e9f","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        did_it_schedule \u003d False"},{"line_number":314,"context_line":"        # Try scheduling on each host"},{"line_number":315,"context_line":"        for host in self.hosts:"},{"line_number":316,"context_line":"            did_it_schedule \u003d self.scheduler.auto_schedule_routers(self.plugin,"},{"line_number":317,"context_line":"                                                       self.adminContext, host,"},{"line_number":318,"context_line":"                                                       router_ids)"},{"line_number":319,"context_line":"            if did_it_schedule:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aca2d91_ca7ffc64","line":316,"updated":"2015-05-07 20:25:02.000000000","message":"nit: ditto","commit_id":"4a1644d35f1caa1f1f0f6bcc675f10b5c4e94968"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"694595f0b5c465356908f2f5c1d9e9f7da547e42","unresolved":false,"context_lines":[{"line_number":317,"context_line":"        did_it_schedule \u003d False"},{"line_number":318,"context_line":"        # Try scheduling on each host"},{"line_number":319,"context_line":"        for host in self.hosts:"},{"line_number":320,"context_line":"            did_it_schedule \u003d self.scheduler.auto_schedule_routers("},{"line_number":321,"context_line":"                                                       self.plugin,"},{"line_number":322,"context_line":"                                                       self.adminContext,"},{"line_number":323,"context_line":"                                                       host,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_164bb0b1","line":320,"updated":"2015-06-16 10:18:11.000000000","message":"a lot of this logic is duplicated between the two tests. can you move helpers into a common parent class so each test case is the scenarios and only logic specific to that scheduler?","commit_id":"5d1834bb01727e79cf0b30ac41f04e43630146e9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"722a7c899c0c091deca6d8711e24faed98f988fa","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class L3SchedulerBaseTest(test_db_base_plugin_v2.NeutronDbPluginV2TestCase,"},{"line_number":31,"context_line":"                          test_l3_agent_scheduler.L3SchedulerBaseMixin):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    \"\"\"Base class for functional test of L3 schedulers."},{"line_number":34,"context_line":"       Provides basic setup and utility functions."}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_332604cf","line":31,"updated":"2015-07-18 16:41:55.000000000","message":"You can stop inheriting from test_l3_agent_scheduler.L3SchedulerBaseMixin then in line 49 use helpers.set_agent_admin_state. Simpler, less usages of that stupid mixin... Win win.","commit_id":"0e756d79b921720e29b57da4387d25fc27a75654"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"722a7c899c0c091deca6d8711e24faed98f988fa","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def setUp(self):"},{"line_number":38,"context_line":"        ext_mgr \u003d test_l3.L3TestExtensionManager()"},{"line_number":39,"context_line":"        plugin_str \u003d (\u0027neutron.tests.unit.extensions.test_l3.\u0027"},{"line_number":40,"context_line":"                      \u0027TestL3NatIntAgentSchedulingPlugin\u0027)"},{"line_number":41,"context_line":"        super(L3SchedulerBaseTest, self).setUp(plugin\u003dplugin_str,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_f3817c90","line":38,"updated":"2015-07-18 16:41:55.000000000","message":"With unit tests you want to execute the minimal set of code that will allow you to test whatever it is you\u0027re trying to test in relative isolation. Here, I think the intention is to execute actual production code (i.e. not a fake plugin). This will help us catch regressions caused by changes to the L3RouterPlugin class such as the order of inheritance.\n\nI checked locally, you can just import neutron.extensions.l3 as l3_ext,\next_mgr \u003d l3_ext.L3()\nplugin_str \u003d (\u0027neutron.services.l3_router.l3_router_plugin.\u0027\n                      \u0027L3RouterPlugin\u0027)\n\nAnd the tests continue to pass.","commit_id":"0e756d79b921720e29b57da4387d25fc27a75654"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"722a7c899c0c091deca6d8711e24faed98f988fa","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _create_legacy_agents(self, agent_count, down_agent_count):"},{"line_number":58,"context_line":"        # Creates legacy l3 agents and sets admin state based on"},{"line_number":59,"context_line":"        #  down agent count."},{"line_number":60,"context_line":"        self.hosts \u003d [\u0027host-%s\u0027 % i for i in range(agent_count)]"},{"line_number":61,"context_line":"        self.l3_agents \u003d [self._create_l3_agent(self.hosts[i],"},{"line_number":62,"context_line":"               self.adminContext, \u0027legacy\u0027, self.plugin,"},{"line_number":63,"context_line":"               (i \u003e\u003d down_agent_count)) for i in range(agent_count)]"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_16196e79","line":60,"updated":"2015-07-18 16:41:55.000000000","message":"Setting instance variables makes it harder to read tests. To put it another way, tests are easy to read if all of the state that they require is presented in the test itself, and not in the test\u0027s setUp or the setUp of a class it inherits from. It makes sense to set up infrastructure classes like the test\u0027s environment (plugin, scheduler, etc) because that doesn\u0027t add cognitive load, but, actual state like the number of hosts / agents / routers makes me desperately sad. It\u0027s possible to instead make these stateless functions (No side effects) that instead of setting self.hosts or self.routers, instead return a list of routers (For example).\n\nSo, _create_routers changes from:\n\n  self.routers \u003d []\n  do stuff\n\nto:\n\n  routers \u003d []\n  do stuff\n  return routers","commit_id":"0e756d79b921720e29b57da4387d25fc27a75654"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"722a7c899c0c091deca6d8711e24faed98f988fa","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            hosting_agents.append(agent)"},{"line_number":81,"context_line":"        return hosting_agents"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _get_router_to_schedule(self):"},{"line_number":84,"context_line":"        # Last router is the one to be scheduled,"},{"line_number":85,"context_line":"        # others, if any, have been scheduled already."},{"line_number":86,"context_line":"        # We create one for cases where no router is scheduled or expected."}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_363b52d3","line":83,"updated":"2015-07-18 16:41:55.000000000","message":"I\u0027d much rather you get rid of this function and make it explicit instead. It hides important details when you read the tests themselves, and the name is pretty deceiving. You should be able to read a test half asleep without paying too much attention and knowing all of the internal details of the utility methods the test executes, whenever possible.","commit_id":"0e756d79b921720e29b57da4387d25fc27a75654"}]}
