[ https://issues.apache.org/jira/browse/HADOOP-11984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14548270#comment-14548270 ]
Allen Wittenauer commented on HADOOP-11984: ------------------------------------------- bq. Please correct me if I'm wrong – Looks like that test-patch.sh relies on a lot of regex to do the job. Does it make sense to move some of these work towards a Python script so that it is possible to leverage more libraries? No, for the exact same reason the hadoop user-facing shell code isn't written in python. bq. For example, To determine whether a test run successfully, it seems more reliable to parse the xml output of test result rather than doing a regex matching. The code in question: {code} module_failed_tests=$(find . -name 'TEST*.xml'\ | xargs "${GREP}" -l -E "<failure|<error"\ | ${AWK} -F/ '{sub("TEST-org.apache.",""); sub(".xml",""); print $NF}') {code} has been in use for about as long as test-patch as existed (minus some code cleanup and formatting changes by me). I doubt it's any less reliable than reading the XML directly since the only way this should break is if JUnit's XML DTD changes.... which, in turn, would break any replacement of this code as well. So it's a wash. (I'd also argue that this is likely going to be faster and might even use less memory, given how highly optimized grep implementations tend to be... but the awk might slow it down.) > Enable parallel JUnit tests in pre-commit. > ------------------------------------------ > > Key: HADOOP-11984 > URL: https://issues.apache.org/jira/browse/HADOOP-11984 > Project: Hadoop Common > Issue Type: Improvement > Components: scripts > Reporter: Chris Nauroth > Assignee: Chris Nauroth > Attachments: HADOOP-11984.001.patch, HADOOP-11984.002.patch, > HADOOP-11984.003.patch, HADOOP-11984.004.patch > > > HADOOP-9287 and related issues implemented the parallel-tests Maven profile > for running JUnit tests in multiple concurrent processes. This issue > proposes to activate that profile during pre-commit to speed up execution. -- This message was sent by Atlassian JIRA (v6.3.4#6332)