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

add endpoint spec to get events from a test run #2255

Merged
merged 4 commits into from
Mar 28, 2023
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
51 changes: 51 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +58 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include a info type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's worth unless we want to show in the event log what are the values for each output after they were resolved. @xoscar what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the info type is not something we'll be using in the near future so I think its fine to not have it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense @mathnogueira

message:
type: string
outputName:
type: string
Loading