Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Updated UUID references to RFC 9562 and clarified optional deterministic UUID generation for `testId`.

- Clarified that Test `threadId` identifies the thread or worker that executed the
final attempt, and recommended qualifying `threadId` values when test cases run
across processes or hosts (#74).
Expand Down
20 changes: 10 additions & 10 deletions spec/ctrf.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ is published.
**[RFC2119]** Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
<https://www.rfc-editor.org/rfc/rfc2119>

**[RFC4122]** Leach, P., Mealling, M., Salz, R., “A Universally Unique IDentifier (UUID) URN Namespace”, RFC 4122, July 2005.
<https://www.rfc-editor.org/rfc/rfc4122>
**[RFC9562]** Davis, K., Peabody, B., Leach, P., “Universally Unique IDentifiers (UUIDs)”, RFC 9562, May 2024.
<https://www.rfc-editor.org/rfc/rfc9562>

**[RFC3986]** Berners-Lee, T., Fielding, R., Masinter, L., “Uniform Resource Identifier (URI): Generic Syntax”, RFC 3986, January 2005.
<https://www.rfc-editor.org/rfc/rfc3986>
Expand Down Expand Up @@ -534,7 +534,7 @@ A unique identifier for this CTRF document instance.

**Requirements:**
`reportId` is OPTIONAL.
If present, it MUST be a valid UUID as defined in [RFC4122].
If present, it MUST be a valid UUID as defined in [RFC9562].
When `reportId` is used, each emitted document SHOULD receive a distinct `reportId`.

Retransmitting the same report means sending or uploading the same already-emitted CTRF document again without changing its content. A retransmission of the same report SHOULD preserve the same `reportId` when `reportId` is used.
Expand Down Expand Up @@ -886,7 +886,7 @@ A unique, stable identifier for the test case.

**Requirements:**
`id` is OPTIONAL.
If present, it MUST be a valid UUID as defined in [RFC4122].
If present, it MUST be a valid UUID as defined in [RFC9562].
Producers SHOULD prefer `testId` for new implementations.
When both `id` and `testId` are present, consumers SHOULD use `testId`.
Consumers SHOULD treat `id` as legacy unless a producer documents stronger semantics.
Expand All @@ -903,7 +903,7 @@ A stable identifier for the logical test case.
If present, it MUST be a non-empty string.
`testId` SHOULD be deterministic and stable across runs for the same test case.
When generated by a producer, `testId` SHOULD be derived from stable test attributes such as file path, suite path, and test name.
A producer MAY use a canonical string directly, or MAY encode that canonical string as a deterministic identifier such as a UUID version 5 or hash.
A producer MAY use a canonical string directly, or MAY derive a deterministic identifier from it, such as a UUID generated deterministically in accordance with [RFC9562], or a hash.

Consumers MUST treat the `testId` value as opaque.
Consumers MUST NOT assume that `testId` values generated by different producers are globally comparable unless the producers document a shared generation scheme.
Expand Down Expand Up @@ -1550,7 +1550,7 @@ The timestamp indicating when the attempt ended, in milliseconds since the Unix
If present, it MUST be an integer.
If both `start` and `stop` are present, `stop` SHOULD be greater than or equal to `start`.

### 11.12.1. `threadId`
### 11.13. `threadId`

**Description:**
Identifies the thread or worker that executed this attempt.
Expand All @@ -1560,7 +1560,7 @@ Identifies the thread or worker that executed this attempt.
If present, it MUST be a string.
When test cases run in more than one process or on more than one host, producers SHOULD qualify the value with the process or host to avoid collisions, for example, `"host-a/worker-1"`.

### 11.13. `attachments`
### 11.14. `attachments`

**Description:**
An array of attachment objects associated with this attempt.
Expand All @@ -1570,7 +1570,7 @@ An array of attachment objects associated with this attempt.
If present, it MUST be an array.
Each element MUST follow the structure defined in Section 12 (Attachment Object).

### 11.14. `extra`
### 11.15. `extra`

**Description:**
An extensibility object containing arbitrary metadata.
Expand Down Expand Up @@ -1920,7 +1920,7 @@ The unique identifier of the baseline report.

**Requirements:**
`reportId` MUST be present.
It MUST be a valid UUID as defined in [RFC4122].
It MUST be a valid UUID as defined in [RFC9562].
The referenced report SHOULD correspond to a valid CTRF document.

### 17.2. `timestamp`
Expand Down Expand Up @@ -2843,7 +2843,7 @@ Producers MAY use the resulting canonical string directly. For example:
tests/auth/login.test.ts::auth > login::user can log in
```

Producers MAY also encode the canonical string as a deterministic identifier such as a UUID version 5 or hash.
Producers MAY also derive a deterministic identifier from the canonical string, such as a UUID generated deterministically in accordance with [RFC9562], or a hash.

This approach ensures that the same test retains the same `testId` across runs, enabling consumers to analyze historical trends, flakiness, and stability.

Expand Down
Loading