forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfirmation.yaml
62 lines (61 loc) · 1.81 KB
/
confirmation.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
type: Test
spec:
id: email-confirmation
name: 'Email: Confirmation'
description: Send an order confirmation email
trigger:
type: http
httpRequest:
url: ${var:EMAIL_ADDR}/send_order_confirmation
method: POST
headers:
- key: Content-Type
value: application/json
body: |
{
"email": "google@example.com",
"order": {
"order_id": "505",
"shipping_tracking_id": "dead-beef",
"shipping_cost": {
"currency_code": "USD",
"units": 17,
"nanos": 980000000
},
"shipping_address": {
"street_address_1": "1600 Amphitheatre Parkway",
"city": "Mountain View",
"state": "California",
"country": "United States",
"zip_code": "94043"
},
"items": [
{
"item": {
"product_id": "1YMWWN1N4O",
"quantity": 5
},
"cost": {
"currency_code": "USD",
"units": 100,
"nanos": 0
}
}
]
}
}
specs:
- name: It should be called successfully
selector: span[tracetest.span.type="http" name="POST /send_order_confirmation" http.method="POST"]
assertions:
- attr:http.status_code = 200
- name: It should render a email to send
selector: span[tracetest.span.type="general" name="sinatra.render_template"]
assertions:
- attr:name = "sinatra.render_template"
- name: It should send an email
selector: span[tracetest.span.type="general" name="send_email"]
assertions:
- attr:name = "send_email"