)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16237,"name":"venkatamahesh","email":"venkatamaheshkotha@gmail.com","username":"venkatamahesh"},"change_message_id":"79979ee3a0e234950be079816454fc2ecc9df33e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lenny Verkhovsky \u003clennyb@mellanox.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-06 14:56:32 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding support for combining more than 1 subunit file into single html"},{"line_number":8,"context_line":"Reason: We need to run some external scripts between tempest tests"},{"line_number":9,"context_line":"        and combime results into single html file."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a2fa921_f53f4b23","line":7,"updated":"2015-10-06 12:00:56.000000000","message":"Leave a line gap","commit_id":"6144736859f7c98f2289ef462e0b8a04c585d0e0"}],"os_testr/subunit2html.py":[{"author":{"_account_id":13431,"name":"Evgeny Antyshev","email":"eantyshev@gmail.com","username":"eantyshev"},"change_message_id":"6e32680c33990afcf2be8c33f1fa3a0eefb2da63","unresolved":false,"context_lines":[{"line_number":712,"context_line":"        exit(1)"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"    files \u003d []"},{"line_number":715,"context_line":"    if os.path.exists(sys.argv[-1]):"},{"line_number":716,"context_line":"        html_file \u003d \u0027results.html\u0027"},{"line_number":717,"context_line":"        files \u003d sys.argv[1:]"},{"line_number":718,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_d641cb0c","line":715,"updated":"2015-10-07 09:25:09.000000000","message":"What if I created results.html by a previous run and repeated the same command line?\nThis code will regard results.html as an another subunit file.\nI think, it is the confusing behavior to depend on files state.\n\nPlease, consider using commandline options, like that:\n./subunit2html.py [-o result.html] subunit1 ... subunitN\n\nOr, you may output it to stdout, and use like that:\n./subunit2html.py [-o result.html] subunit1 ... subunitN \u003e results.html","commit_id":"4cc548a5cc0664ae53de6391d7c8c6c1e8cbc485"},{"author":{"_account_id":13431,"name":"Evgeny Antyshev","email":"eantyshev@gmail.com","username":"eantyshev"},"change_message_id":"6e32680c33990afcf2be8c33f1fa3a0eefb2da63","unresolved":false,"context_lines":[{"line_number":721,"context_line":""},{"line_number":722,"context_line":"    subunit_file \u003d tempfile.NamedTemporaryFile()"},{"line_number":723,"context_line":"    for f in files:"},{"line_number":724,"context_line":"        subunit_file.write(open(f, \u0027r\u0027).read())"},{"line_number":725,"context_line":"    subunit_file.flush()"},{"line_number":726,"context_line":"    html_result \u003d HtmlOutput(html_file)"},{"line_number":727,"context_line":"    stream \u003d open(subunit_file.name, \u0027rb\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_29e1c0d0","line":724,"updated":"2015-10-07 09:25:09.000000000","message":"Why to create temporary file? You open subunit file, parse it, proceed to another one:\n\n    for subunit_file in subunit_files:\n        stream \u003d open(subunit_file, \u0027rb\u0027)\n        suite \u003d subunit.ByteStreamToStreamResult(stream, non_subunit_name\u003d\u0027stdout\u0027)\n        suite.run(result)\n    ...\n    result.stopTestRun()","commit_id":"4cc548a5cc0664ae53de6391d7c8c6c1e8cbc485"},{"author":{"_account_id":13431,"name":"Evgeny Antyshev","email":"eantyshev@gmail.com","username":"eantyshev"},"change_message_id":"6665611792b90dcbe4be5b18f6d1fbef5ba23c1a","unresolved":false,"context_lines":[{"line_number":715,"context_line":"    subunit_files \u003d sys.argv[1:]"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"    # Most probably existing not html file is a subunit one"},{"line_number":718,"context_line":"    if os.path.exists(sys.argv[-1]) and not sys.argv[-1].endswith(\u0027.html\u0027):"},{"line_number":719,"context_line":"        html_file \u003d \u0027results.html\u0027"},{"line_number":720,"context_line":"        subunit_files \u003d sys.argv[1:]"},{"line_number":721,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_031554e3","line":718,"updated":"2015-10-09 08:26:26.000000000","message":"*.htm is also a valid extension for HTML (originated from Windows, AFAIK)\n\nWhat are the concerns to not use optparse?\nIMHO, it is more usual for linux utilities, and I cannot remember any examples of this approach.","commit_id":"65b515971c90c7226b1d8cef495ec5fb612ebea2"},{"author":{"_account_id":14807,"name":"Lenny","email":"lennyb@mellanox.com","username":"lennyb"},"change_message_id":"57257a6efffca7667f33572fb7cff91d451c128c","unresolved":false,"context_lines":[{"line_number":715,"context_line":"    subunit_files \u003d sys.argv[1:]"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"    # Most probably existing not html file is a subunit one"},{"line_number":718,"context_line":"    if os.path.exists(sys.argv[-1]) and not sys.argv[-1].endswith(\u0027.html\u0027):"},{"line_number":719,"context_line":"        html_file \u003d \u0027results.html\u0027"},{"line_number":720,"context_line":"        subunit_files \u003d sys.argv[1:]"},{"line_number":721,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_12ec9d28","line":718,"in_reply_to":"7a2fa921_031554e3","updated":"2015-10-09 20:36:04.000000000","message":"I agree with you regarding optparse, but I want to keep backward compatibility for all the current users. This script ( I guess ) is used by most if not all CIs to upload tempest logs, breaking it can be very unpleasant.","commit_id":"65b515971c90c7226b1d8cef495ec5fb612ebea2"},{"author":{"_account_id":13431,"name":"Evgeny Antyshev","email":"eantyshev@gmail.com","username":"eantyshev"},"change_message_id":"6665611792b90dcbe4be5b18f6d1fbef5ba23c1a","unresolved":false,"context_lines":[{"line_number":738,"context_line":"        # Divert non-test output"},{"line_number":739,"context_line":"        result \u003d testtools.StreamResultRouter(result)"},{"line_number":740,"context_line":"        result.add_rule(accumulator, \u0027test_id\u0027, test_id\u003dNone)"},{"line_number":741,"context_line":"        result.startTestRun()"},{"line_number":742,"context_line":"        suite.run(result)"},{"line_number":743,"context_line":"    # Now reprocess any found stdout content as V1 subunit"},{"line_number":744,"context_line":"    for bytes_io in accumulator.route_codes.values():"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_d532b3a6","line":741,"updated":"2015-10-09 08:26:26.000000000","message":"AFAIU, above 3 lines don\u0027t need to be repeated.","commit_id":"65b515971c90c7226b1d8cef495ec5fb612ebea2"},{"author":{"_account_id":14807,"name":"Lenny","email":"lennyb@mellanox.com","username":"lennyb"},"change_message_id":"57257a6efffca7667f33572fb7cff91d451c128c","unresolved":false,"context_lines":[{"line_number":738,"context_line":"        # Divert non-test output"},{"line_number":739,"context_line":"        result \u003d testtools.StreamResultRouter(result)"},{"line_number":740,"context_line":"        result.add_rule(accumulator, \u0027test_id\u0027, test_id\u003dNone)"},{"line_number":741,"context_line":"        result.startTestRun()"},{"line_number":742,"context_line":"        suite.run(result)"},{"line_number":743,"context_line":"    # Now reprocess any found stdout content as V1 subunit"},{"line_number":744,"context_line":"    for bytes_io in accumulator.route_codes.values():"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_525455c8","line":741,"in_reply_to":"7a2fa921_d532b3a6","updated":"2015-10-09 20:36:04.000000000","message":"thanks","commit_id":"65b515971c90c7226b1d8cef495ec5fb612ebea2"}]}
