feat: reformat human readable output for test results #377 #385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a concise parameter to the HumanReporter format function. If false, then display all test results (current behavior). If true, only display failing tests. I have left the default value as false to preserve existing behavior, with the plan to add a --concise flag to the sf apex run test command to control this behavior.
I have also moved the summary section for test results to the bottom of the output. This makes it much easier to tell at a glance whether your tests ran successfully or not. Even with the removal of passing tests in the output, it can still be cumbersome to scroll through the results to see the summary.
I primarily have the sf cli in mind but I don't know if this is used anywhere else or if there are other considerations I'm unaware of.
What issues does this PR fix or reference?
forcedotcom/cli#2872
#243
Functionality Before
Before, the summary was at the top of the terminal output and it displayed the results of ALL test methods, which required users to scroll a lot.
Functionality After
Now, the summary is at the bottom and can optionally only display failing tests, making it easier to see when read by a human.
@W-16047075@
Thank you @k-capehart