-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(examples): environment provision example (#3867)
* chore(examples): environment provision example * feat(cli): enabling environment provisioning
- Loading branch information
Showing
14 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type: Environment | ||
spec: | ||
id: ttenv_dd3bb7e26a187dc1 | ||
name: my-demo-environment-4 | ||
description: My environment description | ||
resources: ./resources | ||
agentConfiguration: | ||
serverless: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: Invite | ||
spec: | ||
id: pqx2w0PSR | ||
to: [email protected] | ||
role: engineers | ||
status: pending |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type: EnvironmentToken | ||
spec: | ||
id: GI1su-PIg | ||
name: my-engineers-token | ||
role: engineers | ||
isRevoked: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
13 changes: 13 additions & 0 deletions
13
examples/environment-automation/resources/more-tests/facebook.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
13 changes: 13 additions & 0 deletions
13
examples/environment-automation/resources/more-tests/twitter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
10 changes: 10 additions & 0 deletions
10
examples/environment-automation/resources/pollingprofile.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: TestRunner | ||
spec: | ||
id: current | ||
name: default | ||
requiredGates: | ||
- test-specs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type: TestSuite | ||
spec: | ||
id: test-suite | ||
name: test-suite | ||
description: "" | ||
steps: | ||
- google-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
36 changes: 36 additions & 0 deletions
36
examples/environment-automation/resources/tracetests/import-pokemons.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
26 changes: 26 additions & 0 deletions
26
examples/environment-automation/resources/tracetests/list-pokemons.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
10 changes: 10 additions & 0 deletions
10
examples/environment-automation/resources/tracetests/suite.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |