diff mbox series

[kvm-unit-tests,v1] tap13: make testcase names unique

Message ID 20190225200549.41654-1-raspl@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,v1] tap13: make testcase names unique | expand

Commit Message

Stefan Raspl Feb. 25, 2019, 8:05 p.m. UTC
Previously, we were using the full output of each test for the name, e.g.

  ok 104 - intercept: stpx: Program interrupt: expected(4) == received(4)

But that's not a stable testcase name: The "received(4)" might change in case of
an error. Therefore, we truncate everything after the "expected()".
Helps in CI environments when comparing with previous output.

Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
---
 run_tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Feb. 26, 2019, 12:50 p.m. UTC | #1
On 25/02/19 21:05, Stefan Raspl wrote:
> Previously, we were using the full output of each test for the name, e.g.
> 
>   ok 104 - intercept: stpx: Program interrupt: expected(4) == received(4)
> 
> But that's not a stable testcase name: The "received(4)" might change in case of
> an error. Therefore, we truncate everything after the "expected()".
> Helps in CI environments when comparing with previous output.
> 
> Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>

Hmm, I'd rather fix the testcases...

Paolo
Stefan Raspl Feb. 27, 2019, 6:10 a.m. UTC | #2
On 26.02.19 13:50, Paolo Bonzini wrote:
> On 25/02/19 21:05, Stefan Raspl wrote:
>> Previously, we were using the full output of each test for the name, e.g.
>>
>>   ok 104 - intercept: stpx: Program interrupt: expected(4) == received(4)
>>
>> But that's not a stable testcase name: The "received(4)" might change in case of
>> an error. Therefore, we truncate everything after the "expected()".
>> Helps in CI environments when comparing with previous output.
>>
>> Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
> 
> Hmm, I'd rather fix the testcases...

No doubt about that.
But to coordinate that in an efficient manner, being able to identify testcases
in a unique manner helps, especially when considering automation!

Ciao,
Stefan
diff mbox series

Patch

diff --git a/run_tests.sh b/run_tests.sh
index 01e36dc..baf8c70 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -83,7 +83,7 @@  else
     process_test_output() {
         CR=$'\r'
         while read -r line; do
-            line="${line%$CR}"
+            line="${line% ==*}"
             case "${line:0:4}" in
                 PASS)
                     echo "ok TEST_NUMBER - ${line#??????}" >&3