Skip to content

Commit

Permalink
feat: missing variable detection on test/transaction run (#1863)
Browse files Browse the repository at this point in the history
* feat: get types from expression

* wip: changes in the api

* create linter for missing variables

* remove old code

* tag test object with expr_enabled and stmt_enabled

* feat: missing variables in tests

* uncomment tests

* refactor traverse method to allow unexported struct fields

* implement transaction validations

* remove unused method

* remove old variable detection code

* don't ignore time fields

* rename ReflectionToken to Token

* feature(frontend): frontend changes

* reference test that is missing variable

* feature(frontend): support for new structure as part of the missing variables for the FE

Co-authored-by: Oscar Reyes <oscar-rreyes1@hotmail.com>
  • Loading branch information
mathnogueira and xoscar committed Jan 24, 2023
1 parent ee7e1e1 commit 9513265
Show file tree
Hide file tree
Showing 60 changed files with 1,464 additions and 1,881 deletions.
80 changes: 6 additions & 74 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,44 +355,6 @@ paths:
404:
description: transaction run not found

/transactions/{transactionId}/version/{version}/variables:
get:
tags:
- api
parameters:
- in: path
name: transactionId
schema:
type: string
required: true
- in: path
name: version
schema:
type: integer
required: true
- in: query
name: environmentId
schema:
type: string
- in: query
name: runId
schema:
type: integer
summary: "get transaction variables"
description: "get transaction variables"
operationId: getTransactionVariables
responses:
200:
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: "./variables.yaml#/components/schemas/TestVariables"
500:
description: "problem with getting the transaction variables"

/tests:
get:
tags:
Expand Down Expand Up @@ -551,6 +513,12 @@ paths:
application/json:
schema:
$ref: "./tests.yaml#/components/schemas/TestRun"
422:
description: some variables are missing
content:
application/json:
schema:
$ref: "./variables.yaml#/components/schemas/MissingVariablesError"
get:
tags:
- api
Expand Down Expand Up @@ -869,42 +837,6 @@ paths:
schema:
type: string

/tests/{testId}/version/{version}/variables:
get:
tags:
- api
parameters:
- in: path
name: testId
schema:
type: string
required: true
- in: path
name: version
schema:
type: integer
required: true
- in: query
name: environmentId
schema:
type: string
- in: query
name: runId
schema:
type: integer
summary: "get test variables"
description: "get test variables"
operationId: getTestVariables
responses:
200:
description: successful operation
content:
application/json:
schema:
$ref: "./variables.yaml#/components/schemas/TestVariables"
500:
description: "problem with getting the test variables"

# Environments
/environments:
get:
Expand Down
27 changes: 11 additions & 16 deletions api/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,24 @@ openapi: 3.0.0

components:
schemas:
Variables:
MissingVariablesError:
type: object
properties:
environment:
missingVariables:
type: array
items:
type: string
variables:
type: array
items:
type: string
missing:
type: array
items:
$ref: "#/components/schemas/MissingVariables"
TestVariables:
$ref: "#/components/schemas/MissingVariable"
MissingVariable:
type: object
properties:
test:
$ref: "./tests.yaml#/components/schemas/Test"
testId:
type: string
variables:
$ref: "#/components/schemas/Variables"
MissingVariables:
type: array
items:
$ref: "#/components/schemas/Variable"

Variable:
type: object
properties:
key:
Expand Down

0 comments on commit 9513265

Please sign in to comment.