mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-22 00:03:35 +00:00
* feat: WM_TESTED_RUNNABLE env var + wildcards in test: annotation
Extends the CI test feature so a single test script can cover multiple
runnables and branch on which one triggered it.
- test: annotation now supports glob wildcards: `*` matches one path
segment, `**` matches any depth. A new `ci_test_path_matches` helper
in windmill-common compiles patterns to anchored regexes with a small
quick_cache LRU.
- New migration adds a Postgres GENERATED `has_wildcard` column + partial
index on ci_test_reference so exact-match lookups keep using the
primary index and only wildcard rows are scanned for regex matching.
- ci_test trigger query and the UI `ci_test_results` / `ci_test_results_batch`
endpoints split into exact + wildcard paths; the batch endpoint now
issues one query per distinct kind instead of one per item.
- Worker injects `WM_TESTED_RUNNABLE={kind}/{path}` into CI test jobs,
derived from the trigger metadata stored at push time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: scope CI test job lookup by trigger + populate WM_TESTED_RUNNABLE in resource interpolation
Scope the ci_test_results LATERAL lookup by v2_job.trigger so multi-target
tests (via wildcards or multiple exact annotations) report the correct job
per target. Also pass the tested runnable through transform_json_value in
resources.rs for consistency with schedule_path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: update ee-repo-ref to 489eb0d89702e5d1cc7c6e0f9ba9e0c8e5063741
This commit updates the EE repository reference after PR #546 was merged in windmill-ee-private.
Previous ee-repo-ref: e7534bcafcd8c27fcf870b2ea868e901b00b7960
New ee-repo-ref: 489eb0d89702e5d1cc7c6e0f9ba9e0c8e5063741
Automated by sync-ee-ref workflow.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
27 lines
715 B
Plaintext
27 lines
715 B
Plaintext
# test: script/u/user/script_to_test
|
|
#
|
|
# Wildcards: `*` matches one path segment, `**` matches any depth.
|
|
# # test: script/u/user/*
|
|
# # test: flow/u/team/**
|
|
#
|
|
# To test multiple items, list them on separate lines:
|
|
# # test:
|
|
# # script/u/user/script_a
|
|
# # script/u/user/script_b
|
|
# # flow/u/user/my_flow
|
|
#
|
|
# The triggering item is exposed as os.environ["WM_TESTED_RUNNABLE"]
|
|
# (e.g. "script/u/user/script_to_test"), useful for branching inside a
|
|
# single test script that covers multiple targets.
|
|
import wmill
|
|
|
|
|
|
def main():
|
|
result = wmill.run_script("u/user/script_to_test", {})
|
|
|
|
# Add your assertions here
|
|
# if result != 42:
|
|
# raise Exception(f"Expected 42, got {result}")
|
|
|
|
return result
|