Skip to content

Conversation

@ColemanRoo
Copy link
Contributor

@ColemanRoo ColemanRoo commented Feb 10, 2025

Description

PROBLEM: Creating a new vscode test file and running the full suite was causing issues because the second test that tried to create new API, Provider, Extension, and Panel objects was crashing due to mismatches within VS Code. Attempts to dispose panels or restart the extension was causing the test run to fail. Also VS Code tests did not allow for the destruction and reconstruction of VS Code unlike how a Cypress or Selenium tests starts a new browser and driver for each test.
The VS Code test runner appears to only be able to start VS Code once

Solution: Restructuring full integration tests so that each test reuses the same Api, Provider, Extension, and Panel objects.
Each test is now able to start a new task using the global API, Provider, Extension, and Panel objects. Each test is able to set the settings needed for the test and start a new task.

With this PR, we are now able to add more VS Code tests in a coherent and standard structure.

Also included in this pr is mode switching test and verifies given the proper instructions, Roo Code can switch between the default modes as needed.

Test Procedure

Test runs locally.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

n/a

Additional Notes


Important

Restructures VS Code integration tests to reuse global objects, adds new tests for mode switching and task handling, and updates test configuration.

  • Test Structure:
    • Restructures integration tests to reuse global Api, Provider, Extension, and Panel objects, preventing crashes when creating new objects.
    • Introduces runTest.ts to manage test execution.
    • Moves extension.test.ts to suite/extension.test.ts.
  • New Tests:
    • Adds modes.test.ts to verify mode switching functionality.
    • Adds task.test.ts to test prompt and response handling.
  • Configuration:
    • Updates package.json to change test:integration script to use runTest.js.
    • Adds @types/glob and updates @types/mocha in devDependencies.

This description was created by Ellipsis for 4170479. It will automatically update as commits are pushed.

…at start new tasks

Add test for mode switching functionality
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2025

⚠️ No Changeset found

Latest commit: 4170479

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
timeout: 600000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Timeout increased to 600000 (10 min). Consider adding a comment explaining why such a long timeout is needed, to aid future maintainers.

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Nice!

@ColemanRoo ColemanRoo merged commit 4aa43d0 into main Feb 10, 2025
6 checks passed
@ColemanRoo ColemanRoo deleted the feature/enhanceFullIntegrationTests branch February 10, 2025 22:28
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.

3 participants