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

Include filename, line and column in test IDs #1152

Open
ahoppen opened this issue Mar 28, 2024 · 3 comments
Open

Include filename, line and column in test IDs #1152

ahoppen opened this issue Mar 28, 2024 · 3 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@ahoppen
Copy link
Collaborator

ahoppen commented Mar 28, 2024

The test IDs returned by #1151 don’t qualify the tests with the filename, line and column. Because of this, the test IDs may be ambiguous, eg. when multiple files define a private @Test function with the same name.

We should include the filename, line and column in the test ID as MyModule.S/f()/Tests.swift:2:3.

Note that when trying to test this, the --filter argument takes a regex, so the parentheses need to be escaped (and technically .)

@ahoppen
Copy link
Collaborator Author

ahoppen commented Mar 28, 2024

Tracked in Apple’s issue tracker as rdar://125555338

@adam-fowler
Copy link
Contributor

Out of interest how is swift-testing dealing with this? Would a filter MyModule.S/f\(\) run both tests?

@ahoppen
Copy link
Collaborator Author

ahoppen commented Mar 28, 2024

My understanding is that the filter is a regex and MyModule.S/f\(\) would match both MyModule.S/f\(\)/FileA.swift:1:1 and MyModule.S/f\(\)/FileB.swift:1:1 and thus run both tests.

@ahoppen ahoppen added the good first issue Good for newcomers label May 3, 2024
@kimdv kimdv self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants