Open timotheecour opened 4 years ago
megatest test results always were bad IME and we didn't change the logic. No idea what's going on here.
ok I see the problem: the logic I had added in https://github.com/nim-lang/Nim/pull/10089 doesn't work well when git diff
context is too small to show the relevant line showing which test is running:
megatest:processing: tests/system/tlenvarargs.nim
here's a minimal reproducing example:
discard """
output: '''
ok1
ok2
ok3
ok4
ok5
ok5
ok6
ok7
ok8
ok9
ok10
'''
"""
proc main()=
echo "ok1"
echo "ok2"
echo "ok3"
echo "ok4"
echo "bad" # diff here will hide the line `megatest:processing: tests/system/tlenvarargs_temp.nim`
echo "ok6"
echo "ok7"
echo "ok8"
echo "ok9"
echo "ok10"
main()
nim c -r testament/testament.nim --nim:bin/nim_temp.exp_fix_12908_megatest_FAIL.2 c megatest
joinable specs: 499
--- outputExpected.txt 2019-12-17 20:29:59.000000000 +0000
+++ outputGotten.txt 2019-12-17 20:29:59.000000000 +0000
@@ -1711,8 +1711,7 @@
ok2
ok3
ok4
-ok5
-ok5
+bad
ok6
ok7
ok8
output different!
note: a larger context would show those lines:
[e, f]
megatest:processing: tests/system/tlenvarargs_temp.nim
ok1
ok2
ok3
...
ok9
ok10
megatest:processing: tests/system/tnilconcats.nim
@["", "", "", "", "", "", "", "meh"]
but some tests have a lot of output so it may not be good to simply increase context with git diff -C 100
CI should export the diff files: outputExpected.txt outputGotten.txt
which would generally help with debugging CI failures
manually parse outputExpected.txt and outputGotten.txt, keeping track of sections delimited by megatest:processing: xxx.nim
, and report back which individual tests failed, right after showing the diff
testament does not show which test (from megatest) failed; in the example below (where the failing test is tlenvarargs.nim) there is 0 indication of which test failed (by chance the logs showed the filename but that's coincidental because the test happened to print the file name).
Even if tlenvarargs.nim ends up in megatest, IIRC there used to be some logic where files that were run via megatest had the filename printed right before running that particular file so we'd be able to tell which test failed (even from looking at CI logs) but that doesn't appear to be the case anymore as shown below. This makes it hard to debug failing PR's where the failining test joins megatest.
Example
I observed that in https://github.com/nim-lang/Nim/pull/12907 I've made a permanent copy of the log downloaded from CI azure pipeline (https://dev.azure.com/nim-lang/Nim/_build/results?buildId=1211&view=logs) here: https://github.com/timotheecour/timn_pub_data/blob/master/data/D20191216T031056.txt
Current Output
Expected Output
this is the missing line: