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

Standardize values and type of outcome #238

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion conformance/testcaserun_finished.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"source": "/event/source/123",
"type": "testCaseRun",
"content": {
"outcome": "pass",
"outcome": "success",
"environment": {
"id": "dev",
"source": "testkube-dev-123"
Expand Down
2 changes: 1 addition & 1 deletion conformance/testsuiterun_finished.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"source": "/event/source/123",
"type": "testSuiteRun",
"content": {
"outcome": "fail",
"outcome": "failure",
"severity": "critical",
"reason": "Host 123.34.23.32 not found",
"environment": {
Expand Down
16 changes: 8 additions & 8 deletions core.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ track the build and release progress on a particular software artifact.
| source | `URI-Reference` | See [source](spec.md#source-subject) | |
| type | `String` | See [type](spec.md#type-subject) | `pipelineRun` |
| pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` |
| outcome | `String` | outcome of a finished `pipelineRun` | `success`, `error` or `failure`|
| outcome | `String` | outcome of a finished `pipelineRun` | `success`, `failure`, `cancel`, or `error` |
| url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` |
| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`|
| errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`|

### `taskRun`

Expand All @@ -56,9 +56,9 @@ associated, in which case it is acceptable to generate only taskRun events.
| type | `String` | See [type](spec.md#type-subject) | `taskRun` |
| taskName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` |
| pipelineRun | `Object` ([`pipelineRun`](#pipelinerun)) | The `pipelineRun` that this `taskRun` belongs to. | `{"id": "namespace/pipelinerun-1234"}`|
| outcome | `String` | outcome of a finished `taskRun` | `success`, `error` or `failure`|
| outcome | `String` | outcome of a finished `taskRun` | `success`, `failure`, `cancel`, or `error` |
| url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` |
| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`|
| errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`|

## Events

Expand Down Expand Up @@ -111,8 +111,8 @@ A pipelineRun has finished, successfully or not.
| type | `String` | See [type](spec.md#type-subject) | `pipelineRun` | |
| pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | |
| url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` | |
| outcome | `String (enum)` | outcome of a finished `pipelineRun` | `success`, `error` or `failure`| |
| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`| |
| outcome | `String (enum)` | outcome of a finished `pipelineRun` | `success`, `failure`, `cancel`, or `error` | `success`, `failure`, `cancel`, `error` |
| errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`| |

### [`taskRun Started`](conformance/taskrun_started.json)

Expand Down Expand Up @@ -147,5 +147,5 @@ A taskRun has finished, successfully or not.
| taskName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | |
| pipelineRun | `Object` ([`pipelineRun`](#pipelinerun)) | The `pipelineRun` that this `taskRun` belongs to. | `{"id": "namespace/pipelinerun-1234"}`| |
| url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | |
| outcome | `String (enum)` | outcome of a finished `taskRun` | `success`, `error` or `failure`| |
| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| |
| outcome | `String (enum)` | outcome of a finished `taskRun` | `success`, `failure`, `cancel`, or `error` | `success`, `failure`, `cancel`, `error` |
| errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| |
30 changes: 7 additions & 23 deletions schemas/pipelinerunfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
},
"type": {
"type": "string",
"enum": [
"dev.cdevents.pipelinerun.finished.0.3.0-draft"
],
"enum": ["dev.cdevents.pipelinerun.finished.0.3.0-draft"],
"default": "dev.cdevents.pipelinerun.finished.0.3.0-draft"
},
"timestamp": {
Expand All @@ -43,13 +41,7 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"version",
"id",
"source",
"type",
"timestamp"
]
"required": ["version", "id", "source", "type", "timestamp"]
},
"subject": {
"properties": {
Expand All @@ -65,9 +57,7 @@
"type": {
"type": "string",
"minLength": 1,
"enum": [
"pipelineRun"
],
"enum": ["pipelineRun"],
"default": "pipelineRun"
},
"content": {
Expand All @@ -79,7 +69,8 @@
"type": "string"
},
"outcome": {
"type": "string"
"type": "string",
"enum": ["success", "failure", "cancel", "error"]
},
"errors": {
"type": "string"
Expand All @@ -91,11 +82,7 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"type",
"content"
]
"required": ["id", "type", "content"]
},
"customData": {
"oneOf": [
Expand All @@ -114,8 +101,5 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"context",
"subject"
]
"required": ["context", "subject"]
}
58 changes: 11 additions & 47 deletions schemas/testcaserunfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
},
"type": {
"type": "string",
"enum": [
"dev.cdevents.testcaserun.finished.0.3.0-draft"
],
"enum": ["dev.cdevents.testcaserun.finished.0.3.0-draft"],
"default": "dev.cdevents.testcaserun.finished.0.3.0-draft"
},
"timestamp": {
Expand All @@ -42,13 +40,7 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"version",
"id",
"source",
"type",
"timestamp"
]
"required": ["version", "id", "source", "type", "timestamp"]
},
"subject": {
"properties": {
Expand All @@ -62,30 +54,18 @@
"type": {
"type": "string",
"minLength": 1,
"enum": [
"testCaseRun"
],
"enum": ["testCaseRun"],
"default": "testCaseRun"
},
"content": {
"properties": {
"outcome": {
"type": "string",
"enum": [
"pass",
"fail",
"cancel",
"error"
]
"enum": ["success", "failure", "cancel", "error"]
},
"severity": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"critical"
]
"enum": ["low", "medium", "high", "critical"]
},
"reason": {
"type": "string"
Expand All @@ -104,9 +84,7 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"id"
]
"required": ["id"]
},
"testSuiteRun": {
"type": "object",
Expand All @@ -120,16 +98,12 @@
}
},
"additionalProperties": false,
"required": [
"id"
]
"required": ["id"]
},
"testCase": {
"type": "object",
"additionalProperties": false,
"required": [
"id"
],
"required": ["id"],
"properties": {
"id": {
"type": "string",
Expand Down Expand Up @@ -163,19 +137,12 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"outcome",
"environment"
]
"required": ["outcome", "environment"]
}
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"type",
"content"
]
"required": ["id", "type", "content"]
},
"customData": {
"oneOf": [
Expand All @@ -194,8 +161,5 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"context",
"subject"
]
"required": ["context", "subject"]
}
54 changes: 10 additions & 44 deletions schemas/testsuiterunfinished.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
},
"type": {
"type": "string",
"enum": [
"dev.cdevents.testsuiterun.finished.0.3.0-draft"
],
"enum": ["dev.cdevents.testsuiterun.finished.0.3.0-draft"],
"default": "dev.cdevents.testsuiterun.finished.0.3.0-draft"
},
"timestamp": {
Expand All @@ -42,13 +40,7 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"version",
"id",
"source",
"type",
"timestamp"
]
"required": ["version", "id", "source", "type", "timestamp"]
},
"subject": {
"properties": {
Expand All @@ -62,9 +54,7 @@
"type": {
"type": "string",
"minLength": 1,
"enum": [
"testSuiteRun"
],
"enum": ["testSuiteRun"],
"default": "testSuiteRun"
},
"content": {
Expand All @@ -83,16 +73,12 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"id"
]
"required": ["id"]
},
"testSuite": {
"type": "object",
"additionalProperties": false,
"required": [
"id"
],
"required": ["id"],
"properties": {
"id": {
"type": "string",
Expand All @@ -112,41 +98,24 @@
},
"outcome": {
"type": "string",
"enum": [
"pass",
"fail",
"cancel",
"error"
]
"enum": ["success", "failure", "cancel", "error"]
},
"severity": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"critical"
]
"enum": ["low", "medium", "high", "critical"]
},
"reason": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"outcome",
"environment"
]
"required": ["outcome", "environment"]
}
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"type",
"content"
]
"required": ["id", "type", "content"]
},
"customData": {
"oneOf": [
Expand All @@ -165,8 +134,5 @@
},
"additionalProperties": false,
"type": "object",
"required": [
"context",
"subject"
]
"required": ["context", "subject"]
}
4 changes: 2 additions & 2 deletions testing-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ This event represents a finished testCase execution. The event will contain the
| environment | `Object` [`environment`](continuous-deployment.md/#environment) | The environment in which this testCaseRun was running | `{"id": "1234"}`, `{"id": "dev", "source": "testkube-dev-123"}` | ✅ |
| testCase | `Object` [`testCase`](#testcase) | Definition of the testCase being executed | `{"id": "92834723894", "name": "Login Test", "type": "integration"}` | |
| testSuiteRun | `Object` [`testSuiteRun`](#testsuiterun) | A testSuiteRun to associate this testCaseRun with a containing testSuiteRun | `{"id":"Auth-TestSuite-execution-12334", "source": "staging/testkube"}` | |
| outcome | `String (enum)` | The outcome of the testSuite execution, one of `pass`, `fail`, `cancel`, `error` | `pass` | ✅ |
| outcome | `String (enum)` | The outcome of the testSuite execution, one of `success`, `failure`, `cancel`, or `error` | `success`, `failure`, `cancel`, `error` | ✅ |
| severity | `String (enum)` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical` |
| reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed assertion`, `Timed out` | |

Expand Down Expand Up @@ -188,7 +188,7 @@ This event represents a finished testSuite execution. The event will contain the
| id | `String` | Uniquely identifies the subject within the source. | `unit`, `e2e`, `security` | ✅ |
| source | `URI-Reference` | [source](spec.md#source--context-) from the context | | |
| environment | `Object` [`environment`](continuous-deployment.md/#environment) | The environment in which this testSuiteRun was running | `{"id": "1234"}`, `{"id": "dev", "source": "testkube-dev-123"}` | ✅ |
| outcome | `String (enum)` | The outcome of the testSuite execution, one of `pass`, `fail`, `cancel`, `error` | `fail` | ✅ |
| outcome | `String (enum)` | The outcome of the testSuite execution, one of `success`, `failure`, `cancel`, or `error` | `success`, `failure`, `cancel`, `error` | ✅ |
| severity | `String (enum)` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical`, `low`, `medium`, `high` |
| reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed testCase` | |
| testSuite | `Object` [`testSuite`](#testsuite) | Definition of the testSuite being executed | `{"id": "92834723894", "name": "Auth TestSuite"}` | |
Expand Down
Loading