CI test scripts
Add a test: annotation at the top of any script to turn it into a CI test. When the tested script or flow is deployed, the test runs automatically.
Writing a test script
Single target
// test: script/u/admin/my_script
import * as wmill from "windmill-client";
export async function main() {
const result = await wmill.runScript("u/admin/my_script", {});
if (result !== 42) {
throw new Error(`Expected 42, got ${JSON.stringify(result)}`);
}
return result;
}
Multiple targets
// test:
// script/u/admin/script_a
// script/u/admin/script_b
// flow/u/admin/my_flow
import * as wmill from "windmill-client";
export async function main() {
// test all items
}
Python
# test: script/u/admin/my_script
import wmill
def main():
result = wmill.run_script("u/admin/my_script", {})
assert result == 42
return result
The annotation uses the comment syntax of each language (// for TypeScript, # for Python, etc.).
The script creation page also provides ready-made CI test templates for TypeScript and Python.
Where results appear
Test scripts show a yellow CI test badge in the script list and detail page.
On the detail page of the tested script or flow, each test is listed with its status (pass, fail, or running) and a link to the job run. Results auto-refresh while tests are running.
In workspace forks, CI results are also visible:
- The fork banner shows a summary of passing, failing, and running tests across all changed items.
- On the comparison page, each changed item displays a CI badge, and a test summary lists all test scripts with their latest results.