diff --git a/examples/environment-automation/environment.yaml b/examples/environment-automation/environment.yaml new file mode 100644 index 0000000000..07b6acd44f --- /dev/null +++ b/examples/environment-automation/environment.yaml @@ -0,0 +1,8 @@ +type: Environment +spec: + id: ttenv_dd3bb7e26a187dc1 + name: my-demo-environment-4 + description: My environment description + resources: ./resources + agentConfiguration: + serverless: true diff --git a/examples/environment-automation/resources/datastore.yaml b/examples/environment-automation/resources/datastore.yaml new file mode 100644 index 0000000000..7650efd302 --- /dev/null +++ b/examples/environment-automation/resources/datastore.yaml @@ -0,0 +1,14 @@ +type: DataStore +spec: + id: current + name: jaeger + type: jaeger + default: true + createdAt: 2023-10-16T19:39:35.345567Z + jaeger: + endpoint: demo-pokeshop-jaeger-query.demo:16685 + headers: + "": "" + tls: + insecure: true + settings: {} diff --git a/examples/environment-automation/resources/emailinvite.yaml b/examples/environment-automation/resources/emailinvite.yaml new file mode 100644 index 0000000000..c2f1c22aa8 --- /dev/null +++ b/examples/environment-automation/resources/emailinvite.yaml @@ -0,0 +1,6 @@ +type: Invite +spec: + id: pqx2w0PSR + to: pedro10@kubeshop.io + role: engineers + status: pending diff --git a/examples/environment-automation/resources/envtoken.yaml b/examples/environment-automation/resources/envtoken.yaml new file mode 100644 index 0000000000..b9c99b2ba2 --- /dev/null +++ b/examples/environment-automation/resources/envtoken.yaml @@ -0,0 +1,7 @@ +type: EnvironmentToken +spec: + id: GI1su-PIg + name: my-engineers-token + role: engineers + isRevoked: false + diff --git a/examples/environment-automation/resources/google.yaml b/examples/environment-automation/resources/google.yaml new file mode 100644 index 0000000000..f6a18cd6da --- /dev/null +++ b/examples/environment-automation/resources/google.yaml @@ -0,0 +1,13 @@ +type: Test +spec: + id: google-test + name: Google + trigger: + type: http + httpRequest: + method: GET + url: google.com + headers: + - key: Content-Type + value: application/json + skipTraceCollection: true diff --git a/examples/environment-automation/resources/more-tests/facebook.yaml b/examples/environment-automation/resources/more-tests/facebook.yaml new file mode 100644 index 0000000000..fa52bb9779 --- /dev/null +++ b/examples/environment-automation/resources/more-tests/facebook.yaml @@ -0,0 +1,13 @@ +type: Test +spec: + id: facebook-test + name: Facebook + trigger: + type: http + httpRequest: + method: GET + url: facebook.com + headers: + - key: Content-Type + value: application/json + skipTraceCollection: true diff --git a/examples/environment-automation/resources/more-tests/twitter.yaml b/examples/environment-automation/resources/more-tests/twitter.yaml new file mode 100644 index 0000000000..3d708171e0 --- /dev/null +++ b/examples/environment-automation/resources/more-tests/twitter.yaml @@ -0,0 +1,13 @@ +type: Test +spec: + id: twitter-test + name: Twitter + trigger: + type: http + httpRequest: + method: GET + url: twitter.com + headers: + - key: Content-Type + value: application/json + skipTraceCollection: true diff --git a/examples/environment-automation/resources/pollingprofile.yaml b/examples/environment-automation/resources/pollingprofile.yaml new file mode 100644 index 0000000000..de496fed4f --- /dev/null +++ b/examples/environment-automation/resources/pollingprofile.yaml @@ -0,0 +1,10 @@ +type: PollingProfile +spec: + id: Mj4Xw2PSR + name: my-new-default-profile + default: true + strategy: periodic + periodic: + retryDelay: 2s + timeout: 30s + selectorMatchRetries: 5 diff --git a/examples/environment-automation/resources/runner.yaml b/examples/environment-automation/resources/runner.yaml new file mode 100644 index 0000000000..aecb788782 --- /dev/null +++ b/examples/environment-automation/resources/runner.yaml @@ -0,0 +1,6 @@ +type: TestRunner +spec: + id: current + name: default + requiredGates: + - test-specs diff --git a/examples/environment-automation/resources/suite.yaml b/examples/environment-automation/resources/suite.yaml new file mode 100644 index 0000000000..311ebb3cd9 --- /dev/null +++ b/examples/environment-automation/resources/suite.yaml @@ -0,0 +1,7 @@ +type: TestSuite +spec: + id: test-suite + name: test-suite + description: "" + steps: + - google-test diff --git a/examples/environment-automation/resources/tracetest.yaml b/examples/environment-automation/resources/tracetest.yaml new file mode 100644 index 0000000000..e5a208c68a --- /dev/null +++ b/examples/environment-automation/resources/tracetest.yaml @@ -0,0 +1,13 @@ +type: Test +spec: + id: tracetest-test + name: Tracetest + trigger: + type: http + httpRequest: + method: GET + url: tracetest.io + headers: + - key: Content-Type + value: application/json + skipTraceCollection: true diff --git a/examples/environment-automation/resources/tracetests/import-pokemons.yaml b/examples/environment-automation/resources/tracetests/import-pokemons.yaml new file mode 100644 index 0000000000..8e3b8c08e2 --- /dev/null +++ b/examples/environment-automation/resources/tracetests/import-pokemons.yaml @@ -0,0 +1,36 @@ +type: Test +spec: + id: pokeshop-demo-import-pokemon-queue + name: Import a Pokemon using API and MQ Worker + description: Import a Pokemon + trigger: + type: http + httpRequest: + method: POST + url: https://demo-pokeshop.stage.tracetest.io/pokemon/import + body: "{\n \"id\": 143\n}\n" + headers: + - key: Content-Type + value: application/json + specs: + - selector: span[tracetest.span.type="http" name="POST /pokemon/import" http.method="POST"] + name: POST /pokemon/import was called successfuly + assertions: + - attr:http.status_code = 200 + - attr:http.response.body | json_path '$.id' = "143" + - selector: span[tracetest.span.type="general" name="validate request"] + name: The request was validated correctly + assertions: + - attr:validation.is_valid = "true" + - selector: span[tracetest.span.type="messaging" name="queue.synchronizePokemon publish" messaging.system="rabbitmq" messaging.destination="queue.synchronizePokemon" messaging.operation="publish"] + name: A message was enqueued to the worker + assertions: + - attr:messaging.payload | json_path '$.id' = "143" + - selector: span[tracetest.span.type="messaging" name="queue.synchronizePokemon process" messaging.system="rabbitmq" messaging.destination="queue.synchronizePokemon" messaging.operation="process"] + name: A message was read by the worker + assertions: + - attr:messaging.payload | json_path '$.fields.routingKey' = "queue.synchronizePokemon" + - selector: span[tracetest.span.type="general" name="import pokemon"] + name: A "import pokemon" action was triggered + assertions: + - attr:tracetest.selected_spans.count >= 1 diff --git a/examples/environment-automation/resources/tracetests/list-pokemons.yaml b/examples/environment-automation/resources/tracetests/list-pokemons.yaml new file mode 100644 index 0000000000..d780eb79f4 --- /dev/null +++ b/examples/environment-automation/resources/tracetests/list-pokemons.yaml @@ -0,0 +1,26 @@ +type: Test +spec: + id: pokeshop-demo-list-pokemon + name: List Pokemons + description: List Pokemons registered on Pokeshop API + trigger: + type: http + httpRequest: + method: GET + url: https://demo-pokeshop.stage.tracetest.io/pokemon?take=100&skip=0 + headers: + - key: Content-Type + value: application/json + specs: + - selector: span[tracetest.span.type="http" name="GET /pokemon?take=100&skip=0" http.method="GET"] + name: GET /pokemon endpoint was called and returned valid data + assertions: + - attr:http.status_code = 200 + - selector: span[tracetest.span.type="database" name="count pokeshop.pokemon" db.system="postgres" db.name="pokeshop" db.user="ashketchum" db.operation="count" db.sql.table="pokemon"] + name: A count operation was triggered on database + assertions: + - attr:db.operation = "count" + - selector: span[tracetest.span.type="database" name="findMany pokeshop.pokemon" db.system="postgres" db.name="pokeshop" db.user="ashketchum" db.operation="findMany" db.sql.table="pokemon"] + name: A select operation was triggered on database + assertions: + - attr:db.operation = "findMany" diff --git a/examples/environment-automation/resources/tracetests/suite.yaml b/examples/environment-automation/resources/tracetests/suite.yaml new file mode 100644 index 0000000000..8e3cfb8e58 --- /dev/null +++ b/examples/environment-automation/resources/tracetests/suite.yaml @@ -0,0 +1,10 @@ +type: TestSuite +spec: + id: pokeshop-demo-test-suite + name: Pokeshop Synthetic tests + description: Simulate a user doing a series of imports on Pokeshop and listing its results + steps: + - pokeshop-demo-add-pokemon + - pokeshop-demo-import-pokemon-queue + - pokeshop-demo-import-pokemon-stream + - pokeshop-demo-list-pokemon