force:apex:test:run --verbose no longer emitting output to stdout
See original GitHub issueSince upgrading to sfdx-cli version 7.112.0, I am noticing that the following command is no longer outputting command output to stdout:
sfdx force:apex:test:run -w 60 --verbose
Prior to this installing this upgrade, I would see periodic output to stdout indicating the cli was polling for updates, and then at the end of the test run, it would spit out a summary of all of the tests that were run, along with a summary of how many tests passed or failed. The lack of output is particularly problematic in our CI environment, which runs against Scratch Orgs, and then deletes the Scratch Orgs upon completion, so thereβs no record of the tests that failed.
Steps To Reproduce:
- Execute the command against your Apex code base with unit test classes:
sfdx force:apex:test:run -w 60 --verbose
Expected result
I expect to see periodic progress updates while the tests are running, and a test summary when the test run completes.
Actual result
No output is emitted to stdout either while the tests are running, or once the tests have completed.
System Information
D:\Development\sfptdev.tom>sfdx version --verbose --json
{
"cliVersion": "sfdx-cli/7.113.0",
"architecture": "win32-x64",
"nodeVersion": "node-v14.17.4",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.2.2 (core)",
"@oclif/plugin-not-found 1.2.4 (core)",
"@oclif/plugin-plugins 1.10.1 (core)",
"@oclif/plugin-update 1.4.0-3 (core)",
"@oclif/plugin-warn-if-update-available 1.7.0 (core)",
"@oclif/plugin-which 1.0.3 (core)",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"@salesforce/sfdx-trust 3.6.0 (core)",
"alias 1.1.10 (core)",
"apex 0.2.3 (core)",
"auth 1.7.1 (core)",
"config 1.2.23 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.0 (core)",
"etcopydata 0.6.4-Beta (beta)",
"generator 1.1.7 (core)",
"limits 1.2.1 (core)",
"org 1.6.9 (core)",
"salesforce-alm 52.2.4 (core)",
"schema 1.0.8 (core)",
"sfdx-cli 7.113.0 (core)",
"source 1.0.7 (core)",
"telemetry 1.2.3 (core)",
"templates 52.1.0 (core)",
"user 1.4.0 (core)"
],
"osVersion": "Windows_NT 10.0.19042"
}
This also happens in our CI/CD environment, which is based on GitHub Actions running on Ubuntu VMs.
Additional Information
Here is an excerpt of test output generated by an earlier version of sfdx-cli (sorry, I do not know the exact version this was generated by):
test:
[exec] Using specified username xxxxxxxxxxxxxxxxxxx
[exec]
[exec] Listening for results
[exec] Invoking Apex tests...
[exec] Started async test run job: 7071E0000BQ1FGx
[exec] Processing event for job 7071E0000BQ1FGxQQN
[exec] Processing event for job 7071E0000BQ1FGxQQN
.
.
.
[exec] Processing event for job 7071E0000BQ1FGxQQN
[exec] Processing event for job 7071E0000BQ1FGxQQN
[exec] Retrieving test results for job 7071E0000BQ1FGx...
[exec]
[exec] === Test Results
[exec] TEST NAME OUTCOME MESSAGE RUNTIME (MS)
[exec] βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββββββ βββββββ ββββββββββββ
[exec] fflib_AnswerTest.thatAnswerOnlyForTheMethodStubbedWithAnswer Pass 73
[exec] fflib_AnswerTest.thatAnswerOnlyForTheStubbedParameter Pass 15
[exec] fflib_AnswerTest.thatAnswersWithException Pass 13
.
.
.
[exec] UT_TestDataFactory.requirePersistenceTypeToNotBe_When_actualIsNotTheTypeToExclude_Expect_Success Pass 8
[exec] UT_TestDataFactory.requirePersistenceType_When_actualDoesNotMatchRequired_Expect_Exception Pass 10
[exec] UT_TestDataFactory.requirePersistenceType_When_actualMatchesRequired_Expect_Success Pass 9
[exec]
[exec] === Test Summary
[exec] NAME VALUE
[exec] βββββββββββββββββββ βββββββββββββββββββββββββββββ
[exec] Outcome Passed
[exec] Tests Ran 1722
[exec] Passing 1722
[exec] Failing 0
[exec] Skipped 0
[exec] Pass Rate 100%
[exec] Fail Rate 0%
[exec] Test Start Time Aug 10, 2021 5:47 PM
[exec] Test Execution Time 5110078 ms
[exec] Test Total Time 2112927 ms
[exec] Command Time 605235 ms
[exec] Hostname xxxxxxxxxxxxxxxxx
[exec] Org Id xxxxxxxxxxxxxxxxxx
[exec] Username xxxxxxxxxxxxxxxxx
[exec] Test Run Id 7071E0000BQ1FGx
[exec] User Id 00580000001jihXAAQ
[exec]
BUILD SUCCESSFUL
Total time: 10 minutes 9 seconds
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (2 by maintainers)
Top GitHub Comments
Iβll take this on.
I am now seeing the test summary written to the console upon completion without having to add the β-r humanβ option.