-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: reformat human readable output for test results #377
Conversation
@k-capehart We have taken a look at the PR and we really like the notion of displaying the summary last for the human reporter. We would like to move forward with this change with the following recommendations.
Let us know if you have any questions and we do appreciate the contribution. |
@peternhale That's great news! I'll definitely make those changes when I get the time and let you know. There were some concerns raised here about functionality within the CLI and making the same changes for JSON output. Is that still something I should be considering? #243 (comment) |
For this feature, let's restrict the changes to just the human format reporters. All other formatters, include JSON should remain as is. |
@peternhale Hello! I made the changes as requested. I didn't see any existing tests for |
Hmm, my bad. I would be nice to have tests ;), thanks in advance! |
@peternhale Will do 👍 Also, I think I missed something anyways. Your message mentions that if |
@k-capehart detail-coverage flag asks that test results have code coverage applied from the per class codecoverage. Results look like this
I then intentionally fail a test and run the tests again and I see
The detailed coverage for the failed test is still available, 86%. So I would say these two flags are independent, concise only shows failed tests and suppresses "=== Apex Code Coverage by Class." The flag detailed-coverage augments each test with its associated coverage. |
@peternhale Thank you, that helps. So just to confirm, using the
|
@peternhale Ok, I think things should be good now. Looks like you already saw my comments but let me know if I missed anything. |
@k-capehart Thanks for the updates and we appreciate the contribution. I will try to get to a full review and my testing by COB tomorrow. |
Thanks for the help! |
@k-capehart I found some time to review and test these changes. I did find one case that is producing undesired results in HumanReporter. It occurs when running with concise true and no test failures. The output contains |
@peternhale Thanks for catching that. It should be fixed now. I ran your tests and no longer see 'undefined'. |
@k-capehart I approved the PR and I will merge soon. Thanks again! plugin-apex should pick up the change automatically in the coming weeks FYI @mshanemc |
@peternhale Awesome, thanks so much! If you need someone to work on the update for plugin-apex I'll be happy to submit a PR there as well once this update rolls out to it. I'll keep an eye on it. |
If you want it sooner than later then all it should require is picking up the version of apex-node. |
@k-capehart I am going to close this PR. I had to fix a formatting error in human transform (that your test found, thanks again). That change and your changes from this PR have been merged in PR #383. Thanks again for this contribution. |
@peternhale Awesome! I'm happy to contribute, thanks for you assistance and support in getting it out. |
force a release for new feature @W-16047075@
What does this PR do?
Adds a
verbose
concise
parameter to the HumanReporter format function. If true, then display all test results (current behavior). If false, only display failing tests. I have left the default value astrue
false
to preserve existing behavior, with the plan to add a--verbose
--concise
flag to thesf 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?
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.