-
Notifications
You must be signed in to change notification settings - Fork 405
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: run apex tests using the library #2828
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2828 +/- ##
===========================================
+ Coverage 76.03% 76.15% +0.12%
===========================================
Files 274 273 -1
Lines 10388 10453 +65
Branches 1185 1197 +12
===========================================
+ Hits 7898 7961 +63
+ Misses 2155 2151 -4
- Partials 335 341 +6
Continue to review full report at Codecov.
|
@@ -23,21 +25,81 @@ const SfdxCommandlet = sfdxCoreExports.SfdxCommandlet; | |||
const SfdxWorkspaceChecker = sfdxCoreExports.SfdxWorkspaceChecker; | |||
const SfdxCommandletExecutor = sfdxCoreExports.SfdxCommandletExecutor; | |||
const notificationService = sfdxCoreExports.notificationService; | |||
const LibraryCommandletExecutor = sfdxCoreExports.LibraryCommandletExecutor; | |||
const channelService = sfdxCoreExports.channelService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the LibraryCommandletExecutor
currently lives in the core package, it uses the default Salesforce CLI
channel from the channel services. If we switch to using the new channelService
we have in the utils package right now, the experience is wonky because the Starting command.../Ending command...
text appears in the default Salesforce CLI
channel, while the output from the test run appears in the new channel that we've created. And since the command palette portion of the test:run
functionality still lives in the core package as well, all the output from that command is displayed via the Salesforce CLI
channel too
In a follow up PR, I think we should migrate the LibraryCommandletExecutor to the utils package, the Apex commands (test:run command) to the apex extension, and then switch this command to use the new channelService so it doesn't cause customers any confusion on which channel they should be looking at for apex test results
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is part of the work we'll be doing in January to address some perf issues in the Apex extension.
channelService.appendLine(humanOutput); | ||
return true; | ||
} | ||
} | ||
|
||
// build force:apex:test:run w/ given test class or test method | ||
export class ForceApexTestRunCodeActionExecutor extends SfdxCommandletExecutor<{}> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworked this executor a bit so that it could be used for the sidebar as well
b37a73d
to
918713c
Compare
packages/salesforcedx-vscode-apex/src/commands/forceApexTestRunCodeAction.ts
Outdated
Show resolved
Hide resolved
8be5745
to
52af314
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran through the various avenues for running tests with and without code coverage, library setting on and off:
- test sidebar
- codelens
- command palette
Looks good
What does this PR do?
This PR adds the ability to run apex tests from the sidebar, code lens, and command palette using the Apex library
What issues does this PR fix or reference?
@W-7561367@