-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutions-block.yaml
More file actions
85 lines (78 loc) · 2.21 KB
/
executions-block.yaml
File metadata and controls
85 lines (78 loc) · 2.21 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Executions Block Example
# Demonstrates the new executions syntax for multiple probe runs
executions:
- name: "Production User A"
vars:
- ACCOUNT: "123456789"
- CLIENT_ID: "client-prod-a"
- REGION: "us-east-1"
- name: "Production User B"
vars:
- ACCOUNT: "987654321"
- CLIENT_ID: "client-prod-b"
- REGION: "eu-west-1"
- name: "Staging Environment"
vars:
- ACCOUNT: "555555555"
- CLIENT_ID: "${STAGING_CLIENT_ID}" # Get from environment variable
- REGION: "us-west-2"
probes:
# Probe 1: Health check with context-specific variables
- name: "Health Check"
type: rest
endpoint: "https://httpbin.org/headers"
headers:
X-Account: "${ACCOUNT}"
X-Client-ID: "${CLIENT_ID}"
X-Region: "${REGION}"
validation:
status: 200
body:
present:
- "headers.X-Account"
- "headers.X-Client-Id"
# Variable substitution in validation!
equals:
headers.X-Account: "${ACCOUNT}"
headers.X-Client-Id: "${CLIENT_ID}"
headers.X-Region: "${REGION}"
# Probe 2: POST with variables in body and validation
- name: "Create Resource"
type: rest
endpoint: "https://httpbin.org/post"
method: POST
headers:
Content-Type: "application/json"
body:
account_id: "${ACCOUNT}"
client_id: "${CLIENT_ID}"
region: "${REGION}"
validation:
status: 200
body:
equals:
json.account_id: "${ACCOUNT}"
json.client_id: "${CLIENT_ID}"
json.region: "${REGION}"
output:
REQUEST_ID: "url"
# Probe 3: Use captured variable
- name: "Verify Request"
type: rest
endpoint: "https://httpbin.org/get"
headers:
X-Account: "${ACCOUNT}"
validation:
status: 200
# Expected Behavior:
# - 3 executions run (one for each entry in executions block)
# - Each execution has isolated variables
# - Run 1: "Production User A" with ACCOUNT=123456789
# - Run 2: "Production User B" with ACCOUNT=987654321
# - Run 3: "Staging Environment" with CLIENT_ID from env var
#
# Output on failure shows execution name:
# Production User A
# --------------------
# Probe: Health Check
# ✗ ...