Closed josecelano closed 11 months ago
Weird. It works fine locally:
I figured it out: the problem is made by ANSI escape chars again.
It's really confusing to know if a terminal string contains them or not, or rather whether the output comes from a terminal environment.
So we have to strip them before parsing. With this experimental commit in pretty-test, your workflow started working.
Note in that CI, cargo install cargo-pretty-test --git https://github.com/zjp-CN/pretty-test.git --branch experimental
is used as a patch.
Thank you, @zjp-CN . Now I have a nice job summary in markdown:
https://github.com/torrust/torrust-tracker/actions/runs/6299630094
Seems the tree view looks bad in the summary. And I noticed two things in the workflow:
no color or style in the output (OK should be green and bold etc)
the status line at the bottom is not printed out (maybe it's because CI hijacks stderr): the tree is printed via stdout, and the status line is via stderr
Seems the tree view looks bad in the summary. And I noticed two things in the workflow:
- no color or style in the output (OK should be green and bold etc)
- the status line at the bottom is not printed out (maybe it's because CI hijacks stderr): the tree is printed via stdout, and the status line is via stderr
It seems colors are allowed.
Yes, the color is allowed in github action output.
I guess we need to force pretty-test to print in color via --color always
. https://github.com/josecelano/cargo-pretty-test/issues/23 and https://github.com/josecelano/cargo-pretty-test/pull/19#issuecomment-1735197693
It's not hard to do by calling https://docs.rs/colored/2.0.4/colored/control/fn.set_override.html
Update: https://github.com/josecelano/cargo-pretty-test/issues/25#issuecomment-1735837794
I'm trying t use the command in a GitHub workflow but I get this error:
The workflow: https://github.com/torrust/torrust-tracker/actions/runs/6299630094/job/17100743480
The
cargo test
output:cargo_test_output.txt