diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6bf05..590dbaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Defined parameterized test cases and consistently distinguished test cases, test objects, and executions throughout the specification and schema descriptions without changing execution or retry semantics. + - 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 diff --git a/schema/ctrf.schema.json b/schema/ctrf.schema.json index 8228832..7a26a05 100644 --- a/schema/ctrf.schema.json +++ b/schema/ctrf.schema.json @@ -79,31 +79,31 @@ ], "properties": { "tests": { - "description": "Total number of tests executed", + "description": "Total number of test cases executed", "type": "integer" }, "passed": { - "description": "Count of tests with status 'passed'", + "description": "Count of test cases with status 'passed'", "type": "integer" }, "failed": { - "description": "Count of tests with status 'failed'", + "description": "Count of test cases with status 'failed'", "type": "integer" }, "skipped": { - "description": "Count of tests with status 'skipped'", + "description": "Count of test cases with status 'skipped'", "type": "integer" }, "pending": { - "description": "Count of tests with status 'pending'", + "description": "Count of test cases with status 'pending'", "type": "integer" }, "other": { - "description": "Count of tests with status 'other'", + "description": "Count of test cases with status 'other'", "type": "integer" }, "flaky": { - "description": "Count of flaky tests (passed after failed attempts)", + "description": "Count of flaky test cases (passed after failed attempts)", "type": "integer" }, "suites": { @@ -130,7 +130,7 @@ "additionalProperties": false }, "tests": { - "description": "List of test cases executed during the run", + "description": "List of test case results for the run", "type": "array", "items": { "description": "Individual test case result", @@ -144,7 +144,7 @@ "minLength": 1 }, "testId": { - "description": "Stable identifier for the logical test case. Should be derived from stable test attributes when generated by a producer", + "description": "Stable identifier for the test case. Should be derived from stable test attributes when generated by a producer", "type": "string", "minLength": 1 }, @@ -168,19 +168,19 @@ "enum": [ "passed", "failed", "skipped", "pending", "other" ] }, "duration": { - "description": "Test execution time (milliseconds)", + "description": "Execution time of the test case (milliseconds)", "type": "integer" }, "start": { - "description": "Test start time (milliseconds since Unix epoch)", + "description": "Test case execution start time (milliseconds since Unix epoch)", "type": "integer" }, "stop": { - "description": "Test end time (milliseconds since Unix epoch)", + "description": "Test case execution end time (milliseconds since Unix epoch)", "type": "integer" }, "suite": { - "description": "Suite hierarchy from top-level to immediate parent", + "description": "Suite hierarchy for the test case, from top-level to immediate parent", "type": "array", "minItems": 1, "items": { @@ -200,7 +200,7 @@ "type": "string" }, "ai": { - "description": "AI-generated diagnostic data or suggestions", + "description": "AI-generated diagnostic data or suggestions related to the test result", "type": "string" }, "line": { @@ -253,15 +253,15 @@ } }, "type": { - "description": "Test classification (e.g., 'unit', 'integration', 'e2e')", + "description": "Test case classification (e.g., 'unit', 'integration', 'e2e')", "type": "string" }, "filePath": { - "description": "Path to the file defining this test", + "description": "Path to the file defining this test case", "type": "string" }, "retries": { - "description": "Number of times the test was re-executed after its initial attempt", + "description": "Number of times the test case was re-executed after its initial attempt", "type": "integer", "minimum": 0 }, @@ -383,7 +383,7 @@ } }, "flaky": { - "description": "True if test passed after one or more failed attempts", + "description": "True if the test case passed after one or more failed attempts", "type": "boolean" }, "stdout": { @@ -450,11 +450,11 @@ } }, "parameters": { - "description": "Test parameters or input values", + "description": "Test parameters, input values, or contextual data relevant to the execution", "type": "object" }, "steps": { - "description": "Test steps or sub-operations", + "description": "Steps or sub-operations performed during test execution", "type": "array", "items": { "description": "Individual test step", @@ -484,7 +484,7 @@ } }, "insights": { - "description": "Derived metrics for this test across runs", + "description": "Derived metrics for this test case across runs", "type": "object", "properties": { "passRate": { @@ -508,7 +508,7 @@ "$ref": "#/definitions/metricDelta" }, "executedInRuns": { - "description": "Number of runs this test was executed in", + "description": "Number of runs this test case was executed in", "type": "integer" }, "extra": { @@ -638,7 +638,7 @@ "$ref": "#/definitions/metricDelta" }, "averageTestDuration": { - "description": "Average test duration with baseline comparison", + "description": "Average duration of test case executions with baseline comparison", "$ref": "#/definitions/metricDelta" }, "runsAnalyzed": { diff --git a/spec/ctrf.md b/spec/ctrf.md index f0e8667..376623e 100644 --- a/spec/ctrf.md +++ b/spec/ctrf.md @@ -128,7 +128,7 @@ At the same time, CTRF remains human-readable JSON to support debugging, inspect ### 2.3. Flat Test Result Representation -CTRF represents test results as a flat collection of test cases rather than a nested suite hierarchy. +CTRF represents test case results as a flat collection rather than a nested suite hierarchy. Logical grouping and hierarchy are expressed through explicit metadata fields such as `suite`, `filePath`, `tags`, and `parameters`, rather than through document structure. @@ -136,7 +136,7 @@ This approach: - simplifies merging of sharded or parallel executions - avoids assumptions imposed by specific test frameworks -- enables stable test identification across runs +- enables stable test case identification across runs - supports efficient aggregation and filtering Consumers MAY reconstruct hierarchical views for presentation purposes, but such hierarchy is not encoded structurally in the CTRF document. @@ -194,7 +194,7 @@ CTRF favors explicit fields and documented semantics over inferred or implicit b For example: -- test retry histories are represented explicitly as attempt history entries +- retry histories for test cases are represented explicitly as attempt history entries - derived metrics are represented as insights rather than inferred - hierarchy is expressed as metadata rather than structure @@ -276,7 +276,7 @@ interpreted as described in [RFC2119]. The complete CTRF document. A report always contains the results of a single test execution run, and MAY additionally include derived insights computed across multiple runs. **Run**: -A single **logical** execution of a test suite or collection of tests. +A single **logical** execution of a test suite or collection of test cases. A run MAY consist of multiple physical executions (for example, shards or parallel workers) that are part of the same coordinated execution context. **Producer**: @@ -286,37 +286,39 @@ A tool, system, or process that generates CTRF reports by capturing and structur A tool, system, or process that reads and interprets CTRF reports for purposes such as analysis, visualization, alerting, or trend detection. **Test Case**: -An individual executable test, represented in CTRF as an entry within the `tests` array. +An individual executable test. For parameterized tests, each distinct combination of test logic and case-defining parameters constitutes a separate test case. +For example, `login(username="alice")` and `login(username="bob")` are distinct test cases that use the same test logic. +The Test object records an execution of a test case; its retries are attempts of that same case. **Status**: The final outcome of a test case. The `status` field MUST be one of: `passed`, `failed`, `skipped`, `pending`, or `other`. **Attempt**: -A single execution of a test case. The first execution is attempt number 1. Subsequent executions of the same test case, performed because the test was retried, are also attempts with incrementing attempt numbers. +A single execution of a test case. The first execution is attempt number 1. Subsequent executions of the same test case, performed because the test case was retried, are also attempts with incrementing attempt numbers. **Initial Attempt**: The first execution of a test case. The initial attempt has attempt number 1 and is not a retry. **Retry** / **Retry Attempt**: -Any attempt with an attempt number greater than 1. Retries occur when a test is re-executed after a failure or based on a retry policy. +Any attempt with an attempt number greater than 1. Retries occur when a test case is re-executed after a failure or based on a retry policy. **Previous Attempt**: Any attempt completed before the final attempt. A previous attempt may be the initial attempt or an earlier retry. **Final Attempt**: -The last execution of a test case. Its outcome and execution data are represented by the test object. When a test is not retried, the initial attempt is also the final attempt. +The last execution of a test case. Its outcome and execution data are represented by the test object. When a test case is not retried, the initial attempt is also the final attempt. **Retry History**: The ordered previous attempts recorded in `retryAttempts`. Despite the field name, this history includes the initial attempt when a retry occurred and excludes the final attempt represented by the test object. -**Flaky Test**: -A test is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. +**Flaky Test Case**: +A test case is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. **Environment**: -The system, platform, or context in which tests were executed, including build, commit, branch, OS, and other metadata. +The system, platform, or context in which test cases were executed, including build, commit, branch, OS, and other metadata. **Build**: -The CI/CD pipeline execution or build context in which the tests were run. Build metadata appears in the `environment` object. +The CI/CD pipeline execution or build context in which the test cases were run. Build metadata appears in the `environment` object. **Baseline**: A previously generated CTRF report used as a reference for comparison with the current report when evaluating trends or regressions. @@ -325,7 +327,7 @@ A previously generated CTRF report used as a reference for comparison with the c Derived or aggregated metrics calculated across one or more test runs. Insights MAY be applied at the run-level or at the individual test case level. **Metric**: -A quantitative value describing some property of a set of tests or runs (for example, pass rate or average duration). Metrics are often represented as `metricDelta` objects within insights. +A quantitative value describing some property of a set of test cases or runs (for example, pass rate or average duration). Metrics are often represented as `metricDelta` objects within insights. **Metric Delta**: A structure describing a metric’s `current` value, the corresponding value from a `baseline` run, and the computed `change` between them. @@ -396,7 +398,7 @@ Extension keys are opaque identifiers. Consumers MUST NOT interpret extension keys as hierarchical paths. A producer SHOULD use the same namespace prefix consistently across all `extra` objects within a single document. -If a producer contributes extensions at multiple levels (for example, at the top level, within `results`, `summary`, or individual tests), the same namespace prefix SHOULD be used for all of that producer's extension keys throughout the document. +If a producer contributes extensions at multiple levels (for example, at the top level, within `results`, `summary`, or individual test objects), the same namespace prefix SHOULD be used for all of that producer's extension keys throughout the document. #### 4.6.2. Extension Values @@ -439,7 +441,7 @@ Each layer addresses a distinct identification concern: 1. **Document**: `reportId` identifies the emitted CTRF document as a serialized artifact. When `reportId` is used, each CTRF document SHOULD have exactly one `reportId`. 2. **Run**: `runId` identifies the logical test run. Multiple CTRF documents MAY share the same `runId` when they represent shards or partitions of a single coordinated execution. -3. **Test case**: `testId` identifies the logical test case within the producer's chosen scope. It SHOULD be deterministic and stable across runs within that scope, enabling cross-run analysis, trending, and flake detection. +3. **Test case**: `testId` identifies the test case within the producer's chosen scope. It SHOULD be deterministic and stable across runs within that scope, enabling cross-run analysis, trending, and flake detection. 4. **Execution**: `executionId` identifies the complete execution lifecycle of a test case within a run. An execution MAY include previous attempts represented in `retryAttempts` followed by the final attempt represented by the test object. 5. **Attempt**: `attemptId` identifies an individual attempt within an execution, either the final attempt on the test object or an earlier attempt in `retryAttempts`. 6. **Attachment**: `attachmentId` identifies a specific attachment reference instance. @@ -457,8 +459,8 @@ Each identity field has an intended uniqueness scope: |---|---| | `reportId` | Unique per document | | `runId` | Unique per logical run | -| `testId` | Stable within the producer's chosen scope for the logical test case | -| `executionId` | Unique for one execution of a logical test case within a run | +| `testId` | Stable within the producer's chosen scope for the test case | +| `executionId` | Unique for one execution of a test case within a run | | `attemptId` | Unique for one recorded attempt within an execution | | `attachmentId` | Unique within the containing parent object | | `shardId` | Unique within a logical run | @@ -474,7 +476,7 @@ Identity fields differ in whether their values persist across runs or are unique |---|---| | `reportId` | Stable across retransmissions of the same report; changes for materially changed report content | | `runId` | Stable across all documents belonging to the same logical run | -| `testId` | Stable across runs for the same logical test case within the producer's chosen scope | +| `testId` | Stable across runs for the same test case within the producer's chosen scope | | `executionId` | Unique per execution; not stable across runs | | `attemptId` | Unique per recorded attempt; not stable across runs | | `attachmentId` | Unique per attachment reference instance | @@ -548,7 +550,7 @@ If a materially changed, regenerated, merged, filtered, or transformed CTRF docu **Description:** Identifies the logical test run to which this document belongs. -A logical run MAY span multiple CTRF documents (for example, when tests are distributed across shards or parallel workers). All documents belonging to the same coordinated execution SHOULD share the same `runId`. +A logical run MAY span multiple CTRF documents (for example, when test cases are distributed across shards or parallel workers). All documents belonging to the same coordinated execution SHOULD share the same `runId`. Multiple CTRF documents MAY share the same `runId` when they describe results from the same logical run. @@ -666,7 +668,7 @@ It MUST follow the structure defined in Section 8 (Summary Object). ### 6.3. `tests` **Description:** -Contains the list of test cases executed during the test run. +Contains the results of test cases executed during the test run. **Requirements:** `tests` MUST be present. @@ -743,7 +745,7 @@ It is the ONLY permitted extension point directly under the `tool` object. ## 8. Summary Object -The `summary` object provides a high-level overview of the test run, including counts of test outcomes and timing information. It offers an at-a-glance representation of the overall state of the run. +The `summary` object provides a high-level overview of the test run, including counts of test case outcomes and timing information. It offers an at-a-glance representation of the overall state of the run. The `summary` object MUST be present within the `results` object. @@ -754,7 +756,7 @@ Each field within the `summary` object is described in the subsections below. ### 8.1. `tests` **Description:** -The total number of tests executed in the run. +The total number of test cases executed in the run. **Requirements:** `tests` MUST be present. @@ -764,7 +766,7 @@ It SHOULD equal the length of the `tests` array in the `results` object. ### 8.2. `passed` **Description:** -The count of tests that completed with a status of `passed`. +The count of test cases that completed with a status of `passed`. **Requirements:** `passed` MUST be present. @@ -773,7 +775,7 @@ It MUST be a non-negative integer. ### 8.3. `failed` **Description:** -The count of tests that completed with a status of `failed`. +The count of test cases that completed with a status of `failed`. **Requirements:** `failed` MUST be present. @@ -782,7 +784,7 @@ It MUST be a non-negative integer. ### 8.4. `pending` **Description:** -The count of tests whose status is `pending`. +The count of test cases whose status is `pending`. **Requirements:** `pending` MUST be present. @@ -791,7 +793,7 @@ It MUST be a non-negative integer. ### 8.5. `skipped` **Description:** -The count of tests whose status is `skipped`. +The count of test cases whose status is `skipped`. **Requirements:** `skipped` MUST be present. @@ -800,7 +802,7 @@ It MUST be a non-negative integer. ### 8.6. `other` **Description:** -The count of tests whose status is `other`. +The count of test cases whose status is `other`. **Requirements:** `other` MUST be present. @@ -809,12 +811,12 @@ It MUST be a non-negative integer. ### 8.7. `flaky` **Description:** -The count of tests that were identified as flaky. +The count of test cases that were identified as flaky. **Requirements:** `flaky` is OPTIONAL. If present, it MUST be a non-negative integer. -A test is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. +A test case is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. ### 8.8. `suites` @@ -869,7 +871,7 @@ It is the ONLY permitted extension point directly under the `summary` object. ## 9. Test Object Each entry in the `tests` array represents a single executed test case. -A test object captures the identity, outcome, timing, diagnostics, and optional retry data for that test. +A test object captures the identity, outcome, timing, diagnostics, and optional retry data for an execution of that test case. Each element of the `tests` array MUST follow the structure defined in this section. @@ -894,9 +896,9 @@ Consumers SHOULD treat `id` as legacy unless a producer documents stronger seman ### 9.2. `testId` **Description:** -A stable identifier for the logical test case. +A stable identifier for the test case. -`testId` identifies the test case itself, independent of any particular run or execution. Producers SHOULD keep `testId` stable for the same logical test within their own documented scope. +`testId` identifies the test case itself, independent of any particular run or execution. Producers SHOULD keep `testId` stable for the same test case within their own documented scope. **Requirements:** `testId` is OPTIONAL. @@ -911,7 +913,7 @@ Consumers MUST NOT assume that `testId` values generated by different producers ### 9.3. `executionId` **Description:** -A unique identifier for the specific reported execution of a logical test case within a run. +A unique identifier for the specific reported execution of a test case within a run. An execution represents a single reported outcome for a test case in this document. An execution MAY include previous attempts represented in `retryAttempts`. @@ -964,7 +966,7 @@ It MUST be an integer representing milliseconds. ### 9.7. `start` **Description:** -The timestamp when test execution began. +The timestamp when execution of the test case began. **Requirements:** `start` is OPTIONAL. @@ -973,7 +975,7 @@ If present, it MUST be an integer representing milliseconds since the Unix epoch ### 9.8. `stop` **Description:** -The timestamp when test execution ended. +The timestamp when execution of the test case ended. **Requirements:** `stop` is OPTIONAL. @@ -983,12 +985,12 @@ If both `start` and `stop` are present, `stop` SHOULD be greater than or equal t ### 9.9. `suite` **Description:** -An ordered list of suite or grouping names to which this test belongs, ordered from the top-level suite to the immediate parent of the test. +An ordered list of suite or grouping names to which this test case belongs, ordered from the top-level suite to the immediate parent of the test case. **Requirements:** `suite` is OPTIONAL. If present, it MUST be an array of strings containing at least one entry. -The array MUST be ordered from the top-level suite to the immediate parent suite of the test. +The array MUST be ordered from the top-level suite to the immediate parent suite of the test case. ### 9.10. `message` @@ -1020,7 +1022,7 @@ If present, it MUST be a string. ### 9.13. `ai` **Description:** -AI-generated diagnostic data, commentary, or suggestions related to the test. +AI-generated diagnostic data, commentary, or suggestions related to the test result. **Requirements:** `ai` is OPTIONAL. @@ -1047,7 +1049,7 @@ If present, it MUST be a string. ### 9.16. `tags` **Description:** -A list of simple, keyless classifications associated with the test. +A list of simple, keyless classifications associated with the test case. **Requirements:** `tags` is OPTIONAL. @@ -1059,7 +1061,7 @@ Producers SHOULD use `tags` for simple, keyless categorization, such as `"smoke" ### 9.17. `labels` **Description:** -Structured key-value metadata associated with the test, such as ownership, priority, severity, external identifiers, or other named attributes. +Structured key-value metadata associated with the test case, such as ownership, priority, severity, external identifiers, or other named attributes. **Requirements:** `labels` is OPTIONAL. @@ -1072,7 +1074,7 @@ Producers SHOULD use `labels` whenever the metadata consists of named attributes ### 9.18. `type` **Description:** -A classification or category for the test (for example, `"unit"`, `"integration"`, or `"e2e"`). +A classification or category for the test case (for example, `"unit"`, `"integration"`, or `"e2e"`). **Requirements:** `type` is OPTIONAL. @@ -1118,9 +1120,9 @@ Each entry MUST follow the structure defined in Section 11 (Attempt History Entr ### 9.22. `flaky` **Description:** -Indicates whether the test is considered flaky. +Indicates whether the test case is considered flaky. -A test is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. +A test case is considered flaky only if its final status is `passed` and it experienced one or more failed attempts before passing. **Requirements:** `flaky` is OPTIONAL. @@ -1212,7 +1214,7 @@ It MAY contain arbitrary fields. ### 9.31. `steps` **Description:** -A list of test steps or sub-operations performed during the test. +A list of test steps or sub-operations performed during test execution. **Requirements:** `steps` is OPTIONAL. @@ -1650,7 +1652,7 @@ It is the ONLY permitted extension point directly under an attachment object. ## 13. Step Object The `steps` array within a test object provides a structured representation of the actions performed during the execution of a test case. -Steps may be used to document sub-actions, checkpoints, validations, or diagnostic events that occurred during the test. +Steps may be used to document sub-actions, checkpoints, validations, or diagnostic events that occurred during test execution. Each step object describes a single action. @@ -1725,7 +1727,7 @@ If present, it MUST be a valid metric delta object. ### 14.3. `flakyRate` **Description:** -A `metricDelta` object representing the rate of flaky tests across all analyzed runs. +A `metricDelta` object representing the rate of flaky test cases across all analyzed runs. **Requirements:** `flakyRate` is OPTIONAL. @@ -1752,7 +1754,7 @@ If present, it MUST follow the metric delta structure. ### 14.6. `averageTestDuration` **Description:** -A `metricDelta` object representing the average duration of individual tests across all runs. +A `metricDelta` object representing the average duration of test case executions across all runs. **Requirements:** `averageTestDuration` is OPTIONAL. @@ -2180,31 +2182,31 @@ to this specification. ], "properties": { "tests": { - "description": "Total number of tests executed", + "description": "Total number of test cases executed", "type": "integer" }, "passed": { - "description": "Count of tests with status 'passed'", + "description": "Count of test cases with status 'passed'", "type": "integer" }, "failed": { - "description": "Count of tests with status 'failed'", + "description": "Count of test cases with status 'failed'", "type": "integer" }, "skipped": { - "description": "Count of tests with status 'skipped'", + "description": "Count of test cases with status 'skipped'", "type": "integer" }, "pending": { - "description": "Count of tests with status 'pending'", + "description": "Count of test cases with status 'pending'", "type": "integer" }, "other": { - "description": "Count of tests with status 'other'", + "description": "Count of test cases with status 'other'", "type": "integer" }, "flaky": { - "description": "Count of flaky tests (passed after failed attempts)", + "description": "Count of flaky test cases (passed after failed attempts)", "type": "integer" }, "suites": { @@ -2231,7 +2233,7 @@ to this specification. "additionalProperties": false }, "tests": { - "description": "List of test cases executed during the run", + "description": "List of test case results for the run", "type": "array", "items": { "description": "Individual test case result", @@ -2245,7 +2247,7 @@ to this specification. "minLength": 1 }, "testId": { - "description": "Stable identifier for the logical test case. Should be derived from stable test attributes when generated by a producer", + "description": "Stable identifier for the test case. Should be derived from stable test attributes when generated by a producer", "type": "string", "minLength": 1 }, @@ -2269,19 +2271,19 @@ to this specification. "enum": [ "passed", "failed", "skipped", "pending", "other" ] }, "duration": { - "description": "Test execution time (milliseconds)", + "description": "Execution time of the test case (milliseconds)", "type": "integer" }, "start": { - "description": "Test start time (milliseconds since Unix epoch)", + "description": "Test case execution start time (milliseconds since Unix epoch)", "type": "integer" }, "stop": { - "description": "Test end time (milliseconds since Unix epoch)", + "description": "Test case execution end time (milliseconds since Unix epoch)", "type": "integer" }, "suite": { - "description": "Suite hierarchy from top-level to immediate parent", + "description": "Suite hierarchy for the test case, from top-level to immediate parent", "type": "array", "minItems": 1, "items": { @@ -2301,7 +2303,7 @@ to this specification. "type": "string" }, "ai": { - "description": "AI-generated diagnostic data or suggestions", + "description": "AI-generated diagnostic data or suggestions related to the test result", "type": "string" }, "line": { @@ -2354,15 +2356,15 @@ to this specification. } }, "type": { - "description": "Test classification (e.g., 'unit', 'integration', 'e2e')", + "description": "Test case classification (e.g., 'unit', 'integration', 'e2e')", "type": "string" }, "filePath": { - "description": "Path to the file defining this test", + "description": "Path to the file defining this test case", "type": "string" }, "retries": { - "description": "Number of times the test was re-executed after its initial attempt", + "description": "Number of times the test case was re-executed after its initial attempt", "type": "integer", "minimum": 0 }, @@ -2484,7 +2486,7 @@ to this specification. } }, "flaky": { - "description": "True if test passed after one or more failed attempts", + "description": "True if the test case passed after one or more failed attempts", "type": "boolean" }, "stdout": { @@ -2551,11 +2553,11 @@ to this specification. } }, "parameters": { - "description": "Test parameters or input values", + "description": "Test parameters, input values, or contextual data relevant to the execution", "type": "object" }, "steps": { - "description": "Test steps or sub-operations", + "description": "Steps or sub-operations performed during test execution", "type": "array", "items": { "description": "Individual test step", @@ -2585,7 +2587,7 @@ to this specification. } }, "insights": { - "description": "Derived metrics for this test across runs", + "description": "Derived metrics for this test case across runs", "type": "object", "properties": { "passRate": { @@ -2609,7 +2611,7 @@ to this specification. "$ref": "#/definitions/metricDelta" }, "executedInRuns": { - "description": "Number of runs this test was executed in", + "description": "Number of runs this test case was executed in", "type": "integer" }, "extra": { @@ -2739,7 +2741,7 @@ to this specification. "$ref": "#/definitions/metricDelta" }, "averageTestDuration": { - "description": "Average test duration with baseline comparison", + "description": "Average duration of test case executions with baseline comparison", "$ref": "#/definitions/metricDelta" }, "runsAnalyzed": { @@ -2845,7 +2847,7 @@ tests/auth/login.test.ts::auth > login::user can log in 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. +This approach ensures that the same test case retains the same `testId` across runs, enabling consumers to analyze historical trends, flakiness, and stability. When generating deterministic test identifiers, producers SHOULD: @@ -2872,34 +2874,34 @@ The selection of runs, time windows, and statistical methods used to compute met ### C.1. Run-Level Metrics -Run-level metrics are computed using all tests from all runs in consideration. +Run-level metrics are computed using all test case results from all runs in consideration. These metrics are typically generated by consumers that analyze multiple CTRF documents. #### C.1.1. `passRate` **Description:** -The proportion of tests that completed with status `passed` out of all tests executed across the analyzed runs. +The proportion of test cases that completed with status `passed` out of all test cases executed across the analyzed runs. **Type:** Percentage metric (0-1). #### C.1.2. `failRate` **Description:** -The proportion of tests that completed with status `failed` out of all tests executed across the analyzed runs. +The proportion of test cases that completed with status `failed` out of all test cases executed across the analyzed runs. **Type:** Percentage metric (0-1). #### C.1.3. `flakyRate` **Description:** -The proportion of tests that were flaky across the analyzed runs. +The proportion of test cases that were flaky across the analyzed runs. -A test is considered flaky only if: +A test case is considered flaky only if: - Its final recorded status is `passed`, and - It encountered one or more failed attempts before passing. -Retries that never pass (tests whose final status is `failed`) do not count toward flakiness. +Retries that never pass (test cases whose final status is `failed`) do not count toward flakiness. **Type:** Percentage metric (0-1). @@ -2927,49 +2929,49 @@ The average duration of all test executions across the analyzed runs. ### C.2. Test-Level Metrics Test-level metrics are computed using all executions of a single test case across analyzed runs. -These metrics characterize long-term stability and performance of individual tests. +These metrics characterize long-term stability and performance of individual test cases. #### C.2.1. `passRate` **Description:** -The proportion of runs in which this test ended with status `passed`. +The proportion of runs in which this test case ended with status `passed`. **Type:** Percentage metric (0-1). #### C.2.2. `failRate` **Description:** -The proportion of runs in which this test ended with status `failed`. +The proportion of runs in which this test case ended with status `failed`. **Type:** Percentage metric (0-1). #### C.2.3. `flakyRate` **Description:** -The proportion of runs in which this test was flaky. +The proportion of runs in which this test case was flaky. -A test is flaky if its final status was `passed` but it experienced one or more failed attempts. +A test case is flaky if its final status was `passed` but it experienced one or more failed attempts. **Type:** Percentage metric (0-1). #### C.2.4. `averageTestDuration` **Description:** -The average duration of all attempts of this specific test across analyzed runs. +The average duration of all attempts of this specific test case across analyzed runs. **Type:** Absolute metric (milliseconds). #### C.2.5. `p95TestDuration` **Description:** -The 95th percentile duration of all executions of this specific test. +The 95th percentile duration of all executions of this specific test case. **Type:** Absolute metric (milliseconds). #### C.2.6. `executedInRuns` **Description:** -The total number of runs in which this test appeared. +The total number of runs in which this test case appeared. **Type:** Absolute metric (integer). @@ -3049,15 +3051,15 @@ It includes: ### D.2. CTRF Document with Retries -This example demonstrates how CTRF represents previous attempts and flaky tests. +This example demonstrates how CTRF represents previous attempts and flaky test cases. It includes: - multiple test cases - previous attempts recorded in `retryAttempts` -- a test that fails initially and passes on retry -- a flaky test indicated by `flaky: true` -- a final test status of `passed` after retries +- a test case that fails initially and passes on retry +- a flaky test case indicated by `flaky: true` +- a final test case status of `passed` after retries ```json title="CTRF document with retries" { @@ -3107,7 +3109,7 @@ It includes: ### D.3. CTRF Document with Diagnostics -This example demonstrates how CTRF represents diagnostic information when a test fails. +This example demonstrates how CTRF represents diagnostic information when a test case fails. It includes: @@ -3274,7 +3276,7 @@ It includes: - tool metadata and versioning - summary statistics and timing data - multiple test cases -- retries and flaky test behavior +- retries and flaky test case behavior - diagnostic information (messages, traces, stdout, stderr) - base64-encoded screenshots - file-based attachments @@ -3475,8 +3477,8 @@ This example demonstrates how producers SHOULD use namespaced extension keys wit Two producers contribute extensions in this example: -- `myorg.ci` (the CI system) contributes extensions at the top level, `results`, `summary`, and per-test level — using the `myorg.ci` namespace key consistently throughout. -- `acme.test-management` (a test management integration) contributes extensions at the per-test level only — using the `acme.test-management` namespace key consistently. +- `myorg.ci` (the CI system) contributes extensions at the top level and within `results`, `summary`, and individual test objects — using the `myorg.ci` namespace key consistently throughout. +- `acme.test-management` (a test management integration) contributes extensions within individual test objects only — using the `acme.test-management` namespace key consistently. The `ctrf.` and `ctrf/` namespace prefixes are reserved for CTRF-defined extensions and MUST NOT be used by other producers.