Skip to content

feat: Add setup[] array to json output- @W-23750625@ - #958

Merged
WillieRuemmele merged 2 commits into
mainfrom
sl/W-23750625
Aug 7, 2026
Merged

feat: Add setup[] array to json output- @W-23750625@#958
WillieRuemmele merged 2 commits into
mainfrom
sl/W-23750625

Conversation

@soridalac

Copy link
Copy Markdown
Contributor

What does this PR do?

Summary

  • Add @testsetup method results to the JSON report output as a setup[] array
  • Previously, @testsetup results were computed internally but dropped by the JsonReporter, making them invisible in sf apex get test -r json output
  • This caused a mismatch where summary.testsRan counted all tests (including setup) but tests[] only contained regular test methods
  • Added CliTestSetupResult type and setup?: CliTestSetupResult[] to RunResult
  • JsonReporter.format() now maps result.setup into the output when present

Test plan

  • Added unit test: "should include @testsetup methods in setup array"
  • Existing reporter tests still pass
  • Verified with linked plugin against real scratch org (test run 707KE00000RI1M1YAL)

What issues does this PR fix or reference?

@W-23750625@

@soridalac soridalac changed the title W-23750625- add setup[] to json output W-23750625- add setup[] array to json output Aug 6, 2026
@soridalac soridalac changed the title W-23750625- add setup[] array to json output @W-23750625- add setup[] array to json output Aug 6, 2026
@soridalac soridalac changed the title @W-23750625- add setup[] array to json output feat(W-23750625): Add setup[] array to json output Aug 6, 2026
@soridalac soridalac changed the title feat(W-23750625): Add setup[] array to json output feat: Add setup[] array to json output- @W-23750625@ Aug 6, 2026
@WillieRuemmele

Copy link
Copy Markdown
Contributor

QA Notes


✅ :

../../oss/plugin-apex/bin/run.js apex get test -i 707KE00000RI1M1YAL -r json -o test-5sfw5fmzly8h@example.com --json 2>&1 | jq '.result.setup | length' 
824
➜  dreamhouse-lwc git:(main) ✗  hub:(DevHub) scratch:(test-kxgl9zcodaif@example.com) ➜  sf apex get test -i 707KE00000RI1M1YAL -r json -o test-5sfw5fmzly8h@example.com --json 2>&1 | jq '.result.setup | length'
jq: parse error: Invalid numeric literal at line 1, column 5

@WillieRuemmele
WillieRuemmele merged commit 7f74014 into main Aug 7, 2026
14 checks passed
@WillieRuemmele
WillieRuemmele deleted the sl/W-23750625 branch August 7, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants