swiftlang / swiftlang/swift-testing

Ability to uniquely identify a parameterized test

Open
#671 6 comments 0 reactions 1 assignee View on GitHub

@stmontgomery is already working on this.

Since Sep 6, 2024.

enhancement public-api
Dominant language
Swift
Stars
2.2k
Forks
169
Avg merge
1d 18h
Merged PRs (30d)
56

Description

Description

Test is identifiable, which is handy to distinguish between tests and avoid letting "global" state to bleed between tests since they can be bucketed by Test.ID. Unfortunately, this breaks when it comes to parameterized tests, because each parameterized case is the same test and thus has the same identity.

Expected behavior

Ideally, Test.ID would incorporate the SPI-internal Test.Case.ID into its identity, or Test.Case.ID would be publicly accessible.

Actual behavior

Currently there's no way to access a parameterized test case's identity because it's SPI.

Steps to reproduce

No response

swift-testing version/commit hash

2e9df4ffc015cfca29ca9918cefcec5f76d06083

Swift & OS version (output of swift --version && uname -a)

n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.