)]}'
{"nova/openstack/common/log.py":[{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"4ca450bed84ac292b900b6040e594bbac8b1e1b7","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    return logging_excepthook"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"def setup(product_name, stream\u003dNone):"},{"line_number":279,"context_line":"    \"\"\"Setup logging.\"\"\""},{"line_number":280,"context_line":"    sys.excepthook \u003d _create_logging_excepthook(product_name)"},{"line_number":281,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAMX%2F%2F%2F20%3D","line":278,"updated":"2012-12-03 00:40:45.000000000","message":"This change should go into oslo first - http://wiki.openstack.org/Oslo","commit_id":"0543153a5387bf9f998c2d954f34f2e37e76de40"}],"nova/test.py":[{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"94e4af02f443879b867edc04a9c0f6bcb40ebb34","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            return [stderr.getvalue()]"},{"line_number":209,"context_line":"        self.addDetail(\u0027stderr\u0027,"},{"line_number":210,"context_line":"                       testtools.content.Content("},{"line_number":211,"context_line":"                           testtools.content_type.UTF8_TEXT, get_bytes))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class TestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAMX%2F%2F5Qw%3D","line":211,"updated":"2012-12-10 07:18:15.000000000","message":"refactor:\n\n class StdStreamCapture(fixtures.Fixture):\n\n     stream \u003d None\n\n     def setUp(self):\n         super(StdStreamCapture, self).setUp()\n         self.addCleanup(setattr, sys, self.stream, getattr(sys, self.stream))\n         buf \u003d StringIO.StringIO()\n         setattr(sys, self.stream, buf)\n\n         def get_bytes():\n             return [buf.getvalue()]\n         self.addDetail(self.stream\n                        testtools.content.Content(\n                            testtools.content_type.UTF8_TEXT, get_bytes))\n\n\n class StdOutStreamCapture(StdStreamCapture):\n\n     stream \u003d \u0027stdout\u0027\n\n\n class StdErrStreamCapture(StdStreamCapture):\n\n     stream \u003d \u0027stderr\u0027","commit_id":"37fdc2a18212eedc913b367648d2499bff334514"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"4f4bfd27d849be2b09f7193d4e57b8680af520eb","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            return [stderr.getvalue()]"},{"line_number":209,"context_line":"        self.addDetail(\u0027stderr\u0027,"},{"line_number":210,"context_line":"                       testtools.content.Content("},{"line_number":211,"context_line":"                           testtools.content_type.UTF8_TEXT, get_bytes))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class TestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAMX%2F%2F4hk%3D","line":211,"in_reply_to":"AAAAMX%2F%2F4qI%3D","updated":"2012-12-10 22:16:27.000000000","message":"passing a stream to the constructor is definitely better. Looking at this there are the following bits:\nmonkey patching a thing in sys\nbuffering a stream \nexposing that as a detail\n\nThe MonkeyPatch fixture does monkey patching. so I would write this as\nclass DetailStream(fixtures.Fixture):\n    \"\"\"Provide a file-like object and expose it as a detail.\n\n    :attr stream: The file-like object.\n    \"\"\"\n\n    def __init__(self, detail_name):\n        \"\"\"Create a DetailStream.\n\n        :param detail_name: Use this as the name of the stream.\n        \"\"\"\n        self._detail_name \u003d detail_name\n\n    def setUp(self):\n        super(DetailStream, self).setUp()\n        self.stream \u003d StringIO.StringIO()\n        self.addDetail(self._detail_name, content_from_stream(self.stream))\n\n#content_from_stream is in testtools.content. We may not be able to use it due to it not seeking - if thats the case, the spelling you had is fine, though I would use a lambda, it being so simple:\n    def setUp(self):\n        super(DetailStream, self).setUp()\n        # Capture in locals() for the lambda below\n        stream \u003d StringIO.StringIO()\n        self.stream \u003d stream\n        self.addDetail(self._detail_name, testtools.content.Content(\n                            testtools.content_type.UTF8_TEXT,\n                            lambda:[stream.getvalue()]))\n\nand then - if this is once just twice, do:\n    stdout \u003d self.useFixture(DetailStream(\u0027stdout\u0027)).stream\n    self.useFixture(MonkeyPatch(\u0027sys.stdout\u0027, stdout))\n    stderr \u003d self.useFixture(DetailStream(\u0027stderr\u0027)).stream\n    self.useFixture(MonkeyPatch(\u0027sys.stderr\u0027, stderr))\n\nRather than having the two things conflated. if its used a lot and the conflation will pay for itself, then lets do two new fixtures, one lower layer, and one to mix them up.","commit_id":"37fdc2a18212eedc913b367648d2499bff334514"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"dd774509bdc307fc244777e0080e497551d11fa9","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            return [stderr.getvalue()]"},{"line_number":209,"context_line":"        self.addDetail(\u0027stderr\u0027,"},{"line_number":210,"context_line":"                       testtools.content.Content("},{"line_number":211,"context_line":"                           testtools.content_type.UTF8_TEXT, get_bytes))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class TestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAMX%2F%2F4qI%3D","line":211,"in_reply_to":"AAAAMX%2F%2F5Qw%3D","updated":"2012-12-10 20:59:02.000000000","message":"Or how about:\n\nclass StreamCapture(fixtures.Fixture):\n\n    def __init__(self, stream):\n        self.stream \u003d stream\n...","commit_id":"37fdc2a18212eedc913b367648d2499bff334514"}],"nova/tests/compute/test_compute_utils.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"d5ee59d3aa69326a9d69de4178f05218facbe6d5","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        notifier_api._reset_drivers()"},{"line_number":219,"context_line":"        self.flags(use_local\u003dTrue, group\u003d\u0027conductor\u0027)"},{"line_number":220,"context_line":"        notifier_api._reset_drivers()"},{"line_number":221,"context_line":"        self.flags(compute_driver\u003d\u0027nova.virt.fake.FakeDriver\u0027,"},{"line_number":222,"context_line":"                   notification_driver\u003d[test_notifier.__name__],"},{"line_number":223,"context_line":"                   network_manager\u003d\u0027nova.network.manager.FlatManager\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAMX%2F%2F%2F4c%3D","line":220,"updated":"2012-12-02 23:28:34.000000000","message":"This line isn\u0027t necessary as the reset happens two lines up.","commit_id":"0543153a5387bf9f998c2d954f34f2e37e76de40"}],"nova/tests/hyperv/basetestcase.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"98bab8d097bf7da481b2d8ee477267acc761d598","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def tearDown(self):"},{"line_number":43,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        has_errors \u003d len([test for (test, msgs) in self._currentResult.decorated.errors"},{"line_number":46,"context_line":"            if test.id() \u003d\u003d self.id()]) \u003e 0"},{"line_number":47,"context_line":"        failed \u003d len([test for (test, msgs) in self._currentResult.decorated.failures"},{"line_number":48,"context_line":"            if test.id() \u003d\u003d self.id()]) \u003e 0"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALn%2F%2F3Dk%3D","line":45,"updated":"2012-10-31 21:56:04.000000000","message":"Using decorated here assumes that subunit (under testr) is the test runner. Is it possible to simply not worry about saving things? Or perhaps there is a better way to check if things were successful or not.","commit_id":"4b06a35bbdc6139a851ec979188cd94173e0d1d3"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1e9ac4bb8e7b92369a608bb995df95721e9203f2","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def tearDown(self):"},{"line_number":43,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        has_errors \u003d len([test for (test, msgs) in self._currentResult.decorated.errors"},{"line_number":46,"context_line":"            if test.id() \u003d\u003d self.id()]) \u003e 0"},{"line_number":47,"context_line":"        failed \u003d len([test for (test, msgs) in self._currentResult.decorated.failures"},{"line_number":48,"context_line":"            if test.id() \u003d\u003d self.id()]) \u003e 0"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F5zo%3D","line":45,"in_reply_to":"AAAALn%2F%2F3Dk%3D","updated":"2012-11-16 09:35:53.000000000","message":"We need a way to get the result of the test in tearDown. The actual implementation can be replaced. Contact me on Irc (alexpilotti) if you\u0027d like to discuss it.","commit_id":"4b06a35bbdc6139a851ec979188cd94173e0d1d3"}],"nova/tests/integrated/test_api_samples.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6aeb293fae9d70558bac43155e035fa802447cce","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from lxml import etree"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from nova.api.openstack.compute import extensions"},{"line_number":26,"context_line":"from nova.cloudpipe.pipelib import CloudPipe"},{"line_number":27,"context_line":"from nova.compute import api"},{"line_number":28,"context_line":"from nova import context"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAMX%2F%2Fz6U%3D","line":25,"updated":"2012-12-14 16:18:24.000000000","message":"Why is this import needed?","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f68e2f225b99909e05db5975539330e24a5668a8","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from lxml import etree"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from nova.api.openstack.compute import extensions"},{"line_number":26,"context_line":"from nova.cloudpipe.pipelib import CloudPipe"},{"line_number":27,"context_line":"from nova.compute import api"},{"line_number":28,"context_line":"from nova import context"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAMX%2F%2Fz1U%3D","line":25,"in_reply_to":"AAAAMX%2F%2Fz30%3D","updated":"2012-12-14 17:35:06.000000000","message":"OK, that makes sense.  Please add a comment to that effect just before this import; otherwise, I\u0027m sure *someone* will decide it\u0027s unneeded and try to remove it :)\n\n(Same goes for the other instance, of course.)","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"113a309f5a80e5a6b592a8a161d04d6b252dbcc4","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from lxml import etree"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from nova.api.openstack.compute import extensions"},{"line_number":26,"context_line":"from nova.cloudpipe.pipelib import CloudPipe"},{"line_number":27,"context_line":"from nova.compute import api"},{"line_number":28,"context_line":"from nova import context"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAMX%2F%2Fz30%3D","line":25,"in_reply_to":"AAAAMX%2F%2Fz6U%3D","updated":"2012-12-14 17:11:34.000000000","message":"Because\n  CONF.import_opt(\u0027osapi_compute_extension\u0027, \u0027nova.config\u0027)\n\nis set in nova.api.openstack.compute.extensions now and if we don\u0027t explicitly import that module the config option may not be available to us when tests run.","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"}],"nova/tests/integrated/test_extensions.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6aeb293fae9d70558bac43155e035fa802447cce","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from nova.api.openstack.compute import extensions"},{"line_number":19,"context_line":"from nova.openstack.common import cfg"},{"line_number":20,"context_line":"from nova.openstack.common.log import logging"},{"line_number":21,"context_line":"from nova.tests.integrated import integrated_helpers"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAMX%2F%2Fz6Q%3D","line":18,"updated":"2012-12-14 16:18:24.000000000","message":"Why is this import needed?","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"113a309f5a80e5a6b592a8a161d04d6b252dbcc4","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from nova.api.openstack.compute import extensions"},{"line_number":19,"context_line":"from nova.openstack.common import cfg"},{"line_number":20,"context_line":"from nova.openstack.common.log import logging"},{"line_number":21,"context_line":"from nova.tests.integrated import integrated_helpers"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAMX%2F%2Fz3w%3D","line":18,"in_reply_to":"AAAAMX%2F%2Fz6Q%3D","updated":"2012-12-14 17:11:34.000000000","message":"Because\nCONF.import_opt(\u0027osapi_compute_extension\u0027, \u0027nova.config\u0027)\n\nis set in nova.api.openstack.compute.extensions now and if we don\u0027t explicitly import that module the config option may not be available to us when tests run.","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"}],"run_tests.sh":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6aeb293fae9d70558bac43155e035fa802447cce","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  echo \"  -s, --no-site-packages   Isolate the virtualenv from the global Python environment\""},{"line_number":12,"context_line":"  echo \"  -r, --recreate-db        Recreate the test database (deprecated, as this is now the default).\""},{"line_number":13,"context_line":"  echo \"  -n, --no-recreate-db     Don\u0027t recreate the test database.\""},{"line_number":14,"context_line":"  echo \"  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added.\""},{"line_number":15,"context_line":"  echo \"  -p, --pep8               Just run PEP8 and HACKING compliance check\""},{"line_number":16,"context_line":"  echo \"  -P, --no-pep8            Don\u0027t run static code checks\""},{"line_number":17,"context_line":"  echo \"  -c, --coverage           Generate coverage report\""}],"source_content_type":"text/x-sh","patch_set":26,"id":"AAAAMX%2F%2Fz6E%3D","line":14,"updated":"2012-12-14 16:18:24.000000000","message":"Bummer that -x and -d are gone; I assume there\u0027s no way to restore that functionality?","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"51cc05a80e786d6378a3ce3162d47cf93f64d7fe","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  echo \"  -s, --no-site-packages   Isolate the virtualenv from the global Python environment\""},{"line_number":12,"context_line":"  echo \"  -r, --recreate-db        Recreate the test database (deprecated, as this is now the default).\""},{"line_number":13,"context_line":"  echo \"  -n, --no-recreate-db     Don\u0027t recreate the test database.\""},{"line_number":14,"context_line":"  echo \"  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added.\""},{"line_number":15,"context_line":"  echo \"  -p, --pep8               Just run PEP8 and HACKING compliance check\""},{"line_number":16,"context_line":"  echo \"  -P, --no-pep8            Don\u0027t run static code checks\""},{"line_number":17,"context_line":"  echo \"  -c, --coverage           Generate coverage report\""}],"source_content_type":"text/x-sh","patch_set":26,"id":"AAAAMX%2F%2FzmM%3D","line":14,"in_reply_to":"AAAAMX%2F%2Fz1I%3D","updated":"2012-12-14 22:30:10.000000000","message":"Turns out the --failfast flag to subunit.run appears to be ignored. So that may not currently be an option. I have filed a bug with the associated upstream https://bugs.launchpad.net/testtools/+bug/1090582.","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f68e2f225b99909e05db5975539330e24a5668a8","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  echo \"  -s, --no-site-packages   Isolate the virtualenv from the global Python environment\""},{"line_number":12,"context_line":"  echo \"  -r, --recreate-db        Recreate the test database (deprecated, as this is now the default).\""},{"line_number":13,"context_line":"  echo \"  -n, --no-recreate-db     Don\u0027t recreate the test database.\""},{"line_number":14,"context_line":"  echo \"  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added.\""},{"line_number":15,"context_line":"  echo \"  -p, --pep8               Just run PEP8 and HACKING compliance check\""},{"line_number":16,"context_line":"  echo \"  -P, --no-pep8            Don\u0027t run static code checks\""},{"line_number":17,"context_line":"  echo \"  -c, --coverage           Generate coverage report\""}],"source_content_type":"text/x-sh","patch_set":26,"id":"AAAAMX%2F%2Fz1I%3D","line":14,"in_reply_to":"AAAAMX%2F%2Fz2s%3D","updated":"2012-12-14 17:35:06.000000000","message":"Fair enough.  Probably worth mentioning on the dev list when this gets approved…","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"113a309f5a80e5a6b592a8a161d04d6b252dbcc4","unresolved":false,"context_lines":[{"line_number":11,"context_line":"  echo \"  -s, --no-site-packages   Isolate the virtualenv from the global Python environment\""},{"line_number":12,"context_line":"  echo \"  -r, --recreate-db        Recreate the test database (deprecated, as this is now the default).\""},{"line_number":13,"context_line":"  echo \"  -n, --no-recreate-db     Don\u0027t recreate the test database.\""},{"line_number":14,"context_line":"  echo \"  -f, --force              Force a clean re-build of the virtual environment. Useful when dependencies have been added.\""},{"line_number":15,"context_line":"  echo \"  -p, --pep8               Just run PEP8 and HACKING compliance check\""},{"line_number":16,"context_line":"  echo \"  -P, --no-pep8            Don\u0027t run static code checks\""},{"line_number":17,"context_line":"  echo \"  -c, --coverage           Generate coverage report\""}],"source_content_type":"text/x-sh","patch_set":26,"id":"AAAAMX%2F%2Fz2s%3D","line":14,"in_reply_to":"AAAAMX%2F%2Fz6E%3D","updated":"2012-12-14 17:11:34.000000000","message":"During normal testr operation it lists all tests, partitions them, then forks a number of subunit.run processes to run each partition. Testr itself does not have a flag to stop on first failure which leaves us with telling subunit.run to stop on first failure. Since we have multiple subunit.run processes running stopping on first failure doesn\u0027t gain us much in that case. TL;DR if we want to approximate -x with testr we will have to run testr in non parallel mode.\n\nParallel test execution reduces the cost of running all of the tests which makes -x less useful I think. You can also run testr run --parallel --failing to run only the tests that failed in the last test run. So your workflow might become 1. run all tests 2. run only failing tests until no failing tests remain. Instead of 1. Run until first test fails 2. fix failing test 3. repeat as necessary.\n\nUnfortunately, I have not found a way to approximate -d with testr. Maybe Robert can point out how that might work with testr.","commit_id":"ec3700765a801655415c25b75db237cb0e63d8fb"}]}
