Refactor progress bar & summary line logic #2984
Conversation
bf75be6 to
778399d
Compare
|
That's much clearer ! Thanks for the improvement !
This corresponds to a |
|
Btw, do we have tests that check the presence or absence of notification / progress / warning messages ? |
778399d to
01ab7b5
Compare
I agree, there are a lot of test cases that I ran manually that I would like to include in our test suite. I'd rather have some way to tell the test suite to run a command, and check that the stderr output matches some file. There are definitely pre-built tools that can do this. So I'm going to spend a little bit of time trying to set it up. |
|
I'm writing a small tool to test running the CLI & checking stderr/stdout/exit code match some expectations. I will submit the tool as a PR, then rebase this on top of it with the test cases. |
We've been unable to effectively test cases where stdin/stdout/stderr
are consoles, because in our test cases they generally aren't. Allow the
command line flags `--fake-std{in,out,err}-is-console` to tell the CLI
to pretend that std{in,out,err} is a console.
03a2c52 to
26c3e42
Compare
* Centralize the logic about whether to print the progress bar or not in the `*_PROGRESS()` macros. * Centralize the logc about whether to print the summary line or not in `FIO_shouldDisplayFileSummary()` and `FIO_shouldDisplayMultipleFileSummary()`. * Make `--progress` work for non-zstd (de)compressors. * Clean up several edge cases in compression and decompression progress printing along the way. E.g. wrong log level, or missing summary line. One thing I don't like about stdout mode, which sets the display level to 1, is that warnings aren't displayed. After this PR, we could change stdout mode from lowering the display level, to defaulting to implied `--no-progress`. But, I think that deserves a separate PR.
the
*_PROGRESS()macros.FIO_shouldDisplayFileSummary()andFIO_shouldDisplayMultipleFileSummary().--progresswork for non-zstd (de)compressors.printing along the way. E.g. wrong log level, or missing summary line.
One thing I don't like about stdout mode, which sets the display level
to 1, is that warnings aren't displayed. After this PR, we could change
stdout mode from lowering the display level, to defaulting to implied
--no-progress. But, I think that deserves a separate PR.