Skip to content

Commit

Permalink
add endpoint spec to get events from a test run (#2255)
Browse files Browse the repository at this point in the history
* add endpoint spec to get events from a test run

* add generated code for CLI and web

* update polling info to be expandable

* add stop test run endpoint
  • Loading branch information
mathnogueira committed Mar 28, 2023
1 parent 7c0f292 commit 100915b
Show file tree
Hide file tree
Showing 16 changed files with 1,840 additions and 261 deletions.
51 changes: 51 additions & 0 deletions api/openapi.yaml
Expand Up @@ -825,7 +825,58 @@ paths:
application/yaml:
schema:
type: string
/test/{testId}/run/{runId}/stop:
post:
tags:
- api
parameters:
- in: path
name: testId
schema:
type: string
required: true
- in: path
name: runId
schema:
type: string
required: true
summary: "stops the execution of a test run"
description: "stops the execution of a test run"
operationId: stopTestRun
responses:
200:
description: successful operation
422:
description: could not stop execution, probably it's not running anymore

# Test events
/tests/{testId}/run/{runId}/events:
get:
tags:
- api
parameters:
- in: path
name: testId
schema:
type: string
required: true
- in: path
name: runId
schema:
type: string
required: true
summary: "get events from a test run"
description: "get events from a test run"
operationId: getTestRunEvents
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "./testEvents.yaml#/components/schemas/TestRunEvent"
# Environments
/environments:
get:
Expand Down
63 changes: 63 additions & 0 deletions api/testEvents.yaml
@@ -0,0 +1,63 @@
version: 3.0.0
components:
schemas:
TestRunEvent:
type: object
properties:
type:
type: string
stage:
type: string
enum:
- trigger
- trace
- test
description:
type: string
createdAt:
type: string
format: date-time
testId:
type: string
runId:
type: string
dataStoreConnection:
$ref: "./config.yaml#/components/schemas/ConnectionResult"
polling:
$ref: "#/components/schemas/PollingInfo"
outputs:
type: array
items:
$ref: "#/components/schemas/OutputInfo"

PollingInfo:
type: object
properties:
type:
type: string
enum:
- periodic
reasonNextIteration:
type: string
isComplete:
type: boolean
periodic:
type: object
properties:
numberSpans:
type: integer
numberIterations:
type: integer

OutputInfo:
type: object
properties:
logLevel:
type: string
enum:
- warning
- error
message:
type: string
outputName:
type: string

0 comments on commit 100915b

Please sign in to comment.