)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"b015d610b14ee01f6f64009b3dd6b53300aca0d6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Waldemar Znoinski \u003cwznoinsk@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2018-04-22 17:32:35 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: new DEFAULT conf param: run_on_failure"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"TODO: run_on_teardown unit test"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3f79a3b5_8e90534c","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":4},"updated":"2018-08-12 10:35:09.000000000","message":"can you remove this now.","commit_id":"5fdbec657421cd58c65e2064b54df94d7f8993c5"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"b015d610b14ee01f6f64009b3dd6b53300aca0d6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: new DEFAULT conf param: run_on_failure"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"TODO: run_on_teardown unit test"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The new tempest.conf param serves the need of running a shell command"},{"line_number":12,"context_line":"on test failure."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3f79a3b5_2e81fffb","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":31},"updated":"2018-08-12 10:35:09.000000000","message":"we need unit tests now. Other update looks good to me.","commit_id":"5fdbec657421cd58c65e2064b54df94d7f8993c5"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"05ec39326322309cb48d2c7dfdfe65d36fa64e33","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"WIP: new DEFAULT conf param: run_on_failure"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"TODO: run_on_teardown unit test"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"The new tempest.conf param serves the need of running a shell command"},{"line_number":12,"context_line":"on test failure."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3f79a3b5_5d49dd8b","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":31},"in_reply_to":"3f79a3b5_2e81fffb","updated":"2018-09-13 15:59:22.000000000","message":"hi Ghanshyam, I need a pointer where to create these - with my limited knowledge of tempest unit tests I couldn\u0027t find a good place to run a unit against this option","commit_id":"5fdbec657421cd58c65e2064b54df94d7f8993c5"}],"tempest/config.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e8c939c3d450134af16e5ae2331aff6bd26a2821","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"If nothing is specified, this feature is not enabled. To trace everything"},{"line_number":1005,"context_line":"specify .* as the regex."},{"line_number":1006,"context_line":"\"\"\"),"},{"line_number":1007,"context_line":"    cfg.StrOpt(\u0027run_on_teardown\u0027,"},{"line_number":1008,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1009,"context_line":"               help\u003d\"\"\"Shell command to run at test\u0027s teardown stage."},{"line_number":1010,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_e59993c3","line":1007,"range":{"start_line":1007,"start_character":15,"end_line":1007,"end_character":33},"updated":"2018-04-04 08:51:34.000000000","message":"i did not find exact use case of this. once all test cases are pass and you need to check and clean the resource leakage things then you can use tempest cleanup cli.\n\nis that satisfy the use case of running script after teardown?","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"316b473202e5e2cbeeb6acb1a9647b8d859e2cb8","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"If nothing is specified, this feature is not enabled. To trace everything"},{"line_number":1005,"context_line":"specify .* as the regex."},{"line_number":1006,"context_line":"\"\"\"),"},{"line_number":1007,"context_line":"    cfg.StrOpt(\u0027run_on_teardown\u0027,"},{"line_number":1008,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1009,"context_line":"               help\u003d\"\"\"Shell command to run at test\u0027s teardown stage."},{"line_number":1010,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_80cbaf70","line":1007,"range":{"start_line":1007,"start_character":15,"end_line":1007,"end_character":33},"in_reply_to":"bf659307_65230dc0","updated":"2018-04-06 14:03:30.000000000","message":"the correct paste (instead of the one above) is: http://paste.openstack.org/show/718603/","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"c8cdc826f22216c07540ea5ffe0b0716d2095827","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"If nothing is specified, this feature is not enabled. To trace everything"},{"line_number":1005,"context_line":"specify .* as the regex."},{"line_number":1006,"context_line":"\"\"\"),"},{"line_number":1007,"context_line":"    cfg.StrOpt(\u0027run_on_teardown\u0027,"},{"line_number":1008,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1009,"context_line":"               help\u003d\"\"\"Shell command to run at test\u0027s teardown stage."},{"line_number":1010,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_7bf4db86","line":1007,"range":{"start_line":1007,"start_character":15,"end_line":1007,"end_character":33},"in_reply_to":"bf659307_80cbaf70","updated":"2018-04-19 01:32:35.000000000","message":"Thanks for explaining the use case in very detailed way.\nRe on :\nLeakage of Resource  - This can be doen via \u0027tempest cleanup\u0027 CLI where you can check leaked resourced by running as dry run and then cleanup them.\n\n1st point - those info still can be collected from logs where we logged all request and response. My main concern on this is - To collect such info, it required to run for every test. and It is not necessary that each test will cleanup their created resource at the end of test or during teardown. Some tests can create and delete the tests before teardown. ex - https://github.com/openstack/tempest/blob/9c48584e0151b7aaac39751082d0f7fb108b062f/tempest/api/network/test_networks.py#L290\n\n2nd point - not sure about it. cannot test be extended to do that or new tests to cover those external testing? If those are testing using public API endpoint then, i prefer to improve/extend the tempest test itself.","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"1ac3a926cf399187254b33d9de5a839c1fa6a71a","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"If nothing is specified, this feature is not enabled. To trace everything"},{"line_number":1005,"context_line":"specify .* as the regex."},{"line_number":1006,"context_line":"\"\"\"),"},{"line_number":1007,"context_line":"    cfg.StrOpt(\u0027run_on_teardown\u0027,"},{"line_number":1008,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1009,"context_line":"               help\u003d\"\"\"Shell command to run at test\u0027s teardown stage."},{"line_number":1010,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_65230dc0","line":1007,"range":{"start_line":1007,"start_character":15,"end_line":1007,"end_character":33},"in_reply_to":"bf659307_e59993c3","updated":"2018-04-06 13:59:45.000000000","message":"main purpose of run_on_teardown, as I would imagine, would be to troubleshoot eventual leakages problem (i.e.: to see what resources are being created during each test) rather to do the actual cleanup... a good example of using run_on_teardown which helped me troubleshoot leakage problem is shortly described at: http://paste.openstack.org/show/718597/\n\nI\u0027m sure leakage of resources troubleshooting is only one example of situation you may find run_on_teardown useful, other use cases would be, i.e.:\n- tempest test requested creating a resource (router, instance or else) with certain properties/attributes... using run_on_teardown we can capture the actual info of the resources at the exact time of the test run and compare it to what the test originally requested to be created\n- additional testing... i.e.: you run a tempest test case, you\u0027re limited only to whatever test (i.e.: asserts, ssh connectivity) such tempest test case runs to validate success/failure... using run_on_teardown you could easily employ an external system/tool to run additional tests against created resource (whether it\u0027s a router, instance or else) - could be useful (but not limited to) when using tempest on openstack deployments in NFV environment (i.e.: with SDN controllers) etc. \n\nNOTE: the test cases may still be successful hence using run_on_failure wouldn\u0027t be useful here at all\nI hope that makes some sense","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e8c939c3d450134af16e5ae2331aff6bd26a2821","unresolved":false,"context_lines":[{"line_number":1016,"context_line":"run_on_failure \u003d \"ovs-ofctl dump-flows br-int \u003e"},{"line_number":1017,"context_line":"    /var/log/ovs-ofctl_br-int_$TEST_NAME.log\""},{"line_number":1018,"context_line":"\"\"\"),"},{"line_number":1019,"context_line":"    cfg.StrOpt(\u0027run_on_failure\u0027,"},{"line_number":1020,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1021,"context_line":"               help\u003d\"\"\"Shell command to run on a test failure."},{"line_number":1022,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_a58f1b73","line":1019,"range":{"start_line":1019,"start_character":16,"end_line":1019,"end_character":30},"updated":"2018-04-04 08:51:34.000000000","message":"in addition, we have CONF.pause_teardown where you can insert pdb breakpoint in teardownclass and debug the things before tempest cleanup the resource.","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"c8cdc826f22216c07540ea5ffe0b0716d2095827","unresolved":false,"context_lines":[{"line_number":1016,"context_line":"run_on_failure \u003d \"ovs-ofctl dump-flows br-int \u003e"},{"line_number":1017,"context_line":"    /var/log/ovs-ofctl_br-int_$TEST_NAME.log\""},{"line_number":1018,"context_line":"\"\"\"),"},{"line_number":1019,"context_line":"    cfg.StrOpt(\u0027run_on_failure\u0027,"},{"line_number":1020,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1021,"context_line":"               help\u003d\"\"\"Shell command to run on a test failure."},{"line_number":1022,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_9bef6faf","line":1019,"range":{"start_line":1019,"start_character":16,"end_line":1019,"end_character":30},"in_reply_to":"bf659307_2090a395","updated":"2018-04-19 01:32:35.000000000","message":"yea, i agree on run_on failure.  this is good feature i think to collect the failure/debug info well before test cleanup the things.\nwe can say the log file for this case too but i agree that log files would not be sufficient on complete debugging. For example, create subnet fail due to race in quota allocation and debug script try to run that test again or something to check quota etc.","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"1ac3a926cf399187254b33d9de5a839c1fa6a71a","unresolved":false,"context_lines":[{"line_number":1016,"context_line":"run_on_failure \u003d \"ovs-ofctl dump-flows br-int \u003e"},{"line_number":1017,"context_line":"    /var/log/ovs-ofctl_br-int_$TEST_NAME.log\""},{"line_number":1018,"context_line":"\"\"\"),"},{"line_number":1019,"context_line":"    cfg.StrOpt(\u0027run_on_failure\u0027,"},{"line_number":1020,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1021,"context_line":"               help\u003d\"\"\"Shell command to run on a test failure."},{"line_number":1022,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_2090a395","line":1019,"range":{"start_line":1019,"start_character":16,"end_line":1019,"end_character":30},"in_reply_to":"bf659307_a58f1b73","updated":"2018-04-06 13:59:45.000000000","message":"see my comments above as well as the previous general comment regarding pause_teardown - to the best of my knowledge it\u0027s not usable in CI environments","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":20190,"name":"zhufl","email":"zhu.fanglei@zte.com.cn","username":"zhufl"},"change_message_id":"975df41d64d608fb3845bfa3dabfb81b775621cd","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"]"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":"DefaultGroup \u003d ["},{"line_number":1031,"context_line":"    cfg.StrOpt(\u0027run_on_failure\u0027,"},{"line_number":1032,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":1033,"context_line":"               help\u003d\"\"\"Shell command to run at teardown on a test failure."},{"line_number":1034,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_43d1f42e","line":1031,"range":{"start_line":1031,"start_character":4,"end_line":1031,"end_character":14},"updated":"2018-09-14 02:16:28.000000000","message":"This feature is useful, and, can this support a list of commands?","commit_id":"02392500c87488dce0c073c3149e0b7c202f78c0"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"test case is about to fail. The command(s) is being run before the test performs"},{"line_number":1037,"context_line":"its resource teardown which makes it ideal for capturing the actual state of"},{"line_number":1038,"context_line":"resources, data and other troubleshooting info created by that test in the right"},{"line_number":1039,"context_line":"moment (at the failure time but before cleanups). Output of the ran command(s) is "},{"line_number":1040,"context_line":"saved as part of traceback details of the test case and it\u0027s available in subunit "},{"line_number":1041,"context_line":"stream and other formats its converted to."},{"line_number":1042,"context_line":"This can be helpful in analysis of failures, especially in a CI environment where "}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_c18ea3d6","line":1039,"range":{"start_line":1039,"start_character":81,"end_line":1039,"end_character":82},"updated":"2018-10-18 06:03:08.000000000","message":"Extra white space that needs to remove","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"its resource teardown which makes it ideal for capturing the actual state of"},{"line_number":1038,"context_line":"resources, data and other troubleshooting info created by that test in the right"},{"line_number":1039,"context_line":"moment (at the failure time but before cleanups). Output of the ran command(s) is "},{"line_number":1040,"context_line":"saved as part of traceback details of the test case and it\u0027s available in subunit "},{"line_number":1041,"context_line":"stream and other formats its converted to."},{"line_number":1042,"context_line":"This can be helpful in analysis of failures, especially in a CI environment where "},{"line_number":1043,"context_line":"pausing test suite/case run (i.e.: using pause_teardown) may be problematic."}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_418293a8","line":1040,"range":{"start_line":1040,"start_character":81,"end_line":1040,"end_character":82},"updated":"2018-10-18 06:03:08.000000000","message":"ditto","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"moment (at the failure time but before cleanups). Output of the ran command(s) is "},{"line_number":1040,"context_line":"saved as part of traceback details of the test case and it\u0027s available in subunit "},{"line_number":1041,"context_line":"stream and other formats its converted to."},{"line_number":1042,"context_line":"This can be helpful in analysis of failures, especially in a CI environment where "},{"line_number":1043,"context_line":"pausing test suite/case run (i.e.: using pause_teardown) may be problematic."},{"line_number":1044,"context_line":"Use with caution, especially in parallelized testing."},{"line_number":1045,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_018c9bd6","line":1042,"range":{"start_line":1042,"start_character":81,"end_line":1042,"end_character":82},"updated":"2018-10-18 06:03:08.000000000","message":"ditto","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1043,"context_line":"pausing test suite/case run (i.e.: using pause_teardown) may be problematic."},{"line_number":1044,"context_line":"Use with caution, especially in parallelized testing."},{"line_number":1045,"context_line":""},{"line_number":1046,"context_line":"NOTE: If the command fails to run (i.e.: exit code !\u003d 0, the file doesn\u0027t exist "},{"line_number":1047,"context_line":"or for other reasons) it will _not_ impact the result or cleanups of tempest test case."},{"line_number":1048,"context_line":"Also, it\u0027s advised to use a wrapper shell script containing many or more "},{"line_number":1049,"context_line":"sophisticated commands instead of listing all of them here. Such wrapper script "}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_218997c6","line":1046,"range":{"start_line":1046,"start_character":79,"end_line":1046,"end_character":80},"updated":"2018-10-18 06:03:08.000000000","message":"ditto","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1045,"context_line":""},{"line_number":1046,"context_line":"NOTE: If the command fails to run (i.e.: exit code !\u003d 0, the file doesn\u0027t exist "},{"line_number":1047,"context_line":"or for other reasons) it will _not_ impact the result or cleanups of tempest test case."},{"line_number":1048,"context_line":"Also, it\u0027s advised to use a wrapper shell script containing many or more "},{"line_number":1049,"context_line":"sophisticated commands instead of listing all of them here. Such wrapper script "},{"line_number":1050,"context_line":"should be then specified as value of run_on_failure."},{"line_number":1051,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_c1b78388","line":1048,"range":{"start_line":1048,"start_character":72,"end_line":1048,"end_character":73},"updated":"2018-10-18 06:03:08.000000000","message":"ditto","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"e9877bc595ef762fa2281c58c2244e38d0549025","unresolved":false,"context_lines":[{"line_number":1046,"context_line":"NOTE: If the command fails to run (i.e.: exit code !\u003d 0, the file doesn\u0027t exist "},{"line_number":1047,"context_line":"or for other reasons) it will _not_ impact the result or cleanups of tempest test case."},{"line_number":1048,"context_line":"Also, it\u0027s advised to use a wrapper shell script containing many or more "},{"line_number":1049,"context_line":"sophisticated commands instead of listing all of them here. Such wrapper script "},{"line_number":1050,"context_line":"should be then specified as value of run_on_failure."},{"line_number":1051,"context_line":""},{"line_number":1052,"context_line":"Example of tempest.conf option running two commands"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_e1bcff6c","line":1049,"range":{"start_line":1049,"start_character":79,"end_line":1049,"end_character":80},"updated":"2018-10-18 06:03:08.000000000","message":"ditto","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"}],"tempest/test.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e8c939c3d450134af16e5ae2331aff6bd26a2821","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":231,"context_line":"        if CONF.debug.run_on_teardown:"},{"line_number":232,"context_line":"            BaseTestCase.run_on_teardown(self, CONF.debug.run_on_teardown)"},{"line_number":233,"context_line":"        if CONF.debug.run_on_failure:"},{"line_number":234,"context_line":"            if self._TestCase__details:"},{"line_number":235,"context_line":"                BaseTestCase.run_on_teardown(self, CONF.debug.run_on_failure)"},{"line_number":236,"context_line":"        # insert pdb breakpoint when pause_teardown is enabled"},{"line_number":237,"context_line":"        if CONF.pause_teardown:"},{"line_number":238,"context_line":"            BaseTestCase.insert_pdb_breakpoint()"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_051fe707","line":235,"range":{"start_line":233,"start_character":0,"end_line":235,"end_character":77},"updated":"2018-04-04 08:51:34.000000000","message":"this way configured script will run on every test failure. how about running it at class level if any failure ?","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"1ac3a926cf399187254b33d9de5a839c1fa6a71a","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":231,"context_line":"        if CONF.debug.run_on_teardown:"},{"line_number":232,"context_line":"            BaseTestCase.run_on_teardown(self, CONF.debug.run_on_teardown)"},{"line_number":233,"context_line":"        if CONF.debug.run_on_failure:"},{"line_number":234,"context_line":"            if self._TestCase__details:"},{"line_number":235,"context_line":"                BaseTestCase.run_on_teardown(self, CONF.debug.run_on_failure)"},{"line_number":236,"context_line":"        # insert pdb breakpoint when pause_teardown is enabled"},{"line_number":237,"context_line":"        if CONF.pause_teardown:"},{"line_number":238,"context_line":"            BaseTestCase.insert_pdb_breakpoint()"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_a0ca739e","line":235,"range":{"start_line":233,"start_character":0,"end_line":235,"end_character":77},"in_reply_to":"bf659307_051fe707","updated":"2018-04-06 13:59:45.000000000","message":"original idea about run_on_failure was doing exactly that but I realized there may be many test cases belonging to the same test Class and running capture commands only at the class teardown time is loosing a lot of vital information","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"c8cdc826f22216c07540ea5ffe0b0716d2095827","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":231,"context_line":"        if CONF.debug.run_on_teardown:"},{"line_number":232,"context_line":"            BaseTestCase.run_on_teardown(self, CONF.debug.run_on_teardown)"},{"line_number":233,"context_line":"        if CONF.debug.run_on_failure:"},{"line_number":234,"context_line":"            if self._TestCase__details:"},{"line_number":235,"context_line":"                BaseTestCase.run_on_teardown(self, CONF.debug.run_on_failure)"},{"line_number":236,"context_line":"        # insert pdb breakpoint when pause_teardown is enabled"},{"line_number":237,"context_line":"        if CONF.pause_teardown:"},{"line_number":238,"context_line":"            BaseTestCase.insert_pdb_breakpoint()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f6a8fd7_bb6d9333","line":235,"range":{"start_line":233,"start_character":0,"end_line":235,"end_character":77},"in_reply_to":"bf659307_a0ca739e","updated":"2018-04-19 01:32:35.000000000","message":"yea, even tests create and delete their own resource which you might not be able to collect if running the script on class level. So +1 on running on each failure for this use case.\n\nAnother point is what that script does cannot be specific to tests you are running. For example if you wan to collect the network resource on failure then those still runs on compute tests which might not be needed.\n1. One way is to make tempest intelligent where to run configured script for example, add more info in config options or script about for what all tests failure you want to run the debug script.   \n2. second way is to ask user to make script intelligent so that it recognize which service test got failed and whether you want to run the script content or not. or Script decide what to run on what type of failure. \n\nI think 1st one is too much magic for tempest and 2nd options looks good to me.","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e8c939c3d450134af16e5ae2331aff6bd26a2821","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        pdb.set_trace()"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    @classmethod"},{"line_number":251,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":252,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":253,"context_line":"        test_name \u003d self.__str__()"},{"line_number":254,"context_line":"        output \u003d subprocess.check_output(cmd,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_45de3f3e","line":251,"range":{"start_line":251,"start_character":8,"end_line":251,"end_character":23},"updated":"2018-04-04 08:51:34.000000000","message":"how about name this to run_extra_debug_script()","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":14287,"name":"Waldemar Znoinski","email":"wznoinsk@redhat.com","username":"wznoinsk"},"change_message_id":"1ac3a926cf399187254b33d9de5a839c1fa6a71a","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        pdb.set_trace()"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    @classmethod"},{"line_number":251,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":252,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":253,"context_line":"        test_name \u003d self.__str__()"},{"line_number":254,"context_line":"        output \u003d subprocess.check_output(cmd,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_40691789","line":251,"range":{"start_line":251,"start_character":8,"end_line":251,"end_character":23},"in_reply_to":"bf659307_45de3f3e","updated":"2018-04-06 13:59:45.000000000","message":"I don\u0027t mind but having more specific name would probably help the user on what\u0027s that functionality is about and will help to avoid any conflicts with future functionalities we may add to tempest - again, not something I\u0027d stand hard on - I\u0027m ok to change it too","commit_id":"7ca5bb8eedc56329c0375b3bf6bf84b4778fbd30"},{"author":{"_account_id":5689,"name":"Masayuki Igawa","email":"masayuki@igawa.io","username":"igawa"},"change_message_id":"f54f556957cbc5237e1a0d8c8460c12df1657b51","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        if CONF.debug.run_on_teardown:"},{"line_number":232,"context_line":"            BaseTestCase.run_on_teardown(self, CONF.debug.run_on_teardown)"},{"line_number":233,"context_line":"        if CONF.debug.run_on_failure:"},{"line_number":234,"context_line":"            if self._TestCase__details:"},{"line_number":235,"context_line":"                BaseTestCase.run_on_teardown(self, CONF.debug.run_on_failure)"},{"line_number":236,"context_line":"        # insert pdb breakpoint when pause_teardown is enabled"},{"line_number":237,"context_line":"        if CONF.pause_teardown:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f6a8fd7_74b646fd","line":234,"updated":"2018-04-18 06:09:32.000000000","message":"I\u0027m actually not sure about this flag(?). Why do we need to check this?","commit_id":"334610add7f26cbb933eb19a891b1bde67e935f0"},{"author":{"_account_id":5689,"name":"Masayuki Igawa","email":"masayuki@igawa.io","username":"igawa"},"change_message_id":"f54f556957cbc5237e1a0d8c8460c12df1657b51","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        pdb.set_trace()"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    @classmethod"},{"line_number":251,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":252,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":253,"context_line":"        test_name \u003d self.__str__()"},{"line_number":254,"context_line":"        output \u003d subprocess.check_output(cmd,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f6a8fd7_94b99aea","line":251,"updated":"2018-04-18 06:09:32.000000000","message":"Can we have unit tests for this method?","commit_id":"334610add7f26cbb933eb19a891b1bde67e935f0"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"4e4739ee2748636c700cecfa6defc18628aa67d1","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        pdb.set_trace()"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @classmethod"},{"line_number":250,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":251,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":252,"context_line":"        output \u003d subprocess.check_output(cmd,"},{"line_number":253,"context_line":"                                         shell\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_4604a27e","line":250,"range":{"start_line":250,"start_character":23,"end_line":250,"end_character":40},"updated":"2018-09-14 04:54:51.000000000","message":"I am not sure but have a confusion: is it good way to use both cls and self together?","commit_id":"02392500c87488dce0c073c3149e0b7c202f78c0"},{"author":{"_account_id":20190,"name":"zhufl","email":"zhu.fanglei@zte.com.cn","username":"zhufl"},"change_message_id":"0adfd43a18c75fca7f286907be7354dfb5400d99","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @classmethod"},{"line_number":250,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":251,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":252,"context_line":"        output \u003d subprocess.check_output(cmd,"},{"line_number":253,"context_line":"                                         shell\u003dTrue,"},{"line_number":254,"context_line":"                                         env\u003d{\u0027TEST_NAME\u0027:"},{"line_number":255,"context_line":"                                              \u0027%s\u0027 % self.__str__()})"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        output_content \u003d testtools.content.text_content(output)"},{"line_number":258,"context_line":"        self.addDetail(\u0027debug_info\u0027, output_content)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_43db3420","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":69},"updated":"2018-09-14 02:36:20.000000000","message":"What if cmd execution fails and throws an exception?","commit_id":"02392500c87488dce0c073c3149e0b7c202f78c0"},{"author":{"_account_id":27078,"name":"Manik Bindlish","email":"manikbindlish19@gmail.com","username":"manik"},"change_message_id":"4e4739ee2748636c700cecfa6defc18628aa67d1","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @classmethod"},{"line_number":250,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":251,"context_line":"        \"\"\"Run an arbitrary shell command on a test teardown stage\"\"\""},{"line_number":252,"context_line":"        output \u003d subprocess.check_output(cmd,"},{"line_number":253,"context_line":"                                         shell\u003dTrue,"},{"line_number":254,"context_line":"                                         env\u003d{\u0027TEST_NAME\u0027:"},{"line_number":255,"context_line":"                                              \u0027%s\u0027 % self.__str__()})"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        output_content \u003d testtools.content.text_content(output)"},{"line_number":258,"context_line":"        self.addDetail(\u0027debug_info\u0027, output_content)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f79a3b5_06e54adc","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":69},"in_reply_to":"3f79a3b5_43db3420","updated":"2018-09-14 04:54:51.000000000","message":"Agreeing with Zhufl here. seems no handling","commit_id":"02392500c87488dce0c073c3149e0b7c202f78c0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"43e5ec499941dafd7edd83fd3e34da55e7cbe9dc","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        super(BaseTestCase, self).tearDown()"},{"line_number":231,"context_line":"        if CONF.run_on_failure:"},{"line_number":232,"context_line":"            # \u0027_TestCase__details\u0027 is not-empty when test failed"},{"line_number":233,"context_line":"            if self._TestCase__details:"},{"line_number":234,"context_line":"                BaseTestCase.run_on_teardown(self, CONF.run_on_failure)"},{"line_number":235,"context_line":"        # insert pdb breakpoint when pause_teardown is enabled"},{"line_number":236,"context_line":"        if CONF.pause_teardown:"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_972af493","line":233,"range":{"start_line":233,"start_character":20,"end_line":233,"end_character":38},"updated":"2018-12-15 04:43:40.000000000","message":"This should not be used. This should likely be used instead: \nhttps://testtools.readthedocs.io/en/latest/api.html#testtools.TestCase.getDetails\n\nOnly public API methods should be used. _TestCase__details is basically a mangled variable name prefixed with __ which means that it should absolutely never be called outside the TestCase class itself.","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2352336e5f2ba4b047ef7cc6b38f771e12ab5b06","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        import pdb"},{"line_number":247,"context_line":"        pdb.set_trace()"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @classmethod"},{"line_number":250,"context_line":"    def run_on_teardown(cls, self, cmd):"},{"line_number":251,"context_line":"        \"\"\"Run an arbitrary shell command(s) on a test teardown stage\"\"\""},{"line_number":252,"context_line":"        output \u003d subprocess.check_output(cmd,"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_863c13eb","line":249,"range":{"start_line":249,"start_character":3,"end_line":249,"end_character":16},"updated":"2018-12-14 15:36:25.000000000","message":"you do not declare this as a class method\nand leave it as the default instance method you can \nremove the cls paramater as it is not used in the function.\n\nthis needs a reference to self anyway so its not really a class method which should not generally use fields or fucntions that depend on the instance.","commit_id":"a057f0bc2b4a74246b5fc002746ae8315c6b0218"}]}
