summaryrefslogtreecommitdiff
path: root/test/tracetesting/checkout/place-order.yaml
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
committerSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
commit82e03978b89938219958032efb1448cc76baa181 (patch)
tree626f3e54d52ecd49be0ed3bee30abacc0453d081 /test/tracetesting/checkout/place-order.yaml
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'test/tracetesting/checkout/place-order.yaml')
-rw-r--r--test/tracetesting/checkout/place-order.yaml50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/tracetesting/checkout/place-order.yaml b/test/tracetesting/checkout/place-order.yaml
new file mode 100644
index 0000000..2b7eb29
--- /dev/null
+++ b/test/tracetesting/checkout/place-order.yaml
@@ -0,0 +1,50 @@
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+type: Test
+spec:
+ id: checkout-place-order
+ name: 'Checkout: place order'
+ description: Place one order on the system
+ trigger:
+ type: grpc
+ grpc:
+ protobufFile: ../../../pb/demo.proto
+ address: ${var:CHECKOUT_ADDR}
+ method: oteldemo.CheckoutService.PlaceOrder
+ request: |-
+ {
+ "userId": "1997",
+ "userCurrency": "USD",
+ "address": {
+ "streetAddress": "410 Terry Ave. North",
+ "city": "Seattle",
+ "state": "Washington",
+ "country": "United States",
+ "zipCode": "98109"
+ },
+ "email": "amazon@example.com",
+ "creditCard": {
+ "creditCardNumber": "4117-7059-6121-5486",
+ "creditCardCvv": 346,
+ "creditCardExpirationYear": 2025,
+ "creditCardExpirationMonth": 3
+ }
+ }
+ specs:
+ - name: It returns a valid order
+ selector: span[tracetest.span.type="general" name="Tracetest trigger"]
+ assertions:
+ - attr:tracetest.response.body | json_path '$.order.orderId' != ""
+ - attr:tracetest.response.body | json_path '$.order.shippingTrackingId' != ""
+ - attr:tracetest.response.body | json_path '$.order.shippingAddress' != "{}"
+ - attr:tracetest.response.body | json_path '$.order.shippingCost.currencyCode' = "USD"
+ - name: It calls the PlaceOrder method successfuly
+ selector: span[tracetest.span.type="rpc" name="oteldemo.CheckoutService/PlaceOrder"
+ rpc.system="grpc" rpc.method="PlaceOrder" rpc.service="oteldemo.CheckoutService"]
+ assertions:
+ - attr:rpc.grpc.status_code = 0
+ - name: It sends an order to be processed asyncronously
+ selector: span[tracetest.span.type="messaging" name="orders publish" kind="producer" messaging.system="kafka" messaging.destination.name="orders" messaging.operation="publish"]
+ assertions:
+ - attr:messaging.destination.name = "orders"