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

While tests are running, class and target TestItems are not updated #1029

Closed
adam-fowler opened this issue Aug 23, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@adam-fowler
Copy link
Contributor

Describe the bug
While tests are running, suite/XCTestCase class and target TestItems are not updated. They are only updated once the test run has finished. If you have a lot of tests this makes it hard to see progress.

To Reproduce
Steps to reproduce the behavior:

  1. Open SwiftPM project with large number of tests
  2. Go to TestExplorer
  3. Expand TestItems so you only see list of classes
  4. Run tests

Expected behavior
As each suite/XCTestCase class has all its tests completed its TestItem updated accordingly

The extension used to do this. @plemarquand I seem to remember seeing you removed the code that did this with a comment about it being unnecessary. I should have verified this but didn't.

@adam-fowler adam-fowler added the bug Something isn't working label Aug 23, 2024
@plemarquand
Copy link
Contributor

@adam-fowler I don't think I'm reproducing this correctly. The Target and Suite show the spinner as long as there are tests executing within them, but this behaviour is consistent across VS Code Swift extension releases.

To test I went back to the 1.9 release and recorded an async XCTest Run:

AsyncXCTextBehaviour_1.9.mp4

And then compared it to the same run on main.

AsyncXCTextBehaviour_Main.mp4

Perhaps VS Code has changed the underlying Test Explorer behaviour?

@adam-fowler
Copy link
Contributor Author

@plemarquand You need a project with multiple suites. The problem is once a suite has completed the test item for that suite is not updated. You'll only see this if you have multiple suites as everything is updated once the all the tests have finished. In the video below notice how the cookie tests are all completed but the CookieTests suite test item is not updated. It gets updated once all tests are complete, but I'd like to see it updated as the tests run.

test-explorer.mov

@plemarquand
Copy link
Contributor

Ah! Understood, thanks for the clarification. I'll take a look at this.

plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Aug 26, 2024
Add back some code that was removed that marked XCTest suites as
passed/failed as soon as all their tests completed. Currently the
TestExplorer shows the test suites as pending until all tests in the
whole test run have completed. This is a regression from how the Test
Explorer used to work, where suites were marked as passed/failed
immediately upon suite completion.

Issue: swiftlang#1029
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Aug 26, 2024
Add back some code that was removed that marked XCTest suites as
passed/failed as soon as all their tests completed. Currently the
TestExplorer shows the test suites as pending until all tests in the
whole test run have completed. This is a regression from how the Test
Explorer used to work, where suites were marked as passed/failed
immediately upon suite completion.

Issue: swiftlang#1029
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Aug 26, 2024
Add back some code that was removed that marked XCTest suites as
passed/failed as soon as all their tests completed. Currently the
TestExplorer shows the test suites as pending until all tests in the
whole test run have completed. This is a regression from how the Test
Explorer used to work, where suites were marked as passed/failed
immediately upon suite completion.

Issue: swiftlang#1029
plemarquand added a commit that referenced this issue Aug 27, 2024
…1031)

Add back some code that was removed that marked XCTest suites as
passed/failed as soon as all their tests completed. Currently the
TestExplorer shows the test suites as pending until all tests in the
whole test run have completed. This is a regression from how the Test
Explorer used to work, where suites were marked as passed/failed
immediately upon suite completion.

Issue: #1029
@plemarquand plemarquand added the needs verification Issue has been fixed, but requires verification before closing label Aug 27, 2024
@matthewbastien
Copy link
Member

Verified with d6c91dd

@matthewbastien matthewbastien removed the needs verification Issue has been fixed, but requires verification before closing label Aug 27, 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
Projects
None yet
Development

No branches or pull requests

3 participants