Open ochaplashkin opened 1 year ago
What is the point of renaming the --verbose
option?
I would also highlight that mixing of the stdout and stderr streams reopens #392.
https://github.com/tarantool/luatest/issues/308 is too common, as for me. What is the test-run problem you want to solve with the change? Show stderr content from a luatest test when --verbose
is given? If so, let's just show the log file content instead of mixing it into stdout that feeds it to a TAP13 parser.
We have a two tests with logs:
So, I tried to add the same logic that exists in luatest
: duplicate stderr
using dup2_io
.
$ ./test-run.py passed_test.lua
[001] engine-luatest/passed_test.lua [ pass ]
-c
option$ ./test-run.py -c passed_test.lua
log
[WARNING] log
[INFO] log
[001] engine-luatest/passed_test.lua [ pass ]
-c -v
options$ ./test-run.py -c -v passed_test.lua
log
[WARNING] log
[INFO] log
[001] engine-luatest/passed_test.lua
[001] Tarantool version is 3.0.0-alpha1-176-ga5d7f3429
[001] PRINT INTO test
[001] TAP version 13
[001] 1..1
[001] # Started on Mon Sep 25 14:52:56 2023
[001] # Starting group: engine-luatest.log
[001] PRINT INTO TEST INTERNAL
[001] ok 1 engine-luatest.passed.test_log
[001] # Ran 1 tests in 0.001 seconds, 1 succeeded, 0 failed
[001] [ pass ]
$ ./test-run.py failed_test.lua
[001] engine-luatest/failed_test.lua [ fail ]
[001] Test failed! Output from reject file /tmp/t/rejects/engine-luatest/log2.reject:
[001] Tarantool version is 3.0.0-alpha1-176-ga5d7f3429
[001] TAP version 13
[001] 1..1
[001] # Started on Mon Sep 25 14:56:55 2023
[001] # Starting group: engine-luatest.log2
[001] not ok 1 engine-luatest.failed.test_log
[001] # ...workspace/vk/tarantool/test/engine-luatest/failed_test.lua:26: expected: a value evaluating to true, actual: false
[001] # stack traceback:
[001] # ...workspace/vk/tarantool/test/engine-luatest/failed_test.lua:26: in function 'engine-luatest.log2.test_log'
[001] # ...
[001] # [C]: in function 'xpcall'
[001] # artifacts:
[001] # server -> /tmp/t/001_engine-luatest/artifacts/server-lMMUEtMlRl5d
[001] # Ran 1 tests in 0.007 seconds, 0 succeeded, 1 failed
[001]
[001] [test-run server "luatest_server"] The log file /tmp/t/001_engine-luatest/failed_test.log has zero size
[Main process] Got failed test; gently terminate all workers...
[001] Worker "001_engine-luatest" got failed test; stopping the server...
-c
option$ ./test-run.py -c failed_test.lua
log
[WARNING] log
[INFO] log
[001] engine-luatest/failed_test.lua [ fail ]
[001] Test failed! Output from reject file /tmp/t/rejects/engine-luatest/failed.reject:
[001] Tarantool version is 3.0.0-alpha1-176-ga5d7f3429
[001] PRINT INTO test
[001] TAP version 13
[001] 1..1
[001] # Started on Mon Sep 25 14:58:09 2023
[001] # Starting group: engine-luatest.failed
[001] PRINT INTO TEST INTERNAL
[001] not ok 1 engine-luatest.failed.test_log
-c -v
optionsThe result is the same as when running with the -c
parameter.
Description
By default, test-run captures the stderr stream and redirects its to the log file:
Use the new option
--show-capture
(abbr.-c
) to redirect stderr to stdout. Use it instead of the deprecated--verbose
option.The
--verbose
option will be ignored and output:What's new in usage
:green_circle:
-c, --show-capture
- a new option. Show test logs in the stdout.:red_circle:
--verbose
has been deprecated.Close tarantool/luatest#308