[ 
https://issues.apache.org/jira/browse/HADOOP-12316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kengo Seki updated HADOOP-12316:
--------------------------------
    Attachment: HADOOP-12316.HADOOP-12111.00.patch

-00:

* fix the regex
* fix a footer message

I confirmed that test-patch still detects test failures correctly after 
applying this:

{code}
[sekikn@mobile hadoop]$ git apply -p0 ~/HADOOP-12316.HADOOP-12111.00.patch 
[sekikn@mobile hadoop]$ cat /tmp/test.patch 
diff --git 
a/hadoop-common-project/hadoop-common/src/test/scripts/hadoop_add_classpath.bats
 
b/hadoop-common-project/hadoop-common/src/test/scripts/hadoop_add_classpath.bats
index 8bc50d0..d3af0af 100644
--- 
a/hadoop-common-project/hadoop-common/src/test/scripts/hadoop_add_classpath.bats
+++ 
b/hadoop-common-project/hadoop-common/src/test/scripts/hadoop_add_classpath.bats
@@ -17,7 +17,7 @@ load hadoop-functions_test_helper
 
 @test "hadoop_add_classpath (simple not exist)" {
   run hadoop_add_classpath testvar
-  [ "${status}" -eq 1 ]
+  [ "${status}" -eq 0 ]
 }
 
 @test "hadoop_add_classpath (simple wildcard not exist)" {
@@ -97,4 +97,4 @@ load hadoop-functions_test_helper
   done
   echo ">${CLASSPATH}<"
   [ "${CLASSPATH}" = "${TMP}/4:${TMP}/2:${TMP}/1:${TMP}/3:${TMP}/5" ]
-}
\ No newline at end of file
+}
[sekikn@mobile hadoop]$ dev-support/test-patch.sh 
--basedir=/Users/sekikn/dev/hadoop --project=hadoop --run-tests /tmp/test.patch 
 
(snip)

| Vote |      Subsystem |  Runtime   | Comment
============================================================================
|  +1  |       @author  |  0m 01s    | The patch does not contain any @author 
|      |                |            | tags.
|  +1  |    test4tests  |  0m 00s    | The patch appears to include 1 new or 
|      |                |            | modified test files.
|  +1  |    asflicense  |  0m 35s    | Patch does not generate ASF License 
|      |                |            | warnings.
|  +1  |    whitespace  |  0m 00s    | Patch has no whitespace issues. 
|  -1  |          unit  |  2m 16s    | hadoop-common in the patch failed. 
|      |                |  2m 52s    | 


            Reason | Tests
 Failed TAP tests  |  hadoop_add_classpath.bats.tap 


|| Subsystem || Report/Notes ||
============================================================================
| git revision | HADOOP-12111 / 96f2745 |
| Optional Tests | asflicense unit |
| uname | Darwin mobile.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 
11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64 |
| Build tool | maven |
| Personality | /Users/sekikn/hadoop/dev-support/personality/hadoop.sh |
| Default Java | 1.7.0_80 |
| unit | 
/private/tmp/test-patch-hadoop/18039/patch-unit-hadoop-common-project_hadoop-common.txt
 |
| unit test logs |  
/private/tmp/test-patch-hadoop/18039/patch-unit-hadoop-common-project_hadoop-common.txt
 |
| TAP logs |  
/private/tmp/test-patch-hadoop/18039/patch-hadoop-common-project_hadoop-common.tap
 |
| Max memory used | 46MB |
{code}

> Potential false-positive and false-negative in parsing TAP output
> -----------------------------------------------------------------
>
>                 Key: HADOOP-12316
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12316
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: yetus
>    Affects Versions: HADOOP-12111
>            Reporter: Kengo Seki
>         Attachments: HADOOP-12316.HADOOP-12111.00.patch
>
>
> In tap.sh, TAP results are parsed as follows:
> {code}
>   filenames=$(find "${TAP_LOG_DIR}" -type f -exec "${GREP}" -l -E "not ok " 
> {} \;)
> {code}
> But this regex seems to have the following problems:
> 1. According to [the TAP 
> specification|https://testanything.org/tap-specification.html], "ok" / "not 
> ok" is only required in the test line and others are optional. So each line 
> can be terminated with just "ok" or "not ok", without trailing spaces. In 
> that case, the regex "not ok " will miss test failures.
> 2. TAP output can contain descriptions and diagnostics. If they contains the 
> string "not ok ", a false-alarm will be raised.
> They won't occur as far as we are using only bats, but considering supporting 
> other test tools in the future, the regex should be replaced with "^not ok".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to