From abd131a054901e64ecf1fea73fde060f1dbe0a0b Mon Sep 17 00:00:00 2001 From: Oscar Reyes Date: Tue, 15 Aug 2023 12:00:35 -0600 Subject: [PATCH] feat: Adding `var` template support (#3053) * feat: Adding template support * removing log * feat: Updating testing to use * moving environment data store to variable data store --- examples/table-driven-test/test.yaml | 4 +- .../tests/exam.yaml | 6 +-- .../tests/post-mortem.yaml | 10 ++-- examples/tracetest-k6/tests/test.yaml | 2 +- examples/tracetesting-kubernetes/setup-k3s.md | 2 +- examples/tracetesting-kubernetes/test.yaml | 2 +- server/executor/assertion_runner.go | 4 +- server/executor/runner.go | 2 +- server/expression/data_store.go | 23 ++------- server/expression/executor.go | 4 ++ server/expression/executor_test.go | 32 ++++++++++--- .../expression/linting/missing_variables.go | 4 ++ .../linting/missing_variables_test.go | 16 +++---- server/expression/parser_rules.go | 7 +++ server/expression/reflection_test.go | 25 ++++++++++ server/expression/tokens.go | 4 ++ server/http/controller.go | 4 +- server/model/events/events.go | 2 +- .../http-trigger-with-environment-file.yaml | 6 +-- .../grpc_test/01_create_grpc_test.yml | 4 +- .../features/grpc_test/02_list_grpc_test.yml | 4 +- .../features/grpc_test/03_run_grpc_test.yml | 6 +-- .../grpc_test/04_delete_grpc_test.yml | 2 +- ...create_grpc_test_with_invalid_metadata.yml | 4 +- ...06_run_grpc_test_with_invalid_metadata.yml | 6 +-- ..._delete_http_test_with_non_existing_id.yml | 2 +- ..._create_http_test_with_non_existing_id.yml | 8 ++-- .../03_create_http_test_with_existent_id.yml | 6 +-- .../04_delete_http_test_with_existing_id.yml | 2 +- .../http_test/05_create_http_test.yml | 6 +-- .../features/http_test/06_list_http_test.yml | 4 +- .../features/http_test/07_run_http_test.yml | 6 +-- .../features/http_test/08_rerun_http_test.yml | 2 +- .../http_test/09_delete_http_test_run.yml | 2 +- .../http_test/10_delete_http_test.yml | 2 +- .../features/testsuite/create_testsuite.yml | 6 +-- .../testsuite/create_testsuite_step.yml | 6 +-- .../features/testsuite/delete_testsuite.yml | 2 +- .../testsuite/delete_testsuite_step.yml | 2 +- .../features/testsuite/list_testsuite.yml | 4 +- .../testsuite/list_testsuite_as_resource.yml | 4 +- .../features/testsuite/update_testsuite.yml | 4 +- .../variableset/01_create_variableset.yml | 4 +- .../variableset/02_list_variableset.yml | 4 +- .../variableset/03_delete_variableset.yml | 2 +- .../Editor/Expression/grammar/grammar.js | 2 +- .../Editor/Expression/grammar/syntax.grammar | 2 +- .../Expression/hooks/useAutoComplete.ts | 4 +- .../Editor/Interpolation/grammar/grammar.js | 2 +- .../Interpolation/grammar/syntax.grammar | 2 +- .../Interpolation/hooks/useAutoComplete.ts | 4 +- .../Editor/Selector/grammar/grammar.terms.js | 27 ++++++----- web/src/services/Editor.service.ts | 47 +++++++++---------- 53 files changed, 201 insertions(+), 152 deletions(-) diff --git a/examples/table-driven-test/test.yaml b/examples/table-driven-test/test.yaml index d6553148d5..4a09e158b0 100644 --- a/examples/table-driven-test/test.yaml +++ b/examples/table-driven-test/test.yaml @@ -12,8 +12,8 @@ spec: - key: Content-Type value: application/json - key: X-Some-Header - value: ${env:someValue} - body: '{"id":${env:pokeid}}' + value: ${var:someValue} + body: '{"id":${var:pokeid}}' specs: - name: 'All Database Spans: Processing time is less than 100ms' diff --git a/examples/tracetest-aws-step-functions/tests/exam.yaml b/examples/tracetest-aws-step-functions/tests/exam.yaml index f5d099be6e..0841daafdd 100644 --- a/examples/tracetest-aws-step-functions/tests/exam.yaml +++ b/examples/tracetest-aws-step-functions/tests/exam.yaml @@ -12,9 +12,9 @@ spec: value: application/json body: |- { - "TaskToken": "${env:TASK_TOKEN}", - "ExamId": "${env:EXAM_ID}", - "IncidentId": "${env:INCIDENT_ID}", + "TaskToken": "${var:TASK_TOKEN}", + "ExamId": "${var:EXAM_ID}", + "IncidentId": "${var:INCIDENT_ID}", "Score": "80" } specs: diff --git a/examples/tracetest-grafana-tempo-pokeshop/tests/post-mortem.yaml b/examples/tracetest-grafana-tempo-pokeshop/tests/post-mortem.yaml index 2d5eac8f58..94c884cb46 100644 --- a/examples/tracetest-grafana-tempo-pokeshop/tests/post-mortem.yaml +++ b/examples/tracetest-grafana-tempo-pokeshop/tests/post-mortem.yaml @@ -5,9 +5,9 @@ spec: trigger: type: traceid traceid: - id: ${env:traceId} + id: ${var:traceId} specs: - - selector: span[tracetest.span.type="general" name="import pokemon"] - name: Validate there are no exceptions when importing pokemon. - assertions: - - attr:span.events not-contains "exception" + - selector: span[tracetest.span.type="general" name="import pokemon"] + name: Validate there are no exceptions when importing pokemon. + assertions: + - attr:span.events not-contains "exception" diff --git a/examples/tracetest-k6/tests/test.yaml b/examples/tracetest-k6/tests/test.yaml index f8a3895831..8d0f8c0be3 100644 --- a/examples/tracetest-k6/tests/test.yaml +++ b/examples/tracetest-k6/tests/test.yaml @@ -6,7 +6,7 @@ spec: trigger: type: traceid traceid: - id: ${env:TRACE_ID} + id: ${var:TRACE_ID} specs: - selector: span[tracetest.span.type="general" name="import pokemon"] assertions: diff --git a/examples/tracetesting-kubernetes/setup-k3s.md b/examples/tracetesting-kubernetes/setup-k3s.md index e0a479d480..6e137ab3cb 100644 --- a/examples/tracetesting-kubernetes/setup-k3s.md +++ b/examples/tracetesting-kubernetes/setup-k3s.md @@ -169,7 +169,7 @@ spec: trigger: type: traceid # MUST BE traceide traceid: - id: ${env:asd} # MUST BE in line 8 + id: ${var:asd} # MUST BE in line 8 # the rest of the file can be modified as needed specs: - name: List span exists diff --git a/examples/tracetesting-kubernetes/test.yaml b/examples/tracetesting-kubernetes/test.yaml index b05393dbfc..b0ed1944be 100644 --- a/examples/tracetesting-kubernetes/test.yaml +++ b/examples/tracetesting-kubernetes/test.yaml @@ -5,7 +5,7 @@ spec: trigger: type: traceid traceid: - id: ${env:asd} + id: ${var:asd} specs: - name: List span exists selector: span[tracetest.span.type="general" name="List"] diff --git a/server/executor/assertion_runner.go b/server/executor/assertion_runner.go index 257dd77691..616f908b4d 100644 --- a/server/executor/assertion_runner.go +++ b/server/executor/assertion_runner.go @@ -111,7 +111,7 @@ func (e *defaultAssertionRunner) executeAssertions(ctx context.Context, req Job) return test.Run{}, fmt.Errorf("trace not available") } - ds := []expression.DataStore{expression.EnvironmentDataStore{ + ds := []expression.DataStore{expression.VariableDataStore{ Values: req.Run.VariableSet.Values, }} @@ -123,7 +123,7 @@ func (e *defaultAssertionRunner) executeAssertions(ctx context.Context, req Job) newVariableSet := createVariableSet(req.Run.VariableSet, outputs) - ds = []expression.DataStore{expression.EnvironmentDataStore{Values: newVariableSet.Values}} + ds = []expression.DataStore{expression.VariableDataStore{Values: newVariableSet.Values}} assertionResult, allPassed := e.assertionExecutor.Assert(ctx, req.Test.Specs, *run.Trace, ds) diff --git a/server/executor/runner.go b/server/executor/runner.go index 60f5b1c0f8..114bc6048a 100644 --- a/server/executor/runner.go +++ b/server/executor/runner.go @@ -120,7 +120,7 @@ func (r persistentRunner) ProcessItem(ctx context.Context, job Job) { run.TraceID = traceID r.handleDBError(run, r.updater.Update(ctx, run)) - ds := []expression.DataStore{expression.EnvironmentDataStore{ + ds := []expression.DataStore{expression.VariableDataStore{ Values: run.VariableSet.Values, }} diff --git a/server/expression/data_store.go b/server/expression/data_store.go index 52d3d8ce4f..0555d9f6d6 100644 --- a/server/expression/data_store.go +++ b/server/expression/data_store.go @@ -69,35 +69,20 @@ func (ds MetaAttributesDataStore) count() string { return strconv.Itoa(len(ds.SelectedSpans)) } -type VariableDataStore map[string]string - -func (ds VariableDataStore) Source() string { - return "var" -} - -func (ds VariableDataStore) Get(name string) (string, error) { - value, found := ds[name] - if !found { - return "", fmt.Errorf(`variable "%s" is not set`, name) - } - - return value, nil -} - -type EnvironmentDataStore struct { +type VariableDataStore struct { Values []variableset.VariableSetValue } -func (ds EnvironmentDataStore) Source() string { +func (ds VariableDataStore) Source() string { return "env" } -func (ds EnvironmentDataStore) Get(name string) (string, error) { +func (ds VariableDataStore) Get(name string) (string, error) { for _, v := range ds.Values { if v.Key == name { return v.Value, nil } } - return "", fmt.Errorf(`environment variable "%s" not found`, name) + return "", fmt.Errorf(`variable "%s" not found`, name) } diff --git a/server/expression/executor.go b/server/expression/executor.go index 884eb540fd..3f3d0b40c7 100644 --- a/server/expression/executor.go +++ b/server/expression/executor.go @@ -166,6 +166,10 @@ func (e Executor) resolveTerm(term *Term) (value.Value, error) { return e.resolveEnvironment(term.Environment) } + if term.Variable != nil { + return e.resolveEnvironment((*Environment)(term.Variable)) + } + if term.FunctionCall != nil { return e.resolveFunctionCall(term.FunctionCall) } diff --git a/server/expression/executor_test.go b/server/expression/executor_test.go index eb230d43d0..b333d00f1b 100644 --- a/server/expression/executor_test.go +++ b/server/expression/executor_test.go @@ -21,7 +21,7 @@ type executorTestCase struct { AttributeDataStore expression.DataStore MetaAttributesDataStore expression.DataStore - EnvironmentDataStore expression.DataStore + VariableDataStore expression.DataStore } func TestBasicExpressionExecution(t *testing.T) { @@ -435,9 +435,19 @@ func TestFailureCases(t *testing.T) { Name: "should_report_missing_environment_variable", Query: `env:test = "abc"`, ShouldPass: false, - ExpectedErrorMessage: `resolution error: environment variable "test" not found`, + ExpectedErrorMessage: `resolution error: variable "test" not found`, - EnvironmentDataStore: expression.EnvironmentDataStore{ + VariableDataStore: expression.VariableDataStore{ + Values: []variableset.VariableSetValue{}, + }, + }, + { + Name: "should_report_missing_environment_variable", + Query: `var:host = "abc"`, + ShouldPass: false, + ExpectedErrorMessage: `resolution error: variable "host" not found`, + + VariableDataStore: expression.VariableDataStore{ Values: []variableset.VariableSetValue{}, }, }, @@ -466,9 +476,19 @@ func TestFailureCases(t *testing.T) { Name: "should_report_problem_resolving_array_item", Query: `["value", env:test, "anotherValue"] | get_index 0`, ShouldPass: false, - ExpectedErrorMessage: `resolution error: at index 1 of array: environment variable "test" not found`, + ExpectedErrorMessage: `resolution error: at index 1 of array: variable "test" not found`, + + VariableDataStore: expression.VariableDataStore{ + Values: []variableset.VariableSetValue{}, + }, + }, + { + Name: "should_report_problem_resolving_array_item", + Query: `["value", var:host, "anotherValue"] | get_index 0`, + ShouldPass: false, + ExpectedErrorMessage: `resolution error: at index 1 of array: variable "host" not found`, - EnvironmentDataStore: expression.EnvironmentDataStore{ + VariableDataStore: expression.VariableDataStore{ Values: []variableset.VariableSetValue{}, }, }, @@ -483,7 +503,7 @@ func executeResolveStatementTestCases(t *testing.T, testCases []executorTestCase executor := expression.NewExecutor( testCase.AttributeDataStore, testCase.MetaAttributesDataStore, - testCase.EnvironmentDataStore, + testCase.VariableDataStore, ) left, err := executor.ResolveStatement(testCase.Query) debugMessage := fmt.Sprintf("left value: %s", left) diff --git a/server/expression/linting/missing_variables.go b/server/expression/linting/missing_variables.go index 82165aeb86..657d17c96e 100644 --- a/server/expression/linting/missing_variables.go +++ b/server/expression/linting/missing_variables.go @@ -18,6 +18,10 @@ func DetectMissingVariables(target interface{}, availableVariables []string) []s if token.Type == expression.EnvironmentType { variables = append(variables, token.Identifier) } + + if token.Type == expression.VariableType { + variables = append(variables, token.Identifier) + } } missingVariables = append(missingVariables, getSetDifference(variables, availableVariables)...) diff --git a/server/expression/linting/missing_variables_test.go b/server/expression/linting/missing_variables_test.go index 76733a1329..7024275465 100644 --- a/server/expression/linting/missing_variables_test.go +++ b/server/expression/linting/missing_variables_test.go @@ -50,7 +50,7 @@ func TestMissingVariableDetection(t *testing.T) { name: "no_missing_variables_if_variable_exists", availableVariables: []string{"SERVER_URL", "PORT", "TOKEN"}, object: HTTPRequest{ - URL: `${env:SERVER_URL}:${PORT}`, + URL: `${env:SERVER_URL}:${var:PORT}`, Method: "GET", Auth: HTTPAuth{ Token: "abc", @@ -62,7 +62,7 @@ func TestMissingVariableDetection(t *testing.T) { name: "missing_variables_if_variable_doesnt_exists", availableVariables: []string{"SERVER_URL"}, object: HTTPRequest{ - URL: `${env:SERVER_URL}:${env:PORT}`, + URL: `${env:SERVER_URL}:${var:PORT}`, Method: "GET", Auth: HTTPAuth{ Token: "abc", @@ -86,7 +86,7 @@ func TestMissingVariableDetection(t *testing.T) { name: "missing_variables_in_inner_struct", availableVariables: []string{"SERVER_URL", "PORT"}, object: HTTPRequest{ - URL: `${env:SERVER_URL}:${env:PORT}`, + URL: `${env:SERVER_URL}:${var:PORT}`, Method: "GET", Auth: HTTPAuth{ Token: "${env:TOKEN}", @@ -104,8 +104,8 @@ func TestMissingVariableDetection(t *testing.T) { Token: "abc", }, Assertions: []Assertion{ - {Name: "test", Queries: []string{"env:ABC = env:ABC2"}}, - {Name: "test2", Queries: []string{"env:CDE = env:CDE"}}, + {Name: "test", Queries: []string{"env:ABC = var:ABC2"}}, + {Name: "test2", Queries: []string{"env:CDE = var:CDE"}}, }, }, expectedMissingVariables: []string{"ABC", "ABC2", "CDE"}, @@ -127,7 +127,7 @@ func TestMissingVariableDetection(t *testing.T) { }, Assertions: []Assertion{ {Name: "test", Queries: []string{"env:ABC = env:ABC2"}}, - {Name: "test2", Queries: []string{"env:CDE = env:CDE"}}, + {Name: "test2", Queries: []string{"env:CDE = var:CDE"}}, }, }, expectedMissingVariables: []string{"ABC", "ABC2", "CDE"}, @@ -139,11 +139,11 @@ func TestMissingVariableDetection(t *testing.T) { Trigger: trigger.Trigger{ Type: trigger.TriggerTypeHTTP, HTTP: &trigger.HTTPRequest{ - Body: `{"id": ${env:pokemonId}}`, + Body: `{"id": ${env:pokemonId},"name": "${var:pokemonName}"}`, }, }, }, - expectedMissingVariables: []string{"pokemonId"}, + expectedMissingVariables: []string{"pokemonId", "pokemonName"}, }, } diff --git a/server/expression/parser_rules.go b/server/expression/parser_rules.go index 924f86e0fc..0312a44134 100644 --- a/server/expression/parser_rules.go +++ b/server/expression/parser_rules.go @@ -28,6 +28,7 @@ type Term struct { Number *string `| @Number ` Attribute *Attribute `| @Attribute ` Environment *Environment `| @Environment ` + Variable *Variable `| @Variable ` Str *Str `| @(QuotedString|SingleQuotedString) )` } @@ -57,6 +58,7 @@ var languageLexer = lexer.MustStateful(lexer.Rules{ {Name: "Number", Pattern: `([0-9]+(\.[0-9]+)?)`}, {Name: "Attribute", Pattern: `attr:[a-zA-Z_0-9][a-zA-Z_0-9.-]*`, Action: nil}, {Name: "Environment", Pattern: `env:[a-zA-Z_0-9][a-zA-Z_0-9.]*`, Action: nil}, + {Name: "Variable", Pattern: `var:[a-zA-Z_0-9][a-zA-Z_0-9.]*`, Action: nil}, {Name: "QuotedString", Pattern: `"(\\"|[^"])*"`, Action: nil}, {Name: "SingleQuotedString", Pattern: `'(\\'|[^'])*'`, Action: nil}, @@ -73,6 +75,7 @@ const ( NumberType TermType = "Number" AttributeType TermType = "Attribute" EnvironmentType TermType = "Environment" + VariableType TermType = "Variable" StrType TermType = "Str" ) @@ -81,6 +84,10 @@ func (term *Term) Type() TermType { return AttributeType } + if term.Variable != nil { + return VariableType + } + if term.Environment != nil { return EnvironmentType } diff --git a/server/expression/reflection_test.go b/server/expression/reflection_test.go index 6fa4546c4f..c2c59b0df7 100644 --- a/server/expression/reflection_test.go +++ b/server/expression/reflection_test.go @@ -41,6 +41,13 @@ func TestGetTokens(t *testing.T) { {Type: expression.StrType}, }, }, + { + Statement: `var:url = "http://localhost"`, + ExpectedTokens: []expression.Token{ + {Identifier: "url", Type: expression.VariableType}, + {Type: expression.StrType}, + }, + }, { Statement: `"the server is ${env:url}" = "http://localhost"`, ExpectedTokens: []expression.Token{ @@ -49,6 +56,14 @@ func TestGetTokens(t *testing.T) { {Type: expression.StrType}, }, }, + { + Statement: `"the server is ${var:url}" = "http://localhost"`, + ExpectedTokens: []expression.Token{ + {Type: expression.StrType}, + {Identifier: "url", Type: expression.VariableType}, + {Type: expression.StrType}, + }, + }, { Statement: `"the url has ${env:url | count} characters" = "the url has 22 characters"`, ExpectedTokens: []expression.Token{ @@ -68,6 +83,16 @@ func TestGetTokens(t *testing.T) { {Type: expression.StrType}, }, }, + { + Statement: `"test ${var:names | get_index var:name_index}" = "John Doe"`, + ExpectedTokens: []expression.Token{ + {Type: expression.StrType}, + {Identifier: "names", Type: expression.VariableType}, + {Identifier: "get_index", Type: expression.FunctionCallType}, + {Identifier: "name_index", Type: expression.VariableType}, + {Type: expression.StrType}, + }, + }, } for _, testCase := range testCases { diff --git a/server/expression/tokens.go b/server/expression/tokens.go index 9d9f810a85..2fd8eca156 100644 --- a/server/expression/tokens.go +++ b/server/expression/tokens.go @@ -81,6 +81,10 @@ func extractIdentifierFromTerm(term *Term) string { return term.Environment.name } + if term.Type() == VariableType { + return term.Variable.name + } + // all other types don't have names, so return an empty string return "" } diff --git a/server/http/controller.go b/server/http/controller.go index 52d263c926..1909fe224e 100644 --- a/server/http/controller.go +++ b/server/http/controller.go @@ -283,7 +283,7 @@ func (c *controller) DryRunAssertion(ctx context.Context, testID string, runID i definition := c.mappers.In.Definition(def.Specs) - ds := []expression.DataStore{expression.EnvironmentDataStore{ + ds := []expression.DataStore{expression.VariableDataStore{ Values: run.VariableSet.Values, }} @@ -438,7 +438,7 @@ func (c *controller) buildDataStores(ctx context.Context, info openapi.ResolveRe return [][]expression.DataStore{}, err } - ds = append([]expression.DataStore{expression.EnvironmentDataStore{ + ds = append([]expression.DataStore{expression.VariableDataStore{ Values: environment.Values, }}, ds...) } diff --git a/server/model/events/events.go b/server/model/events/events.go index cda60a4a1a..fd20a7885b 100644 --- a/server/model/events/events.go +++ b/server/model/events/events.go @@ -60,7 +60,7 @@ func TriggerResolveStart(testID id.ID, runID int) model.TestRunEvent { Stage: model.StageTrigger, Type: "RESOLVE_START", Title: "Resolving trigger details started", - Description: "The resolution of trigger details based on environment variables has started", + Description: "The resolution of trigger details based on variables has started", CreatedAt: time.Now(), DataStoreConnection: model.ConnectionResult{}, Polling: model.PollingInfo{}, diff --git a/testing/cli-e2etest/testscenarios/test/resources/http-trigger-with-environment-file.yaml b/testing/cli-e2etest/testscenarios/test/resources/http-trigger-with-environment-file.yaml index 52f6c5011e..7159c56f19 100644 --- a/testing/cli-e2etest/testscenarios/test/resources/http-trigger-with-environment-file.yaml +++ b/testing/cli-e2etest/testscenarios/test/resources/http-trigger-with-environment-file.yaml @@ -11,7 +11,7 @@ spec: headers: - key: Content-Type value: application/json - body: '{"name":"${env:POKEMON_NAME}","type":"normal","imageUrl":"${env:POKEMON_URL}","isFeatured":true}' + body: '{"name":"${var:POKEMON_NAME}","type":"normal","imageUrl":"${var:POKEMON_URL}","isFeatured":true}' specs: - name: It should add a Pokemon correctly selector: span[tracetest.span.type="http" name="POST /pokemon" http.method="POST"] @@ -22,5 +22,5 @@ spec: span[tracetest.span.type="database" name="create postgres.pokemon" db.system="postgres" db.name="postgres" db.user="postgres" db.operation="create" db.sql.table="pokemon"] assertions: - - attr:db.result contains '"imageUrl":"${env:POKEMON_URL}"' - - attr:db.result contains '"name":"${env:POKEMON_NAME}"' + - attr:db.result contains '"imageUrl":"${var:POKEMON_URL}"' + - attr:db.result contains '"name":"${var:POKEMON_NAME}"' diff --git a/testing/server-tracetesting/features/grpc_test/01_create_grpc_test.yml b/testing/server-tracetesting/features/grpc_test/01_create_grpc_test.yml index d384310761..d97b2fb5b4 100644 --- a/testing/server-tracetesting/features/grpc_test/01_create_grpc_test.yml +++ b/testing/server-tracetesting/features/grpc_test/01_create_grpc_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: POST headers: - key: Content-Type @@ -20,7 +20,7 @@ spec: "type": "grpc", "grpc": { "protobufFile": "syntax = \"proto3\";\n\noption java_multiple_files = true;\noption java_outer_classname = \"PokeshopProto\";\noption objc_class_prefix = \"PKS\";\n\npackage pokeshop;\n\nservice Pokeshop {\n rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {}\n rpc createPokemon (Pokemon) returns (Pokemon) {}\n rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {}\n}\n\nmessage ImportPokemonRequest {\n int32 id = 1;\n optional bool isFixed = 2;\n}\n\nmessage GetPokemonRequest {\n optional int32 skip = 1;\n optional int32 take = 2;\n optional bool isFixed = 3;\n}\n\nmessage GetPokemonListResponse {\n repeated Pokemon items = 1;\n int32 totalCount = 2;\n}\n\nmessage Pokemon {\n optional int32 id = 1;\n string name = 2;\n string type = 3;\n bool isFeatured = 4;\n optional string imageUrl = 5;\n}", - "address": "${env:DEMO_APP_GRPC_URL}", + "address": "${var:DEMO_APP_GRPC_URL}", "method": "pokeshop.Pokeshop.importPokemon", "request": "{\"id\": 52}" } diff --git a/testing/server-tracetesting/features/grpc_test/02_list_grpc_test.yml b/testing/server-tracetesting/features/grpc_test/02_list_grpc_test.yml index 555b93f4ff..6b05090c09 100644 --- a/testing/server-tracetesting/features/grpc_test/02_list_grpc_test.yml +++ b/testing/server-tracetesting/features/grpc_test/02_list_grpc_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: GET headers: - key: Content-Type @@ -16,7 +16,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 200 - - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains env:GRPC_TEST_ID # check if the test is listed + - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains var:GRPC_TEST_ID # check if the test is listed - selector: span[name="GET /api/tests" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/grpc_test/03_run_grpc_test.yml b/testing/server-tracetesting/features/grpc_test/03_run_grpc_test.yml index a2080fefda..5ec94b81db 100644 --- a/testing/server-tracetesting/features/grpc_test/03_run_grpc_test.yml +++ b/testing/server-tracetesting/features/grpc_test/03_run_grpc_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:GRPC_TEST_ID}/run + url: ${var:TARGET_URL}/api/tests/${var:GRPC_TEST_ID}/run method: POST headers: - key: Content-Type @@ -23,14 +23,14 @@ spec: - selector: span[name = "Trigger test"] assertions: - attr:tracetest.selected_spans.count = 1 - - attr:tracetest.run.trigger.test_id = "${env:GRPC_TEST_ID}" + - attr:tracetest.run.trigger.test_id = "${var:GRPC_TEST_ID}" - attr:tracetest.run.trigger.type = "grpc" - attr:tracetest.run.trigger.grpc.response_status_code = 0 - attr:tracetest.run.trigger.grpc.response_status = "OK" - selector: span[name = "Fetch trace"] assertions: - attr:tracetest.selected_spans.count > 0 - - attr:tracetest.run.trace_poller.test_id = "${env:GRPC_TEST_ID}" + - attr:tracetest.run.trace_poller.test_id = "${var:GRPC_TEST_ID}" - selector: span[name = "Fetch trace"]:last assertions: - attr:tracetest.run.trace_poller.succesful = "true" diff --git a/testing/server-tracetesting/features/grpc_test/04_delete_grpc_test.yml b/testing/server-tracetesting/features/grpc_test/04_delete_grpc_test.yml index db1bb12e86..ffc99a03b9 100644 --- a/testing/server-tracetesting/features/grpc_test/04_delete_grpc_test.yml +++ b/testing/server-tracetesting/features/grpc_test/04_delete_grpc_test.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:GRPC_TEST_ID} + url: ${var:TARGET_URL}/api/tests/${var:GRPC_TEST_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/grpc_test/05_create_grpc_test_with_invalid_metadata.yml b/testing/server-tracetesting/features/grpc_test/05_create_grpc_test_with_invalid_metadata.yml index 9a70c6201a..f2fb4c249f 100644 --- a/testing/server-tracetesting/features/grpc_test/05_create_grpc_test_with_invalid_metadata.yml +++ b/testing/server-tracetesting/features/grpc_test/05_create_grpc_test_with_invalid_metadata.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: POST headers: - key: Content-Type @@ -20,7 +20,7 @@ spec: "type": "grpc", "grpc": { "protobufFile": "syntax = \"proto3\";\n\noption java_multiple_files = true;\noption java_outer_classname = \"PokeshopProto\";\noption objc_class_prefix = \"PKS\";\n\npackage pokeshop;\n\nservice Pokeshop {\n rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {}\n rpc createPokemon (Pokemon) returns (Pokemon) {}\n rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {}\n}\n\nmessage ImportPokemonRequest {\n int32 id = 1;\n optional bool isFixed = 2;\n}\n\nmessage GetPokemonRequest {\n optional int32 skip = 1;\n optional int32 take = 2;\n optional bool isFixed = 3;\n}\n\nmessage GetPokemonListResponse {\n repeated Pokemon items = 1;\n int32 totalCount = 2;\n}\n\nmessage Pokemon {\n optional int32 id = 1;\n string name = 2;\n string type = 3;\n bool isFeatured = 4;\n optional string imageUrl = 5;\n}", - "address": "${env:DEMO_APP_GRPC_URL}", + "address": "${var:DEMO_APP_GRPC_URL}", "method": "pokeshop.Pokeshop.importPokemon", "request": "{\"id\": 52}", "metadata": [{}] diff --git a/testing/server-tracetesting/features/grpc_test/06_run_grpc_test_with_invalid_metadata.yml b/testing/server-tracetesting/features/grpc_test/06_run_grpc_test_with_invalid_metadata.yml index ca5c05dd60..a460ee3344 100644 --- a/testing/server-tracetesting/features/grpc_test/06_run_grpc_test_with_invalid_metadata.yml +++ b/testing/server-tracetesting/features/grpc_test/06_run_grpc_test_with_invalid_metadata.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:GRPC_TEST_INVALID_METADATA_ID}/run + url: ${var:TARGET_URL}/api/tests/${var:GRPC_TEST_INVALID_METADATA_ID}/run method: POST headers: - key: Content-Type @@ -23,14 +23,14 @@ spec: - selector: span[name = "Trigger test"] assertions: - attr:tracetest.selected_spans.count = 1 - - attr:tracetest.run.trigger.test_id = "${env:GRPC_TEST_INVALID_METADATA_ID}" + - attr:tracetest.run.trigger.test_id = "${var:GRPC_TEST_INVALID_METADATA_ID}" - attr:tracetest.run.trigger.type = "grpc" - attr:tracetest.run.trigger.grpc.response_status_code = 0 - attr:tracetest.run.trigger.grpc.response_status = "OK" - selector: span[name = "Fetch trace"] assertions: - attr:tracetest.selected_spans.count > 0 - - attr:tracetest.run.trace_poller.test_id = "${env:GRPC_TEST_INVALID_METADATA_ID}" + - attr:tracetest.run.trace_poller.test_id = "${var:GRPC_TEST_INVALID_METADATA_ID}" - selector: span[name = "Fetch trace"]:last assertions: - attr:tracetest.run.trace_poller.succesful = "true" diff --git a/testing/server-tracetesting/features/http_test/01_delete_http_test_with_non_existing_id.yml b/testing/server-tracetesting/features/http_test/01_delete_http_test_with_non_existing_id.yml index 65805d70bf..673c1360ad 100644 --- a/testing/server-tracetesting/features/http_test/01_delete_http_test_with_non_existing_id.yml +++ b/testing/server-tracetesting/features/http_test/01_delete_http_test_with_non_existing_id.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:EXAMPLE_TEST_ID} + url: ${var:TARGET_URL}/api/tests/${var:EXAMPLE_TEST_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/http_test/02_create_http_test_with_non_existing_id.yml b/testing/server-tracetesting/features/http_test/02_create_http_test_with_non_existing_id.yml index 2a8ab5a653..19cbda802d 100644 --- a/testing/server-tracetesting/features/http_test/02_create_http_test_with_non_existing_id.yml +++ b/testing/server-tracetesting/features/http_test/02_create_http_test_with_non_existing_id.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: POST headers: - key: Content-Type @@ -15,12 +15,12 @@ spec: { "type": "Test", "spec": { - "id": "${env:EXAMPLE_TEST_ID}", + "id": "${var:EXAMPLE_TEST_ID}", "name": "Pokemon - List - Get a Pokemon", "trigger": { "type": "http", "httpRequest": { - "url": "${env:DEMO_APP_URL}/pokemon?take=20&skip=0", + "url": "${var:DEMO_APP_URL}/pokemon?take=20&skip=0", "method": "GET", "body": "", "headers": [ @@ -38,7 +38,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 201 - - attr:tracetest.response.body | json_path '$.spec.id' = env:EXAMPLE_TEST_ID + - attr:tracetest.response.body | json_path '$.spec.id' = var:EXAMPLE_TEST_ID - selector: span[name="POST /api/tests" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/http_test/03_create_http_test_with_existent_id.yml b/testing/server-tracetesting/features/http_test/03_create_http_test_with_existent_id.yml index 9587fc9f4b..f3c47032b5 100644 --- a/testing/server-tracetesting/features/http_test/03_create_http_test_with_existent_id.yml +++ b/testing/server-tracetesting/features/http_test/03_create_http_test_with_existent_id.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: POST headers: - key: Content-Type @@ -15,12 +15,12 @@ spec: { "type": "Test", "spec": { - "id": "${env:EXAMPLE_TEST_ID}", + "id": "${var:EXAMPLE_TEST_ID}", "name": "Pokemon - List - Get a Pokemon", "trigger": { "type": "http", "httpRequest": { - "url": "${env:DEMO_APP_URL}/pokemon?take=20&skip=0", + "url": "${var:DEMO_APP_URL}/pokemon?take=20&skip=0", "method": "GET", "body": "", "headers": [ diff --git a/testing/server-tracetesting/features/http_test/04_delete_http_test_with_existing_id.yml b/testing/server-tracetesting/features/http_test/04_delete_http_test_with_existing_id.yml index 498404a53c..3b731b32ea 100644 --- a/testing/server-tracetesting/features/http_test/04_delete_http_test_with_existing_id.yml +++ b/testing/server-tracetesting/features/http_test/04_delete_http_test_with_existing_id.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:EXAMPLE_TEST_ID} + url: ${var:TARGET_URL}/api/tests/${var:EXAMPLE_TEST_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/http_test/05_create_http_test.yml b/testing/server-tracetesting/features/http_test/05_create_http_test.yml index 5d6bb6dfe5..8f064c2db9 100644 --- a/testing/server-tracetesting/features/http_test/05_create_http_test.yml +++ b/testing/server-tracetesting/features/http_test/05_create_http_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: POST headers: - key: Content-Type @@ -19,7 +19,7 @@ spec: "trigger": { "type": "http", "httpRequest": { - "url": "${env:DEMO_APP_URL}/pokemon?take=20&skip=0", + "url": "${var:DEMO_APP_URL}/pokemon?take=20&skip=0", "method": "GET", "headers": [ { @@ -49,7 +49,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 201 - - attr:tracetest.response.body | json_path '$.spec.id' = env:HTTP_TEST_ID + - attr:tracetest.response.body | json_path '$.spec.id' = var:HTTP_TEST_ID - selector: span[name="POST /api/tests" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/http_test/06_list_http_test.yml b/testing/server-tracetesting/features/http_test/06_list_http_test.yml index 84454e4cf7..9c821aae9d 100644 --- a/testing/server-tracetesting/features/http_test/06_list_http_test.yml +++ b/testing/server-tracetesting/features/http_test/06_list_http_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests + url: ${var:TARGET_URL}/api/tests method: GET headers: - key: Content-Type @@ -16,7 +16,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 200 - - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains env:HTTP_TEST_ID # check if the test is listed + - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains var:HTTP_TEST_ID # check if the test is listed - selector: span[name="GET /api/tests" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/http_test/07_run_http_test.yml b/testing/server-tracetesting/features/http_test/07_run_http_test.yml index d83e101533..4ecc98d175 100644 --- a/testing/server-tracetesting/features/http_test/07_run_http_test.yml +++ b/testing/server-tracetesting/features/http_test/07_run_http_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:HTTP_TEST_ID}/run + url: ${var:TARGET_URL}/api/tests/${var:HTTP_TEST_ID}/run method: POST headers: - key: Content-Type @@ -26,13 +26,13 @@ spec: - selector: span[name = "Trigger test"] assertions: - attr:tracetest.selected_spans.count = 1 - - attr:tracetest.run.trigger.test_id = "${env:HTTP_TEST_ID}" + - attr:tracetest.run.trigger.test_id = "${var:HTTP_TEST_ID}" - attr:tracetest.run.trigger.type = "http" - attr:tracetest.run.trigger.http.response_code = 200 - selector: span[name = "Fetch trace"] assertions: - attr:tracetest.selected_spans.count > 0 - - attr:tracetest.run.trace_poller.test_id = "${env:HTTP_TEST_ID}" + - attr:tracetest.run.trace_poller.test_id = "${var:HTTP_TEST_ID}" - selector: span[name = "Fetch trace"]:last assertions: - attr:tracetest.run.trace_poller.succesful = "true" diff --git a/testing/server-tracetesting/features/http_test/08_rerun_http_test.yml b/testing/server-tracetesting/features/http_test/08_rerun_http_test.yml index 6d682ac822..fe92690200 100644 --- a/testing/server-tracetesting/features/http_test/08_rerun_http_test.yml +++ b/testing/server-tracetesting/features/http_test/08_rerun_http_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:HTTP_TEST_ID}/run/${env:HTTP_TEST_RUN_ID}/rerun + url: ${var:TARGET_URL}/api/tests/${var:HTTP_TEST_ID}/run/${var:HTTP_TEST_RUN_ID}/rerun method: POST headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/http_test/09_delete_http_test_run.yml b/testing/server-tracetesting/features/http_test/09_delete_http_test_run.yml index f38524c17a..1377d2c0ec 100644 --- a/testing/server-tracetesting/features/http_test/09_delete_http_test_run.yml +++ b/testing/server-tracetesting/features/http_test/09_delete_http_test_run.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:HTTP_TEST_ID}/run/${env:HTTP_TEST_RUN_ID} + url: ${var:TARGET_URL}/api/tests/${var:HTTP_TEST_ID}/run/${var:HTTP_TEST_RUN_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/http_test/10_delete_http_test.yml b/testing/server-tracetesting/features/http_test/10_delete_http_test.yml index 82654c63b6..78cfc3c73b 100644 --- a/testing/server-tracetesting/features/http_test/10_delete_http_test.yml +++ b/testing/server-tracetesting/features/http_test/10_delete_http_test.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:HTTP_TEST_ID} + url: ${var:TARGET_URL}/api/tests/${var:HTTP_TEST_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/testsuite/create_testsuite.yml b/testing/server-tracetesting/features/testsuite/create_testsuite.yml index da1da6dcea..e469b2c9ae 100644 --- a/testing/server-tracetesting/features/testsuite/create_testsuite.yml +++ b/testing/server-tracetesting/features/testsuite/create_testsuite.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/testsuites + url: ${var:TARGET_URL}/api/testsuites method: POST headers: - key: Content-Type @@ -18,7 +18,7 @@ spec: "spec": { "name": "test-testsuite", "description": "a testsuite", - "steps": [ "${env:TRANSACTION_STEP_ID}" ] + "steps": [ "${var:TRANSACTION_STEP_ID}" ] } } specs: @@ -26,7 +26,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 201 - - attr:tracetest.response.body | json_path '$.spec.id' = env:TRANSACTION_ID + - attr:tracetest.response.body | json_path '$.spec.id' = var:TRANSACTION_ID - selector: span[name="POST /api/testsuites" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/testsuite/create_testsuite_step.yml b/testing/server-tracetesting/features/testsuite/create_testsuite_step.yml index 6a1f551d99..919d7fe191 100644 --- a/testing/server-tracetesting/features/testsuite/create_testsuite_step.yml +++ b/testing/server-tracetesting/features/testsuite/create_testsuite_step.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: "${env:TARGET_URL}/api/tests" + url: "${var:TARGET_URL}/api/tests" method: POST headers: - key: Content-Type @@ -19,7 +19,7 @@ spec: "trigger": { "type": "http", "httpRequest": { - "url": "${env:DEMO_APP_URL}/pokemon?take=20&skip=0", + "url": "${var:DEMO_APP_URL}/pokemon?take=20&skip=0", "method": "GET", "headers": [ { @@ -50,7 +50,7 @@ spec: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 201 # ensure we can reference outputs declared in the same test - - attr:tracetest.response.body | json_path '$.spec.id' = env:TRANSACTION_STEP_ID + - attr:tracetest.response.body | json_path '$.spec.id' = var:TRANSACTION_STEP_ID - selector: span[name="POST /api/tests" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/testsuite/delete_testsuite.yml b/testing/server-tracetesting/features/testsuite/delete_testsuite.yml index cf3f8e7c11..4b8b6a6d18 100644 --- a/testing/server-tracetesting/features/testsuite/delete_testsuite.yml +++ b/testing/server-tracetesting/features/testsuite/delete_testsuite.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/testsuites/${env:TRANSACTION_ID} + url: ${var:TARGET_URL}/api/testsuites/${var:TRANSACTION_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/testsuite/delete_testsuite_step.yml b/testing/server-tracetesting/features/testsuite/delete_testsuite_step.yml index b5a5f467e5..888603f45f 100644 --- a/testing/server-tracetesting/features/testsuite/delete_testsuite_step.yml +++ b/testing/server-tracetesting/features/testsuite/delete_testsuite_step.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/tests/${env:TRANSACTION_STEP_ID} + url: ${var:TARGET_URL}/api/tests/${var:TRANSACTION_STEP_ID} method: DELETE headers: - key: Content-Type diff --git a/testing/server-tracetesting/features/testsuite/list_testsuite.yml b/testing/server-tracetesting/features/testsuite/list_testsuite.yml index 933ae6f17b..e4463c159f 100644 --- a/testing/server-tracetesting/features/testsuite/list_testsuite.yml +++ b/testing/server-tracetesting/features/testsuite/list_testsuite.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/testsuites + url: ${var:TARGET_URL}/api/testsuites method: GET headers: - key: Content-Type @@ -17,7 +17,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 200 - - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains env:TRANSACTION_ID # check if the testsuite is listed + - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains var:TRANSACTION_ID # check if the testsuite is listed - selector: span[name="GET /api/testsuites" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/testsuite/list_testsuite_as_resource.yml b/testing/server-tracetesting/features/testsuite/list_testsuite_as_resource.yml index e4d6f8d7c3..39d657cd19 100644 --- a/testing/server-tracetesting/features/testsuite/list_testsuite_as_resource.yml +++ b/testing/server-tracetesting/features/testsuite/list_testsuite_as_resource.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/resources + url: ${var:TARGET_URL}/api/resources method: GET headers: - key: Content-Type @@ -17,7 +17,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 200 - - attr:tracetest.response.body | json_path '$[*].item.id' contains env:TRANSACTION_ID # check if the testsuite is listed + - attr:tracetest.response.body | json_path '$[*].item.id' contains var:TRANSACTION_ID # check if the testsuite is listed - selector: span[name="GET /api/resources" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/testsuite/update_testsuite.yml b/testing/server-tracetesting/features/testsuite/update_testsuite.yml index 667cb9485b..a559b466fe 100644 --- a/testing/server-tracetesting/features/testsuite/update_testsuite.yml +++ b/testing/server-tracetesting/features/testsuite/update_testsuite.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/testsuites/${env:TRANSACTION_ID} + url: ${var:TARGET_URL}/api/testsuites/${var:TRANSACTION_ID} method: PUT headers: - key: Content-Type @@ -18,7 +18,7 @@ spec: "spec": { "name": "test-testsuite-updated", "description": "a testsuite", - "steps": [ "${env:TRANSACTION_STEP_ID}" ] + "steps": [ "${var:TRANSACTION_STEP_ID}" ] } } specs: diff --git a/testing/server-tracetesting/features/variableset/01_create_variableset.yml b/testing/server-tracetesting/features/variableset/01_create_variableset.yml index ebba7fe77c..24a37f18a1 100644 --- a/testing/server-tracetesting/features/variableset/01_create_variableset.yml +++ b/testing/server-tracetesting/features/variableset/01_create_variableset.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/variablesets + url: ${var:TARGET_URL}/api/variablesets method: POST headers: - key: Content-Type @@ -35,7 +35,7 @@ spec: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 201 # ensure we can reference outputs declared in the same test - - attr:tracetest.response.body | json_path '$.spec.id' = env:VARIABLE_SET_ID + - attr:tracetest.response.body | json_path '$.spec.id' = var:VARIABLE_SET_ID - selector: span[name="POST /api/variablesets" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/variableset/02_list_variableset.yml b/testing/server-tracetesting/features/variableset/02_list_variableset.yml index f6fc6a061f..ba50c92817 100644 --- a/testing/server-tracetesting/features/variableset/02_list_variableset.yml +++ b/testing/server-tracetesting/features/variableset/02_list_variableset.yml @@ -6,7 +6,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/variablesets + url: ${var:TARGET_URL}/api/variablesets method: GET headers: - key: Content-Type @@ -16,7 +16,7 @@ spec: assertions: - attr:tracetest.selected_spans.count = 1 - attr:tracetest.response.status = 200 - - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains env:VARIABLE_SET_ID # check if the variable set is listed + - attr:tracetest.response.body | json_path '$.items[*].spec.id' contains var:VARIABLE_SET_ID # check if the variable set is listed - selector: span[name="GET /api/variablesets" tracetest.span.type="http"] assertions: - attr:tracetest.selected_spans.count = 1 diff --git a/testing/server-tracetesting/features/variableset/03_delete_variableset.yml b/testing/server-tracetesting/features/variableset/03_delete_variableset.yml index 8964d01c69..b7472f98c9 100644 --- a/testing/server-tracetesting/features/variableset/03_delete_variableset.yml +++ b/testing/server-tracetesting/features/variableset/03_delete_variableset.yml @@ -7,7 +7,7 @@ spec: trigger: type: http httpRequest: - url: ${env:TARGET_URL}/api/variablesets/${env:VARIABLE_SET_ID} + url: ${var:TARGET_URL}/api/variablesets/${var:VARIABLE_SET_ID} method: DELETE headers: - key: Content-Type diff --git a/web/src/components/Editor/Expression/grammar/grammar.js b/web/src/components/Editor/Expression/grammar/grammar.js index 91c1a9b853..430e7630aa 100644 --- a/web/src/components/Editor/Expression/grammar/grammar.js +++ b/web/src/components/Editor/Expression/grammar/grammar.js @@ -18,7 +18,7 @@ export const parser = LRParser.deserialize({ skippedNodes: [0], repeatNodeCount: 4, tokenData: - "!=b~R!_OX%QX^%f^p%Qpq%fqr'[rs(^st%Qtu(cuv(nvw%Qwx)Uxz%Qz{(n{|(n|}%Q}!O)l!O!P+V!P!Q(n!Q![.x![!^%Q!^!_l#i#o+V#o#p.T#p#q%Q#q#r.T#r~%Q_>ufUQYWbSOr%Qst%Qu}%Q}!O+V!O!P+V!P!Q%Q!Q![+V![!c%Q!c!}+V!}#O,n#O#P%Q#P#Q,n#Q#R%Q#R#S+V#S#T%Q#T#h+V#h#i@Z#i#o+V#o#p.T#p#q%Q#q#r.T#r~%Q_@dfUQYWbSOr%Qst%Qu}%Q}!O+V!O!P+V!P!Q%Q!Q![+V![!c%Q!c!}+V!}#O,n#O#P%Q#P#Q,n#Q#R%Q#R#S+V#S#T%Q#T#f+V#f#gAx#g#o+V#o#p.T#p#q%Q#q#r.T#r~%Q_BReUQYWbSOr%Qst%Qu}%Q}!O+V!O!P+V!P!Q%Q!Q![+V![!]Cd!]!c%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#q#r.Z#r~%W_!:ufUQYWbSOr%Wst%Wu}%W}!O+]!O!P+]!P!Q%W!Q![+]![!c%W!c!}+]!}#O,t#O#P%W#P#Q,t#Q#R%W#R#S+]#S#T%W#T#V+]#V#WDQ#W#o+]#o#p.Z#p#q%W#q#r.Z#r~%W_!dY_PYW}!O.Z!O!P.Z!Q![.Z!c!}.Z!}#O.Z#P#Q.Z#R#S.Z#T#o.Z#o#p.Z#q#r.Z", tokenizers: [0, 1, 2, 3], topRules: {Program: [0, 1]}, tokenPrec: 136, diff --git a/web/src/components/Editor/Expression/grammar/syntax.grammar b/web/src/components/Editor/Expression/grammar/syntax.grammar index 687bdadde3..40b39a9f9d 100644 --- a/web/src/components/Editor/Expression/grammar/syntax.grammar +++ b/web/src/components/Editor/Expression/grammar/syntax.grammar @@ -32,7 +32,7 @@ JsonPath {"json_path '$" Word "'"} OpenInterpolation { "${" } CloseInterpolation { "}" } Colon { ":" } - Source { ("env" | "attr") Colon } + Source { ("env" | "attr" | "var") Colon } @precedence { OpenInterpolation, String } @precedence { String, space } diff --git a/web/src/components/Editor/Expression/hooks/useAutoComplete.ts b/web/src/components/Editor/Expression/hooks/useAutoComplete.ts index 53bd197b22..521852c028 100644 --- a/web/src/components/Editor/Expression/hooks/useAutoComplete.ts +++ b/web/src/components/Editor/Expression/hooks/useAutoComplete.ts @@ -35,13 +35,13 @@ const useAutoComplete = ({testId, runId, onSelect = noop, autocompleteCustomValu return useCallback( async (context: CompletionContext) => { const attributeList = getAttributeList(); - const envEntryList = getSelectedVariableSetEntryList(); + const varEntryList = getSelectedVariableSetEntryList(); return EditorService.getAutocomplete({ type: SupportedEditors.Expression, context, attributeList, - envEntryList, + varEntryList, customValueList: autocompleteCustomValues, onSelect, }); diff --git a/web/src/components/Editor/Interpolation/grammar/grammar.js b/web/src/components/Editor/Interpolation/grammar/grammar.js index 0a3ac08fe2..2e60327096 100644 --- a/web/src/components/Editor/Interpolation/grammar/grammar.js +++ b/web/src/components/Editor/Interpol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P!Q$h!Q![+f![!c$h!c!}+f!}#R$h#R#S+f#S#T$h#T#f+f#f#gBb#g#o+f#o~$hVBi_YSbPOt$hu}$h}!O+f!O!P+f!P!Q$h!Q![+f![!c$h!c!}+f!}#R$h#R#S+f#S#T$h#T#i+f#i#j4e#j#o+f#o~$hVCo^YSbPOt$hu}$h}!O+f!O!P+f!P!Q$h!Q![+f![!c$h!c!}+f!}#R$h#R#S+f#S#T$h#T#UDk#U#o+f#o~$hVDr_YSbPOt$hu}$h}!O+f!O!P+f!P!Q$h!Q![+f![!c$h!c!}+f!}#R$h#R#S+f#S#T$h#T#f+f#f#g/t#g#o+f#o~$hRExQZQbPOt$hu~$hRFVQRQbPOt$hu~$h", tokenizers: [0, 1, 2], topRules: {Program: [0, 1]}, tokenPrec: 106, diff --git a/web/src/components/Editor/Interpolation/grammar/syntax.grammar b/web/src/components/Editor/Interpolation/grammar/syntax.grammar index 833a78ff5f..a7429d428a 100644 --- a/web/src/components/Editor/Interpolation/grammar/syntax.grammar +++ b/web/src/components/Editor/Interpolation/grammar/syntax.grammar @@ -28,7 +28,7 @@ JsonPath {"json_path '" Identifier "'"} String { "'" (!["\\] | "\\" _)* "'" } OpenInterpolation { "${" } CloseInterpolation { "}" } - Source { "env" Colon } + Source { ("env" | "var") Colon } Colon { ":" } space { @whitespace+ } diff --git a/web/src/components/Editor/Interpolation/hooks/useAutoComplete.ts b/web/src/components/Editor/Interpolation/hooks/useAutoComplete.ts index 780402a57b..4bb3c51f23 100644 --- a/web/src/components/Editor/Interpolation/hooks/useAutoComplete.ts +++ b/web/src/components/Editor/Interpolation/hooks/useAutoComplete.ts @@ -16,9 +16,9 @@ const useAutoComplete = () => { return useCallback( async (context: CompletionContext) => { - const envEntryList = getSelectedVariableSetEntryList(); + const varEntryList = getSelectedVariableSetEntryList(); - return EditorService.getAutocomplete({type: SupportedEditors.Interpolation, context, envEntryList}); + return EditorService.getAutocomplete({type: SupportedEditors.Interpolation, context, varEntryList}); }, [getSelectedVariableSetEntryList] ); diff --git a/web/src/components/Editor/Selector/grammar/grammar.terms.js b/web/src/components/Editor/Selector/grammar/grammar.terms.js index 3b0329d458..7f3abda0d3 100644 --- a/web/src/components/Editor/Selector/grammar/grammar.terms.js +++ b/web/src/components/Editor/Selector/grammar/grammar.terms.js @@ -1,14 +1,15 @@ // This file was generated by lezer-generator. You probably shouldn't edit it. -export const Program = 1; -export const SpanMatch = 2; -export const Span = 3; -export const BaseExpression = 4; -export const Identifier = 5; -export const Operator = 6; -export const ComparatorValue = 7; -export const Number = 8; -export const String = 9; -export const ClosingBracket = 10; -export const PseudoSelector = 11; -export const SpanOrMatch = 12; -export const Comma = 13; +export const + Program = 1, + SpanMatch = 2, + Span = 3, + BaseExpression = 4, + Identifier = 5, + Operator = 6, + ComparatorValue = 7, + Number = 8, + String = 9, + ClosingBracket = 10, + PseudoSelector = 11, + SpanOrMatch = 12, + Comma = 13 diff --git a/web/src/services/Editor.service.ts b/web/src/services/Editor.service.ts index ccc50e4ae6..eb6565f38f 100644 --- a/web/src/services/Editor.service.ts +++ b/web/src/services/Editor.service.ts @@ -30,12 +30,13 @@ interface IAutoCompleteProps { type: SupportedEditors.Interpolation | SupportedEditors.Expression; context: CompletionContext; attributeList?: TSpanFlatAttribute[]; - envEntryList?: IKeyValue[]; + varEntryList?: IKeyValue[]; customValueList?: string[]; onSelect?(option: Completion): void; } -const CUSTOM_SYNTAX_ERRORS_WHITE_LIST = [/Unexpected token \'\$\'/, /\${env:([\w-]+)}/]; +const CUSTOM_SYNTAX_ERRORS_WHITE_LIST = [/Unexpected token \'\$\'/, /\${env:([\w-]+)}/, /\${var:([\w-]+)}/]; +const varSource = ['env', 'var']; function getJsonErrorPosition(error: SyntaxError, doc: Text): number { let m; @@ -103,16 +104,15 @@ const EditorService = () => ({ return { from: node.to, - options: - sourceText === 'env' - ? variableList.map(({key}) => ({ - label: key, - type: 'variableName', - })) - : attributeList.map(({key}) => ({ - label: key, - type: 'variableName', - })), + options: varSource.includes(sourceText) + ? variableList.map(({key}) => ({ + label: key, + type: 'variableName', + })) + : attributeList.map(({key}) => ({ + label: key, + type: 'variableName', + })), }; } @@ -123,16 +123,15 @@ const EditorService = () => ({ return { to: node.to, from: node.from, - options: - sourceText === 'env' - ? variableList.map(({key}) => ({ - label: key, - type: 'variableName', - })) - : attributeList.map(({key}) => ({ - label: key, - type: 'variableName', - })), + options: varSource.includes(sourceText) + ? variableList.map(({key}) => ({ + label: key, + type: 'variableName', + })) + : attributeList.map(({key}) => ({ + label: key, + type: 'variableName', + })), }; } @@ -162,7 +161,7 @@ const EditorService = () => ({ type, context, attributeList = [], - envEntryList = [], + varEntryList = [], customValueList = [], onSelect = noop, }: IAutoCompleteProps): CompletionResult | null { @@ -176,7 +175,7 @@ const EditorService = () => ({ const operatorAutocomplete = this.getOperatorAutocomplete(node); if (operatorAutocomplete) return operatorAutocomplete; - return this.getSourceAutocomplete(type, node, state, envEntryList, attributeList, customValueList, onSelect); + return this.getSourceAutocomplete(type, node, state, varEntryList, attributeList, customValueList, onSelect); }, getIsQueryValid(