Skip to content

Commit c7b7495

Browse files
committed
fix: use manifest entity ID (diagnostic-bridge) in smoke test triggers
The runtime-discovered entity (diagnostic_bridge with underscore) may not exist in CI if the Docker image cache has an older gateway version. The manifest entity (diagnostic-bridge with hyphen) always exists. Trigger CRUD works on any entity - only SSE dispatch needs reporting_sources match.
1 parent f9b7a9d commit c7b7495

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/smoke_test.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ fi
116116

117117
section "Triggers"
118118

119-
# Create a trigger on diagnostic_bridge faults
119+
# Create a trigger on diagnostic-bridge faults
120120
echo " Creating OnChange fault trigger..."
121-
TRIGGER_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/apps/diagnostic_bridge/triggers" \
121+
TRIGGER_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${API_BASE}/apps/diagnostic-bridge/triggers" \
122122
-H "Content-Type: application/json" \
123-
-d '{"resource":"/api/v1/apps/diagnostic_bridge/faults","trigger_condition":{"condition_type":"OnChange"},"multishot":true,"lifetime":60}' 2>/dev/null) || true
123+
-d '{"resource":"/api/v1/apps/diagnostic-bridge/faults","trigger_condition":{"condition_type":"OnChange"},"multishot":true,"lifetime":60}' 2>/dev/null) || true
124124

125125
TRIGGER_HTTP=$(echo "$TRIGGER_RESPONSE" | tail -1)
126126
TRIGGER_BODY=$(echo "$TRIGGER_RESPONSE" | sed '$d')
127127

128128
if [ "$TRIGGER_HTTP" = "201" ]; then
129-
pass "POST /apps/diagnostic_bridge/triggers returns 201"
129+
pass "POST /apps/diagnostic-bridge/triggers returns 201"
130130
else
131-
fail "POST /apps/diagnostic_bridge/triggers returns 201" "got HTTP $TRIGGER_HTTP"
131+
fail "POST /apps/diagnostic-bridge/triggers returns 201" "got HTTP $TRIGGER_HTTP"
132132
fi
133133

134134
TRIGGER_ID=$(echo "$TRIGGER_BODY" | jq -r '.id')
@@ -146,35 +146,35 @@ else
146146
fi
147147

148148
# List triggers - verify it appears
149-
if api_get "/apps/diagnostic_bridge/triggers"; then
149+
if api_get "/apps/diagnostic-bridge/triggers"; then
150150
if echo "$RESPONSE" | jq -e --arg id "$TRIGGER_ID" '.items[] | select(.id == $id)' > /dev/null 2>&1; then
151-
pass "GET /apps/diagnostic_bridge/triggers lists created trigger"
151+
pass "GET /apps/diagnostic-bridge/triggers lists created trigger"
152152
else
153-
fail "GET /apps/diagnostic_bridge/triggers lists created trigger" "trigger $TRIGGER_ID not found"
153+
fail "GET /apps/diagnostic-bridge/triggers lists created trigger" "trigger $TRIGGER_ID not found"
154154
fi
155155
else
156-
fail "GET /apps/diagnostic_bridge/triggers returns 200" "unexpected status code"
156+
fail "GET /apps/diagnostic-bridge/triggers returns 200" "unexpected status code"
157157
fi
158158

159159
# Delete trigger
160160
TRIGGER_DELETE_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
161-
"${API_BASE}/apps/diagnostic_bridge/triggers/${TRIGGER_ID}" 2>/dev/null) || true
161+
"${API_BASE}/apps/diagnostic-bridge/triggers/${TRIGGER_ID}" 2>/dev/null) || true
162162

163163
if [ "$TRIGGER_DELETE_STATUS" = "204" ]; then
164-
pass "DELETE /apps/diagnostic_bridge/triggers/$TRIGGER_ID returns 204"
164+
pass "DELETE /apps/diagnostic-bridge/triggers/$TRIGGER_ID returns 204"
165165
else
166-
fail "DELETE /apps/diagnostic_bridge/triggers/$TRIGGER_ID returns 204" "got HTTP $TRIGGER_DELETE_STATUS"
166+
fail "DELETE /apps/diagnostic-bridge/triggers/$TRIGGER_ID returns 204" "got HTTP $TRIGGER_DELETE_STATUS"
167167
fi
168168

169169
# Verify trigger is gone
170-
if api_get "/apps/diagnostic_bridge/triggers"; then
170+
if api_get "/apps/diagnostic-bridge/triggers"; then
171171
if ! echo "$RESPONSE" | jq -e --arg id "$TRIGGER_ID" '.items[] | select(.id == $id)' > /dev/null 2>&1; then
172172
pass "trigger no longer listed after deletion"
173173
else
174174
fail "trigger no longer listed after deletion" "still found in list"
175175
fi
176176
else
177-
fail "GET /apps/diagnostic_bridge/triggers returns 200 after delete" "unexpected status code"
177+
fail "GET /apps/diagnostic-bridge/triggers returns 200 after delete" "unexpected status code"
178178
fi
179179

180180
# --- Summary ---

0 commit comments

Comments
 (0)