Skip to content

wftest YAML runner: add schedule and event trigger types#369

Merged
intel352 merged 3 commits intomainfrom
copilot/add-schedule-and-event-trigger-types
Mar 24, 2026
Merged

wftest YAML runner: add schedule and event trigger types#369
intel352 merged 3 commits intomainfrom
copilot/add-schedule-and-event-trigger-types

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

RunYAMLTests only supported pipeline and HTTP trigger types, leaving schedule and event-driven pipelines untestable via the YAML format despite Harness.FireSchedule() and Harness.FireEvent() existing.

Changes

  • wftest/yaml_runner.go — added schedule and event/eventbus cases to fireTrigger():

    • scheduleh.FireSchedule(trigger.name, trigger.data)
    • event / eventbush.FireEvent(trigger.name, trigger.data) (name is the topic)
    • Both fatal if trigger.name is empty
  • wftest/yaml_runner_test.go — added tests for schedule trigger, schedule trigger with data params, event trigger (type: event), and eventbus alias (type: eventbus)

Usage

tests:
  cleanup-job:
    trigger:
      type: schedule
      name: cleanup-sessions
      data:
        param1: value1
    assertions:
      - output:
          status: completed

  submission-event:
    trigger:
      type: event
      name: forms.submission.created
      data:
        affiliate_id: sampleaff1
        form_id: form-uuid-1
    assertions:
      - output:
          handled: true
Original prompt

This section details on the original issue you should resolve

<issue_title>wftest YAML runner: missing schedule and event trigger types</issue_title>
<issue_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: completed

Fails 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: value1

Maps to h.FireSchedule(name, data).

Event trigger

trigger:
  type: event
  name: forms.submission.created   # topic
  data:
    affiliate_id: sampleaff1
    form_id: form-uuid-1

Maps 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:68
  • Harness.FireEvent(): wftest/events.go:20
  • BDD trigger steps: wftest/bdd/steps_trigger.go (lines 13-14, 40-59)</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Add support for schedule and event trigger types in YAML runner wftest YAML runner: add schedule and event trigger types Mar 24, 2026
Copilot AI requested a review from intel352 March 24, 2026 16:27
@intel352 intel352 marked this pull request as ready for review March 24, 2026 17:16
Copilot AI review requested due to automatic review settings March 24, 2026 17:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing trigger coverage to the wftest YAML test runner so YAML-defined tests can exercise scheduled and event-driven pipelines using existing harness capabilities.

Changes:

  • Extended fireTrigger() to support schedule triggers via Harness.FireSchedule(name, data).
  • Extended fireTrigger() to support event and eventbus triggers via Harness.FireEvent(topic, data).
  • Added YAML runner tests covering schedule triggers (with/without data) and event triggers (event and eventbus alias).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
wftest/yaml_runner.go Adds schedule and event/eventbus trigger dispatch in the YAML runner.
wftest/yaml_runner_test.go Adds integration-style YAML runner tests for the new trigger types and aliasing behavior.

@github-actions
Copy link

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:245: parsing iteration count: invalid syntax
baseline-bench.txt:322635: parsing iteration count: invalid syntax
baseline-bench.txt:634009: parsing iteration count: invalid syntax
baseline-bench.txt:942383: parsing iteration count: invalid syntax
baseline-bench.txt:1252164: parsing iteration count: invalid syntax
baseline-bench.txt:1545706: parsing iteration count: invalid syntax
benchmark-results.txt:245: parsing iteration count: invalid syntax
benchmark-results.txt:306255: parsing iteration count: invalid syntax
benchmark-results.txt:602005: parsing iteration count: invalid syntax
benchmark-results.txt:905897: parsing iteration count: invalid syntax
benchmark-results.txt:1215060: parsing iteration count: invalid syntax
benchmark-results.txt:1501630: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 7763 64-Core Processor                
                            │ baseline-bench.txt │        benchmark-results.txt        │
                            │       sec/op       │    sec/op      vs base              │
InterpreterCreation-4              3.121m ± 200%   3.315m ± 193%       ~ (p=0.818 n=6)
ComponentLoad-4                    3.614m ±  11%   3.633m ±   1%       ~ (p=0.310 n=6)
ComponentExecute-4                 1.928µ ±   0%   1.946µ ±   2%  +0.96% (p=0.002 n=6)
PoolContention/workers-1-4         1.088µ ±   3%   1.104µ ±   3%  +1.52% (p=0.041 n=6)
PoolContention/workers-2-4         1.085µ ±   3%   1.098µ ±   4%  +1.20% (p=0.039 n=6)
PoolContention/workers-4-4         1.083µ ±   2%   1.098µ ±   1%       ~ (p=0.065 n=6)
PoolContention/workers-8-4         1.083µ ±   1%   1.108µ ±   2%  +2.26% (p=0.002 n=6)
PoolContention/workers-16-4        1.092µ ±   1%   1.108µ ±   2%       ~ (p=0.082 n=6)
ComponentLifecycle-4               3.614m ±   0%   3.726m ±   2%  +3.09% (p=0.002 n=6)
SourceValidation-4                 2.244µ ±   1%   2.236µ ±   1%       ~ (p=0.193 n=6)
RegistryConcurrent-4               784.1n ±   4%   767.6n ±   6%       ~ (p=1.000 n=6)
LoaderLoadFromString-4             3.647m ±   1%   3.662m ±   1%       ~ (p=0.180 n=6)
geomean                            17.38µ          17.62µ         +1.36%

                            │ baseline-bench.txt │        benchmark-results.txt         │
                            │        B/op        │     B/op      vs base                │
InterpreterCreation-4               2.027Mi ± 0%   2.027Mi ± 0%       ~ (p=0.790 n=6)
ComponentLoad-4                     2.180Mi ± 0%   2.180Mi ± 0%       ~ (p=0.509 n=6)
ComponentExecute-4                  1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4         1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                2.183Mi ± 0%   2.183Mi ± 0%       ~ (p=0.290 n=6)
SourceValidation-4                  1.984Ki ± 0%   1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                1.133Ki ± 0%   1.133Ki ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4              2.182Mi ± 0%   2.182Mi ± 0%       ~ (p=0.948 n=6)
geomean                             15.25Ki        15.25Ki       +0.00%
¹ all samples are equal

                            │ baseline-bench.txt │        benchmark-results.txt        │
                            │     allocs/op      │  allocs/op   vs base                │
InterpreterCreation-4                15.68k ± 0%   15.68k ± 0%       ~ (p=1.000 n=6)
ComponentLoad-4                      18.02k ± 0%   18.02k ± 0%       ~ (p=1.000 n=6)
ComponentExecute-4                    25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4           25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                 18.07k ± 0%   18.07k ± 0%       ~ (p=1.000 n=6) ¹
SourceValidation-4                    32.00 ± 0%    32.00 ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                  2.000 ± 0%    2.000 ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4               18.06k ± 0%   18.06k ± 0%       ~ (p=1.000 n=6) ¹
geomean                               183.3         183.3       +0.00%
¹ all samples are equal

pkg: github.com/GoCodeAlone/workflow/middleware
                                  │ baseline-bench.txt │       benchmark-results.txt       │
                                  │       sec/op       │   sec/op     vs base              │
CircuitBreakerDetection-4                  286.4n ± 0%   286.6n ± 4%       ~ (p=0.812 n=6)
CircuitBreakerExecution_Success-4          22.50n ± 0%   22.52n ± 2%       ~ (p=0.232 n=6)
CircuitBreakerExecution_Failure-4          64.80n ± 2%   64.47n ± 0%       ~ (p=0.056 n=6)
geomean                                    74.74n        74.66n       -0.11%

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │        B/op        │    B/op     vs base                │
CircuitBreakerDetection-4                 144.0 ± 0%     144.0 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │     allocs/op      │ allocs/op   vs base                │
CircuitBreakerDetection-4                 1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │       sec/op       │    sec/op     vs base              │
JQTransform_Simple-4                     843.0n ± 30%   847.3n ± 29%       ~ (p=0.818 n=6)
JQTransform_ObjectConstruction-4         1.405µ ±  1%   1.402µ ±  0%       ~ (p=0.463 n=6)
JQTransform_ArraySelect-4                3.227µ ±  0%   3.272µ ±  1%  +1.38% (p=0.004 n=6)
JQTransform_Complex-4                    37.57µ ±  1%   37.53µ ±  1%       ~ (p=0.589 n=6)
JQTransform_Throughput-4                 1.738µ ±  1%   1.727µ ±  2%       ~ (p=0.513 n=6)
SSEPublishDelivery-4                     72.67n ±  1%   72.11n ±  0%  -0.77% (p=0.002 n=6)
geomean                                  1.621µ         1.621µ        +0.02%

                                 │ baseline-bench.txt │        benchmark-results.txt         │
                                 │        B/op        │     B/op      vs base                │
JQTransform_Simple-4                   1.273Ki ± 0%     1.273Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4       1.773Ki ± 0%     1.773Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4              2.625Ki ± 0%     2.625Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                  16.22Ki ± 0%     16.22Ki ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4               1.984Ki ± 0%     1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                 +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │     allocs/op      │ allocs/op   vs base                │
JQTransform_Simple-4                     10.00 ± 0%     10.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4         15.00 ± 0%     15.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4                30.00 ± 0%     30.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                    324.0 ± 0%     324.0 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4                 17.00 ± 0%     17.00 ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
                                    │ baseline-bench.txt │       benchmark-results.txt       │
                                    │       sec/op       │   sec/op     vs base              │
SchemaValidation_Simple-4                    1.083µ ± 9%   1.081µ ± 5%       ~ (p=0.818 n=6)
SchemaValidation_AllFields-4                 1.659µ ± 3%   1.698µ ± 4%       ~ (p=0.093 n=6)
SchemaValidation_FormatValidation-4          1.579µ ± 4%   1.570µ ± 2%       ~ (p=0.818 n=6)
SchemaValidation_ManySchemas-4               1.793µ ± 3%   1.800µ ± 3%       ~ (p=0.961 n=6)
geomean                                      1.501µ        1.509µ       +0.53%

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │        B/op        │    B/op     vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │     allocs/op      │ allocs/op   vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │       sec/op       │    sec/op     vs base               │
EventStoreAppend_InMemory-4                1.189µ ± 18%   1.246µ ± 18%        ~ (p=0.394 n=6)
EventStoreAppend_SQLite-4                  1.355m ±  2%   1.706m ±  6%  +25.87% (p=0.002 n=6)
GetTimeline_InMemory/events-10-4           14.06µ ±  5%   13.71µ ±  3%        ~ (p=0.093 n=6)
GetTimeline_InMemory/events-50-4           78.74µ ±  4%   64.33µ ± 21%  -18.30% (p=0.009 n=6)
GetTimeline_InMemory/events-100-4          160.2µ ±  3%   125.0µ ±  1%  -21.98% (p=0.002 n=6)
GetTimeline_InMemory/events-500-4          648.8µ ± 27%   641.6µ ±  0%   -1.11% (p=0.002 n=6)
GetTimeline_InMemory/events-1000-4         1.331m ±  2%   1.323m ±  1%        ~ (p=0.132 n=6)
GetTimeline_SQLite/events-10-4             110.1µ ±  1%   113.3µ ±  2%   +2.87% (p=0.002 n=6)
GetTimeline_SQLite/events-50-4             253.7µ ±  1%   253.7µ ±  0%        ~ (p=0.699 n=6)
GetTimeline_SQLite/events-100-4            425.5µ ±  1%   430.5µ ±  1%   +1.17% (p=0.004 n=6)
GetTimeline_SQLite/events-500-4            1.804m ±  3%   1.831m ±  1%        ~ (p=0.065 n=6)
GetTimeline_SQLite/events-1000-4           3.513m ±  1%   3.543m ±  1%   +0.85% (p=0.004 n=6)
geomean                                    226.9µ         224.0µ         -1.26%

                                   │ baseline-bench.txt │        benchmark-results.txt         │
                                   │        B/op        │     B/op      vs base                │
EventStoreAppend_InMemory-4                 751.0 ± 11%     817.0 ± 6%       ~ (p=0.121 n=6)
EventStoreAppend_SQLite-4                 1.983Ki ±  2%   1.980Ki ± 2%       ~ (p=0.325 n=6)
GetTimeline_InMemory/events-10-4          7.953Ki ±  0%   7.953Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4          46.62Ki ±  0%   46.62Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4         94.48Ki ±  0%   94.48Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4         472.8Ki ±  0%   472.8Ki ± 0%       ~ (p=0.061 n=6)
GetTimeline_InMemory/events-1000-4        944.3Ki ±  0%   944.3Ki ± 0%       ~ (p=0.121 n=6)
GetTimeline_SQLite/events-10-4            16.74Ki ±  0%   16.74Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4            87.14Ki ±  0%   87.14Ki ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4           175.4Ki ±  0%   175.4Ki ± 0%       ~ (p=1.000 n=6)
GetTimeline_SQLite/events-500-4           846.1Ki ±  0%   846.1Ki ± 0%       ~ (p=0.182 n=6)
GetTimeline_SQLite/events-1000-4          1.639Mi ±  0%   1.639Mi ± 0%       ~ (p=0.991 n=6)
geomean                                   67.06Ki         67.52Ki       +0.69%
¹ all samples are equal

                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │     allocs/op      │  allocs/op   vs base                │
EventStoreAppend_InMemory-4                  7.000 ± 0%    7.000 ± 0%       ~ (p=1.000 n=6) ¹
EventStoreAppend_SQLite-4                    53.00 ± 0%    53.00 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-10-4             125.0 ± 0%    125.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4             653.0 ± 0%    653.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4           1.306k ± 0%   1.306k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4           6.514k ± 0%   6.514k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-1000-4          13.02k ± 0%   13.02k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-10-4               382.0 ± 0%    382.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4              1.852k ± 0%   1.852k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4             3.681k ± 0%   3.681k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4             18.54k ± 0%   18.54k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-1000-4            37.29k ± 0%   37.29k ± 0%       ~ (p=1.000 n=6) ¹
geomean                                     1.162k        1.162k       +0.00%
¹ all samples are equal

Benchmarks run with go test -bench=. -benchmem -count=6.
Regressions ≥ 20% are flagged. Results compared via benchstat.

@intel352 intel352 merged commit 39b1e90 into main Mar 24, 2026
22 checks passed
@intel352 intel352 deleted the copilot/add-schedule-and-event-trigger-types branch March 24, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wftest YAML runner: missing schedule and event trigger types

3 participants