A developer is preparing a managed package for release and needs to validate that the package's Apex code does not exceed the per-transaction limits enforced by the platform. The developer wants to run the packaged test suite in a scratch org and see the exact number of SOQL queries and DML statements consumed during each test. Which approach best satisfies this requirement?
The JSON result format emitted by sf apex run test includes a limits object attached to every test result, exposing counters like SOQL queries and DML statements consumed. Parsing that JSON gives the developer precise, machine-readable per-test limit data, which is exactly what is required to confirm the packaged code stays within platform governor limits before release.
Why this answer
The JSON result format from sf apex run test attaches a limits object to each test result, exposing the exact SOQL and DML counters consumed by every test method. Parsing that structured output gives the developer the precise, per-test governor limit data required to prove a managed package stays within platform limits before release, which the other approaches cannot deliver.
Exam trap
The trap here is assuming that debug logs or human-readable CLI output expose per-test governor limit counters, when only the JSON result payload carries that structured limits data.