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

"Run Test" gutter icon does not show "in-progress" icon when Swift Testing test are demanded #1218

Open
bkhouri opened this issue Nov 21, 2024 · 1 comment
Labels
bug Something isn't working test runner

Comments

@bkhouri
Copy link

bkhouri commented Nov 21, 2024

Describe the bug
When selecting the "Run/Debug Test" from the VSCode gutter, the gutter icon is not updated to "In Progress" icon when a Swift Testing test is selected.

To Reproduce
Steps to reproduce the behavior:

  1. Open a file that has Swift Testing test case
  2. Click on the "Run Test" gutter icon
  3. Notice the gutter icon remain the "Play" icon until the test result is available

Another Reproduction steps:

  1. Checkout Test: Add platform helpers swift-package-manager#8099
  2. Open VSCode
  3. Navigate to file Tests/_InternalTestSupportTests/PlatformHelpersTests.swift
  4. Select "Run Test" or "Run Suite" gutter.and wait...

Expected behavior
Once the "Run Test" or "Run Suite" gutter icon was selected, the button icon is update to in indicate the request was put in the queue.

Actual behavior
When selecting the Gutter icon, there is no indication from the gutter icon to indicate what is happening. As a user, I'm left wondering if VSCode is processing the request or not. I tend to click the Gutter icon numerous times, only to then discover the status bar indicating there is a build activity - in which I assume is related to building my tests. The gutter icon is only updated once the test results are available.

Environment

  • OS: macOS
  • Swift version (output of swift --version)
  • Visual Studio Code version:
    Version: 1.95.3 (Universal)
    Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
    Date: 2024-11-13T14:50:04.152Z
    Electron: 32.2.1
    ElectronBuildId: 10427718
    Chromium: 128.0.6613.186
    Node.js: 20.18.0
    V8: 12.8.374.38-electron.0
    OS: Darwin arm64 24.2.0
    
  • vscode-swift version: v1.11.3

Additional context
See the attached screen recording for the behaviour

@plemarquand
Copy link
Contributor

A little explanation for why this is an issue. The VS Code APIs require test runs to have all their tests specified at creation time. Because swift testing has parameterized tests, we can’t know this full list until the build completes and swift testing starts and provides us with all the individual test cases generated at run time.

Ultimately this means that we must delay creating the VS Code test run when swift testing tests are involved until after the build. This means the icon wont update when running swift testing tests until potentially much later than with XCTest test runs.

If VS Code allowed for dynamically updating the list of tests in a test run then we could make this just as smooth as XCTest.

@award999 award999 moved this from Backlog to In Progress in Swift Extension for Visual Studio Code Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test runner
Development

No branches or pull requests

3 participants