feat(apex-testing): new command SFDX: Edit Apex Test Suite that includes add and remove functionality - W-23257457#7672
Draft
peternhale wants to merge 25 commits into
Draft
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…d - W-23257457 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…on activation - W-23257457 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…23257457 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…aveResult, fix test assertions - Convert Effect.promise to Effect.tryPromise for tooling.query and tooling.delete calls so rejections become typed errors instead of unrecoverable defects - Inspect SaveResult[] from tooling.delete to detect partial failures - Show informational message when suite is empty instead of silent cancellation - Replace brittle textContent() snapshot in E2E with retry-capable assertion - Use panel-scoped locator for tree absence check instead of page-scoped - Replace notificationService wrapper with direct vscode.window call - Use flatMap instead of map+filter for RemovableClassItem construction Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Tighten verbose prose to fragment style per concise skill. Add missing check:dupes verification step. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… command palette checkboxes
…r Tooling API The Tooling API does not support the composite/sobjects batch endpoint that jsforce routes array deletes through. Switch to Promise.all of individual delete calls. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… Apex test suites via command palette
…new-command-sfdx-remove-apex-tests-from
…command Replace separate "Add Tests to Apex Test Suite" and "Remove Tests from Apex Test Suite" commands with unified "Edit Apex Test Suite" command. New UX shows multi-select picker with all test classes, current suite members pre-checked. Users check/uncheck to add/remove. Changes: - Unified sf.apex.test.suite.add and sf.apex.test.suite.remove into sf.apex.test.suite.edit - Added gatherEditOptions with proper ApexClass ID matching for pre-checked state - Added applyEdits to handle parallel add/remove operations - Updated i18n for English and Japanese - Updated E2E specs to test unified edit workflow - Updated documentation (README, walkthrough) Also includes: - Fixed pre-existing lint warnings in salesforcedx-apex (Function type → proper signatures) - Fixed import order in logService.ts - Added fileSystemHandler.ts to knip ignore list (false positive) Reduces command palette clutter from 4 suite commands to 3.
…Edit Apex Test Suite
…nified-edit-command
…nified-edit-command
…ex tests from the suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds Apex Test Suite editing support — the ability to add and remove tests from a suite
directly from VS Code — and delivers it as a single unified "Edit Apex Test Suite"
command (
sf.apex.test.suite.edit).Phase 1 — Remove Tests from Apex Test Suite:
apexTestSuiteRemove: queries currentTestSuiteMembershiprecords, presentsa multi-select quick pick of current members, removes selected classes via Tooling API
TestSuiteMembershiprecords individually (batch endpoint unsupported)Effect.tryPromisefor all tooling calls so rejections surface as typed errorssilent cancellation)
Phase 2 — Unify add/remove into a single Edit command:
sf.apex.test.suite.addandsf.apex.test.suite.removewithsf.apex.test.suite.editpre-checked; toggling adds or removes in one step
gatherEditOptions()queries suite membership and all ApexClasses in parallel, usesApexClass ID matching to correctly pre-check existing members
applyEdits()handles add/remove as parallel Tooling API operationsAlso includes:
salesforcedx-apex(Function→ proper signatures,import order in
logService.ts)fileSystemHandler.tsto knip ignore list (false positive)What issues does this PR fix or reference?
@W-23257457@
Functionality Before
No way to remove tests from a suite in VS Code. Adding tests required a separate "Add Tests
to Apex Test Suite" command with no visibility into current membership.
Functionality After
Single "SFDX: Edit Apex Test Suite" command. Multi-select picker shows all test classes with
current suite members pre-checked — check/uncheck to add or remove in one operation.
Testing