Skip to content

Commit

Permalink
Fixed yaml lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdias committed Jun 22, 2023
1 parent 5f31c6d commit d2d9d06
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,4 @@ services:
timeout: 5s
retries: 60
ports:
- 5432
- 5432
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
- name: "The product was persisted correctly on the shopping cart"
selector: span[name="oteldemo.CartService/AddItem"]
assertions:
- attr:app.product.id = "${env:PRODUCT_ID}"
- attr:app.product.id = "${env:PRODUCT_ID}"
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,25 @@ spec:
headers:
- key: Content-Type
value: application/json
body: '{"userId":"${env:USER_ID}","email":"someone@example.com","address":{"streetAddress":"1600 Amphitheatre Parkway","state":"CA","country":"United States","city":"Mountain View","zipCode":"94043"},"userCurrency":"USD","creditCard":{"creditCardCvv":672,"creditCardExpirationMonth":1,"creditCardExpirationYear":2030,"creditCardNumber":"4432-8015-6152-0454"}}'
body: |
{
"userId": "${env:USER_ID}",
"email": "someone@example.com",
"address": {
"streetAddress": "1600 Amphitheatre Parkway",
"state": "CA",
"country": "United States",
"city": "Mountain View",
"zipCode": "94043"
},
"userCurrency": "USD",
"creditCard": {
"creditCardCvv": 672,
"creditCardExpirationMonth": 1,
"creditCardExpirationYear": 2030,
"creditCardNumber": "4432-8015-6152-0454"
}
}
specs:
- selector: span[tracetest.span.type="rpc" name="oteldemo.CheckoutService/PlaceOrder" rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"]
name: "The order was placed"
Expand All @@ -32,4 +50,4 @@ spec:
name: "The cart was emptied"
assertions:
- attr:rpc.grpc.status_code = 0
- attr:tracetest.selected_spans.count >= 1
- attr:tracetest.selected_spans.count >= 1
2 changes: 1 addition & 1 deletion test/tracetesting/business-tests/user-purchase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ spec:
description: Simulate a process of a user purchasing products on Astronomy store
steps:
- ./user-purchase-test-steps/01-add-product-to-cart.yaml
- ./user-purchase-test-steps/02-checking-out-cart.yaml
- ./user-purchase-test-steps/02-checking-out-cart.yaml
10 changes: 7 additions & 3 deletions test/tracetesting/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ echo "Starting tests..."

EXIT_STATUS=0

# run business tests
run_tracetest_with_env ./business-tests/user-purchase.yaml ./business-tests/environment-vars.yaml || EXIT_STATUS=$?

# run tech based tests
echo ""
echo "Running tech based tests..."
run_tracetest ./tech-based-tests/ad-get.yaml || EXIT_STATUS=$?
run_tracetest ./tech-based-tests/currency-convert.yaml || EXIT_STATUS=$?
run_tracetest ./tech-based-tests/currency-supported.yaml || EXIT_STATUS=$?

# run business tests
echo ""
echo "Running business based tests..."
run_tracetest_with_env ./business-tests/user-purchase.yaml ./business-tests/environment-vars.env || EXIT_STATUS=$?

echo ""
echo "Tests done! Exit code: $EXIT_STATUS"

Expand Down
10 changes: 10 additions & 0 deletions test/tracetesting/tech-based-tests/ad-get.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,13 @@ spec:
{
"contextKeys": [ "galaxy", "telescope" ]
}
specs:
- name: It returns two ads
selector: span[tracetest.span.type="rpc" name="oteldemo.AdService/GetAds" rpc.system="grpc" rpc.method="GetAds" rpc.service="oteldemo.AdService"]
assertions:
- attr:app.ads.count = 2
- name: It returns a valid redirectUrl for each ads
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
assertions:
- attr:tracetest.response.body | json_path '$.ads[0].redirectUrl' contains "/product/"
- attr:tracetest.response.body | json_path '$.ads[1].redirectUrl' contains "/product/"
2 changes: 1 addition & 1 deletion test/tracetesting/tech-based-tests/currency-convert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,4 @@ spec:
- name: It has more nanos than expected
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
assertions:
- attr:tracetest.response.body| json_path '$.nanos' >= 599380800
- attr:tracetest.response.body| json_path '$.nanos' >= 599380800
4 changes: 2 additions & 2 deletions test/tracetesting/tracetest-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ telemetry:
exporters:
collector:
serviceName: tracetest
sampling: 100 # 100%
sampling: 100
exporter:
type: collector
collector:
endpoint: otelcol:4317

server:
telemetry:
exporter: collector
exporter: collector
2 changes: 1 addition & 1 deletion test/tracetesting/tracetest-provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ spec:
jaeger:
endpoint: jaeger:16685
tls:
insecure: true
insecure: true

0 comments on commit d2d9d06

Please sign in to comment.