)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6231719ffb8119681d5df2e5579295ca4b1fafc8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[placement] Add to contributor docs about handler testing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"A recent IRC conversation discussed that there are generally no tests"},{"line_number":10,"context_line":"for the placement handler code (the wsgi methods that respond to each"},{"line_number":11,"context_line":"URI and HTTP method). This change adds a paragraph to point out that"},{"line_number":12,"context_line":"this is mostly intentional and that when they get complex it would"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bf659307_78c6089d","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":25},"updated":"2018-03-28 14:47:40.000000000","message":"consider linking the eavesdrop and the patch that started it all","commit_id":"5049274938489f8e2143ffec16bb38fced012613"}],"doc/source/contributor/placement.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6231719ffb8119681d5df2e5579295ca4b1fafc8","unresolved":false,"context_lines":[{"line_number":265,"context_line":"and `nova/tests/functional/db`. Adding unit and non-gabbi functional tests is"},{"line_number":266,"context_line":"done in the same way as other aspects of nova."},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"}],"source_content_type":"text/x-rst","patch_set":1,"id":"bf659307_f8d2185c","line":268,"updated":"2018-03-28 14:47:40.000000000","message":"This is a big sentence that could be refactored.  But it\u0027s aaight.","commit_id":"5049274938489f8e2143ffec16bb38fced012613"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"88f9af01458432f664c66243f453d3042e12ccad","unresolved":false,"context_lines":[{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"},{"line_number":272,"context_line":"method, independent of the handler method itself (the one decorated by the"},{"line_number":273,"context_line":"``wsgify`` method). Those handlers are supposed to be short and where there are"},{"line_number":274,"context_line":"conditionals and branching they ideally should be testable via the gabbi"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_dfc7f611","line":271,"range":{"start_line":271,"start_character":20,"end_line":271,"end_character":29},"updated":"2018-03-28 17:38:04.000000000","message":"need double that?","commit_id":"00957a93bb532e1af5660790f952a1de2af62514"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6ad626781067674d974c741de8b8dc4b235d0659","unresolved":false,"context_lines":[{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"},{"line_number":272,"context_line":"method, independent of the handler method itself (the one decorated by the"},{"line_number":273,"context_line":"``wsgify`` method). Those handlers are supposed to be short and where there are"},{"line_number":274,"context_line":"conditionals and branching they ideally should be testable via the gabbi"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_1a781c28","line":271,"range":{"start_line":271,"start_character":20,"end_line":271,"end_character":29},"in_reply_to":"bf659307_dfc7f611","updated":"2018-03-28 17:47:50.000000000","message":"Yeah, this is correct grammar.  English is silly.","commit_id":"00957a93bb532e1af5660790f952a1de2af62514"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f88cf165de877ed24b8110bd085ea2e35b586975","unresolved":false,"context_lines":[{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"},{"line_number":272,"context_line":"method, independent of the handler method itself (the one decorated by the"},{"line_number":273,"context_line":"``wsgify`` method). Those handlers are supposed to be short and where there are"},{"line_number":274,"context_line":"conditionals and branching they ideally should be testable via the gabbi"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_bab9f0e9","line":271,"range":{"start_line":271,"start_character":20,"end_line":271,"end_character":29},"in_reply_to":"bf659307_dfc7f611","updated":"2018-03-28 17:50:08.000000000","message":"Yes that\u0027s what I mean but it could probably be more clear, so I\u0027ll tidy that up after we figure out what\u0027s best to do with the next comment.","commit_id":"00957a93bb532e1af5660790f952a1de2af62514"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"88f9af01458432f664c66243f453d3042e12ccad","unresolved":false,"context_lines":[{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"},{"line_number":272,"context_line":"method, independent of the handler method itself (the one decorated by the"},{"line_number":273,"context_line":"``wsgify`` method). Those handlers are supposed to be short and where there are"},{"line_number":274,"context_line":"conditionals and branching they ideally should be testable via the gabbi"},{"line_number":275,"context_line":"functional tests. Obviously this is merely a design goal, not a strict"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_1a1d7c65","line":272,"range":{"start_line":271,"start_character":30,"end_line":272,"end_character":48},"updated":"2018-03-28 17:38:04.000000000","message":"Does this mean these extracted methods should live outside of the handler code (nova/api/openstack/placement/handlers) ?\n\nI guessed the handler code itself should be tested with the gibbi functional tests, not needed to be covered with unit tests, right?","commit_id":"00957a93bb532e1af5660790f952a1de2af62514"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f88cf165de877ed24b8110bd085ea2e35b586975","unresolved":false,"context_lines":[{"line_number":268,"context_line":"When writing tests for handler code (that is, the code found in"},{"line_number":269,"context_line":"``nova/api/openstack/placement/handlers``) a good rule of thumb is that if you"},{"line_number":270,"context_line":"feel like there needs to be a unit test for some of the code in the handler,"},{"line_number":271,"context_line":"that is a good sign that that piece of code should be extracted to a separate"},{"line_number":272,"context_line":"method, independent of the handler method itself (the one decorated by the"},{"line_number":273,"context_line":"``wsgify`` method). Those handlers are supposed to be short and where there are"},{"line_number":274,"context_line":"conditionals and branching they ideally should be testable via the gabbi"},{"line_number":275,"context_line":"functional tests. Obviously this is merely a design goal, not a strict"}],"source_content_type":"text/x-rst","patch_set":2,"id":"bf659307_dab864c9","line":272,"range":{"start_line":271,"start_character":30,"end_line":272,"end_character":48},"in_reply_to":"bf659307_1a1d7c65","updated":"2018-03-28 17:50:08.000000000","message":"I was trying not to prescriptive about where those methods go so that people can make that decision themselves, based on the individual method. Sometimes it will make sense for them to go into shared utility code, but other times not. The main idea is to make them a _unit_ so that a unit test (without mocks if possible) is straightforward to do.\n\nThe previous paragraph and next section try to make it clear that gabbi functional tests are the way to manage testing of the handlers.\n\nI\u0027m not sure what I should do to make both of these things more clear. What do you suggest?","commit_id":"00957a93bb532e1af5660790f952a1de2af62514"}]}
