Skip to content

Conversation

@EstebanRomero84
Copy link
Contributor

@EstebanRomero84 EstebanRomero84 commented Sep 9, 2025

What does this PR do?

Adds new topic called logic and new command called logic get test.
This command can fetch the result of a unified test run, which can include Apex and Flow test results in the same operation.
The results in human format will include a new column called Category.
The results in json format will include a new property called Category.

What issues does this PR fix or reference?

@W-19262690@

QA Instructions

  • Prerequisite:
    - scratch org with version 258.
    - Apex and Flow tests in the org.
  • Steps:
    • Run apex run test command. Due to the current state of the command, it will run all Apex and Flow test in the org.
    • Use the returned ID of the test run to run logic get test -i 707...

@EstebanRomero84 EstebanRomero84 marked this pull request as ready for review September 10, 2025 14:30
@EstebanRomero84 EstebanRomero84 requested a review from a team as a code owner September 10, 2025 14:30
Copy link
Contributor

@mdonnalley mdonnalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me 👍

@mdonnalley
Copy link
Contributor

QA:

setup

  • linked plugin-apex into sf
  • logged into orgfarm org provided by Esteban

🟢 sf apex test run returned a 707 id
🟢 sf logic get test -i <id> returned the test results

Copy link
Contributor

@jshackell-sfdc jshackell-sfdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a few suggestions, so I didn't create a whole new PR for you to review and merge. See my comments for some of the suggestions, tho -- they may not be correct. Thx!


# description

When you run 'sf logic run test' asynchronously, it returns a test run ID. Use that ID with this command to see the results.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When you run 'sf logic run test' asynchronously, it returns a test run ID. Use that ID with this command to see the results.
When you run 'sf logic run test' to test Apex classes and Flows asynchronously, it returns a test run ID. Use that ID with this command to see the results.


# examples

- Get the results for a specific test run ID in the default human-readable format:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Get the results for a specific test run ID in the default human-readable format:
- Get the results for a specific test run ID in the default human-readable format; uses your default org:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EstebanRomero84 , I like to show examples of using the default org and then --target-org to specify one. However, I've always been a little confused about how this works when using an ID from a previous async command. I mean, aren't the test run IDs always tied to the org against which the "logic run test" command was originally run? But then --target-org is required for this command. So it's confusing. Anyway, I'm suggesting we show this "how to specify an org" thing with these examples, but if you think it doesn't make sense, then reject my suggestion. Thx.


<%= config.bin %> <%= command.id %> --test-run-id <test run id>

- Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit" directory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit" directory:
- Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit" directory; uses the org with alias "my-scratch":

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


- Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit" directory:

<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit
<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit --target-org my-scratch

package.json Outdated
}
},
"logic": {
"description": "Use the logic commands to run Apex tests and view Apex test results.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "Use the logic commands to run Apex tests and view Apex test results.",
"description": "Use the logic commands to run Apex and Flow tests and view the test results.",

@EstebanRomero84 EstebanRomero84 merged commit 0d0a135 into main Sep 11, 2025
25 checks passed
@EstebanRomero84 EstebanRomero84 deleted the er/logic-get-test-command branch September 11, 2025 22:39
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.

4 participants