-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The YAML test runner (wftest.RunYAMLTests) only supports pipeline and HTTP trigger types. The Harness has FireSchedule() and FireEvent() methods, and the BDD framework wires both via I fire schedule and I fire event steps — but the YAML runner doesn't support them.
Current behavior
tests:
cleanup-job:
trigger:
type: schedule
name: cleanup-sessions
assertions:
- output:
status: completedFails with: RunYAMLTests: unsupported trigger type "schedule"
Expected behavior
Two new trigger types should be supported:
Schedule trigger
trigger:
type: schedule
name: cleanup-sessions # pipeline name
data: # optional params
param1: value1Maps to h.FireSchedule(name, data).
Event trigger
trigger:
type: event
name: forms.submission.created # topic
data:
affiliate_id: sampleaff1
form_id: form-uuid-1Maps to h.FireEvent(topic, data).
Impact
We have 6 scheduled job pipelines and 1 eventbus-triggered pipeline that cannot use the YAML test format. Currently using pipeline triggers as a workaround (same execution but doesn't exercise the schedule/event wiring).
Suggested implementation
Add cases to fireTrigger() in yaml_runner.go:
case "schedule":
name := tc.Trigger.Name
if name == "" {
t.Fatal("RunYAMLTests: trigger.name is required for schedule triggers")
}
return h.FireSchedule(name, tc.Trigger.Data)
case "event", "eventbus":
topic := tc.Trigger.Name
if topic == "" {
t.Fatal("RunYAMLTests: trigger.name (topic) is required for event triggers")
}
return h.FireEvent(topic, tc.Trigger.Data)References
Harness.FireSchedule():wftest/events.go:68Harness.FireEvent():wftest/events.go:20- BDD trigger steps:
wftest/bdd/steps_trigger.go(lines 13-14, 40-59)
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request