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

Running tests of a test class that has as many tests as there are test classes in the module will run all tests in the module #1183

Open
ahoppen opened this issue Oct 30, 2024 · 0 comments
Labels
needs verification Issue has been fixed, but requires verification before closing

Comments

@ahoppen
Copy link
Member

ahoppen commented Oct 30, 2024

If you have a project with the following test file and no other tests and you try to run MyTests, then it will run MyOtherTests as well.

import XCTest

class MyTests: XCTestCase {
  func test1() {}
  func test2() {}
}

class MyOtherTests: XCTestCase {
  func testOther() {}
}

I think the bug is that itemContainingAllArgs is just checking counts and because there are two tests to run, it thinks that all the tests in the module (or project, not sure about the granularity here) are included, because the module/project also has two children.

return xcTestArgs.length + swiftTestArgs.length === testItem.children.size;

@plemarquand plemarquand self-assigned this Oct 30, 2024
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Oct 31, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: swiftlang#1183
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Oct 31, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: swiftlang#1183
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Oct 31, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: swiftlang#1183
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Oct 31, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: swiftlang#1183
plemarquand added a commit to plemarquand/vscode-swift that referenced this issue Oct 31, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: swiftlang#1183
plemarquand added a commit that referenced this issue Nov 1, 2024
If the user tried to run a test suite that had as many tests as there
are test suites in the module we improperly simplified the test
arguments to run all suites in the module.

This patch fixes this behaviour, and also introduces more robust tests.

Issue: #1183
@award999 award999 added the needs verification Issue has been fixed, but requires verification before closing label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs verification Issue has been fixed, but requires verification before closing
Projects
Status: Needs Verification
Development

No branches or pull requests

3 participants