-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathadd-item-to-cart.yaml
35 lines (34 loc) · 1.09 KB
/
add-item-to-cart.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
type: Test
spec:
id: cart-add-item-to-cart
name: 'Cart: add item to cart'
description: Add one item to the shopping cart
trigger:
type: grpc
grpc:
protobufFile: ../../../pb/demo.proto
address: ${var:CART_SERVICE_ADDR}
method: oteldemo.CartService.AddItem
request: |-
{
"userId": "1234",
"item": {
"productId": "OLJCESPC7Z",
"quantity": 1
}
}
specs:
- name: It added an item correctly into the shopping cart
selector: span[name="POST /oteldemo.CartService/AddItem"]
assertions:
- attr:grpc.status_code = 0
- name: It set the cart item correctly on the database
selector: span[tracetest.span.type="database" name="HMSET" db.system="redis" db.redis.database_index="0"]
assertions:
- attr:db.statement = "HMSET 1234"
- name: It returned an empty cart
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
assertions:
- "attr:tracetest.response.body = '{\n \n}'"