Skip to content

chore(vscode): move tests to central temp dir creation#5054

Merged
benfdking merged 1 commit intomainfrom
moving_to_centralise_temp_dir_building
Jul 29, 2025
Merged

chore(vscode): move tests to central temp dir creation#5054
benfdking merged 1 commit intomainfrom
moving_to_centralise_temp_dir_building

Conversation

@benfdking
Copy link
Contributor

  • cleans up tem dir after every test

- cleans up tem dir after every test
@benfdking benfdking force-pushed the moving_to_centralise_temp_dir_building branch from af42dfa to 5e328e8 Compare July 29, 2025 11:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes temporary directory creation for VSCode extension tests by moving it to a reusable fixture. This eliminates code duplication across test files where each test was creating its own temporary directory, and ensures automatic cleanup after each test completes.

  • Moves temp directory creation from individual tests to a central tempDir fixture in fixtures.ts
  • Updates all test files to use the new tempDir parameter instead of creating directories manually
  • Adds automatic cleanup of temporary directories after each test

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.

File Description
vscode/extension/tests/fixtures.ts Adds centralized tempDir fixture with automatic creation and cleanup
vscode/extension/tests/*.spec.ts Updates test functions to accept tempDir parameter instead of creating directories manually

Comment on lines +57 to +59
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
{ auto: true },
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

Using @ts-expect-error to suppress TypeScript errors is not a good practice. Consider fixing the underlying type issue or using a more specific type annotation instead of suppressing the error.

Suggested change
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
{ auto: true },
{ auto: true as boolean },

Copilot uses AI. Check for mistakes.
async function setupEnvironment(): Promise<{
tempDir: string
async function setupEnvironment(tempDir: string): Promise<{
pythonDetails: PythonEnvironment
Copy link

Copilot AI Jul 29, 2025

Choose a reason for hiding this comment

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

The function signature change removes the return of tempDir but the return type still includes it in the destructuring pattern. This creates an inconsistency between what the function returns and what callers expect.

Suggested change
pythonDetails: PythonEnvironment
pythonDetails: PythonEnvironment;

Copilot uses AI. Check for mistakes.
@benfdking benfdking changed the title chore(vscode): move to central temp dir creation chore(vscode): move tests to central temp dir creation Jul 29, 2025
@benfdking benfdking merged commit bb87f05 into main Jul 29, 2025
26 of 27 checks passed
@benfdking benfdking deleted the moving_to_centralise_temp_dir_building branch July 29, 2025 11:51
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.

2 participants