Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logic when stderr is not the console #3458

Merged
merged 2 commits into from
Jan 27, 2023
Merged

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Jan 26, 2023

When stderr is not the console, it's likely a log file or device.
In which case, interactive progress updates become a nuisance : instead of updating the same visual line as an activity signal before being overwritten by final operation summary, all these updates are appended into logs, which is rather messy.
Therefore, it's preferable to disable progress updates in these situations.

This was achieved a long time ago, by reducing the displayLevel to 1 in these cases, which is equivalent to -q.
Problem is, this would not only disable progress updates, but also all warnings, and the final operation summary.
In short, it was silencing too much.

This happened because back then we had no other tool than displayLevel.

But today, we can selectively disable progress updates, without impacting other messages.

Change the policy when stderr is not the console : only disable progress updates, but keep final operation summary (and warnings if they happen).

Updated tests/cli-tests/ accordingly.

Also : changed default policy of tests/cli-tests/ : when no .stderr.strict nor stderr.glob are provided, default to ignore stderr output.
Previous policy was requiring stderr to be empty in this case. If it's important for stderr to be empty to pass the test, provide an empty .stderr.strict file.

Previously, cli-test would, by default, check that a stderr output is strictly identical to a saved outcome.
When there was no instructions on how to interpret stderr, it would default to requiring it to be empty.

There are many tests cases though where stderr content doesn't matter, and we are mainly interested in the return code of the cli.
For these cases, it was possible to set a .ignore document, which would instruct to ignore stderr content.

This PR update the logic, to make .ignore the default.
When willing to check that stderr content is empty, one must now add an empty .strict file.

This will allow status message to evolve without triggering many cli-tests errors.
This is especially important when some of these status include compression results, which may change as a result of compression optimizations.
It also makes it easier to add new tests which only care about the CLI's return code.
but keep warnings and final operation statement.

updated tests/cli-tests/ accordingly
@Cyan4973 Cyan4973 merged commit 88b7088 into dev Jan 27, 2023
@Cyan4973 Cyan4973 mentioned this pull request Feb 9, 2023
@Cyan4973 Cyan4973 deleted the stderr_finalStatus branch February 10, 2023 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants