Skip to content
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: introduce 3 Apex Test Suite commands #3435

Merged
merged 8 commits into from
Jul 23, 2021
Merged

feat: introduce 3 Apex Test Suite commands #3435

merged 8 commits into from
Jul 23, 2021

Conversation

AnanyaJha
Copy link
Collaborator

@AnanyaJha AnanyaJha commented Jul 21, 2021

What does this PR do?

This PR introduces Test Suites to our command palette. It adds the following commands:

  • SFDX: Run Apex Test Suite
    • Allows the user to choose an Apex Test Suite via quickpick. The test suite is run through the same code path as the test sidebar & the results are displayed after the test finishes running.
  • SFDX: Create Apex Test Suite
    • User enters the name of the new Apex Test Suite & selects tests to add to the suite via a quickpick. After selection, the command is run.
  • SFDX: Add Tests to Apex Test Suite
    • User chooses an existing Apex Test Suite and then selects tests to add to the select suite via the quickpick. After the selection, the command is run.

What issues does this PR fix or reference?

@W-9632080@
@W-9632072@
@W-9632048@

Functionality Before

new functionality!

Functionality After

Screen.Recording.2021-06-04.at.10.23.30.AM.mov

@AnanyaJha AnanyaJha requested a review from a team as a code owner July 21, 2021 17:30
@AnanyaJha AnanyaJha requested a review from xyc July 21, 2021 17:30
@randi274
Copy link
Contributor

Wow, awesome to see this added to the product! 🎉🎉

return {
label: testSuite.TestSuiteName,
// @ts-ignore
description: testSuite.Id,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The field is named incorrectly in the apex-node package so we'll need to update that so we can remove the ts-ignore here

@@ -17,5 +17,8 @@
"force_apex_test_last_method_run_text": "SFDX: Re-Run Last Run Apex Test Method",
"force_apex_test_class_run_text": "SFDX: Run Apex Test Class",
"force_apex_test_method_run_text": "SFDX: Run Apex Test Method",
"force_apex_test_run_text": "SFDX: Run Apex Tests"
"force_apex_test_run_text": "SFDX: Run Apex Tests",
"force_apex_test_suite_run_text": "SFDX: Run Apex Test Suite",
Copy link
Contributor

Choose a reason for hiding this comment

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

please have @sbudhirajadoc review this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the messages were approved beforehand in a separate doc! thanks sonal!

const apexClassItems: ApexTestQuickPickItem[] = [];

apexClasses.forEach(apexClass => {
const fileContent = readFileSync(apexClass.fsPath).toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep in mind the perf impact of this. I tested in perf-project and it took ~1s for loading the menu.

Copy link
Contributor

Choose a reason for hiding this comment

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

A change at this moment might not be needed, but if there's performance issues we should consider if we can reuse information from language server.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree - I followed the pattern we're using elsewhere, but I think both should be examined to see if we can find a better approach.

@AnanyaJha AnanyaJha merged commit 99d3632 into develop Jul 23, 2021
@AnanyaJha AnanyaJha deleted the aj/suites branch July 23, 2021 19:18
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.

None yet

3 participants