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
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ By standardizing test results, reports can be validated, merged, compared, and a
Use `npx` to run the CLI without installing:

```bash
npx ctrf-cli@0.3.1 validate report.json
npx ctrf-cli@0.4.0 validate report.json
```

### Global Installation

Or install globally for repeated use:

```bash [npm]
npm install -g ctrf-cli@0.3.1
npm install -g ctrf-cli@0.4.0
```

After global installation, use the `ctrf` command:
Expand All @@ -47,7 +47,7 @@ ctrf validate report.json
|---------|---------|
| `merge` | Merge multiple CTRF reports into a single report |
| `validate` | Validate a CTRF report against the JSON schema |
| `validate-strict` | Strict validation with additionalProperties enforcement |
| `validate-strict` | Validate a report and throw on validation failure |
| `filter` | Filter tests from a CTRF report based on criteria |
| `generate-test-ids` | Generate deterministic UUIDs for all tests |
| `generate-report-id` | Generate a unique UUID v4 identifier for report |
Expand Down Expand Up @@ -92,24 +92,26 @@ Validates CTRF report conformance to the JSON Schema specification. **Outputs to
**Syntax:**

```sh
ctrf validate <file-path>
ctrf validate-strict <file-path>
ctrf validate <file-path> [--spec-version <version>]
ctrf validate-strict <file-path> [--spec-version <version>]
```

**Parameters:**

- `file-path`: Path to CTRF report file (required)
- `--spec-version`: CTRF specification version to validate against. Supports `0.0.1`, `0.0.2`, `0.0.3`, `0.0.4`, `0.1.0`, and `latest` (default).

**Modes:**

- `validate`: Standard validation allowing additional properties
- `validate-strict`: Strict validation enforcing additionalProperties: false
- `validate-strict`: Uses the throwing validation API and prints detailed schema errors

**Example:**

```sh
ctrf validate report.json
ctrf validate-strict report.json
ctrf validate legacy-report.json --spec-version 0.0.2
```

## filter
Expand Down
9 changes: 1 addition & 8 deletions examples/comprehensive.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"specVersion": "0.1.0",
"reportId": "9d2c6a10-3f7a-4e22-9a8f-1a2b3c4d5e6f",
"timestamp": "2025-11-24T12:00:00Z",
"generatedBy": "example-ci",
Expand Down Expand Up @@ -88,13 +88,6 @@
"path": "/artifacts/retry-1.png"
}
]
},
{
"attempt": 2,
"status": "passed",
"duration": 5200,
"start": 1609459208700,
"stop": 1609459213900
}
],
"insights": {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"specVersion": "0.1.0",
"results": {
"tool": {
"name": "example-runner"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-diagnostics.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"specVersion": "0.1.0",
"results": {
"tool": {
"name": "example-runner",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-insights.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"specVersion": "0.1.0",
"reportId": "7c4e1c20-7c89-4f30-9b52-1f6f9d6b8f21",
"results": {
"tool": {
Expand Down
7 changes: 1 addition & 6 deletions examples/with-retries.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"reportFormat": "CTRF",
"specVersion": "1.0.0",
"specVersion": "0.1.0",
"results": {
"tool": {
"name": "example-runner",
Expand Down Expand Up @@ -41,11 +41,6 @@
"status": "failed",
"duration": 130,
"message": "Connection timeout"
},
{
"attempt": 3,
"status": "passed",
"duration": 140
}
]
}
Expand Down
Loading
Loading