Schedule jobs and suites
This page shows how to run scripts on a schedule, chain them, and group them into a pass-rate score.
You need a project with an online agent and at least one script.
A job runs one script on a schedule. Open Jobs, choose New job and set:
- Script and optional Setup scripts. Setup scripts run before the main script, in the order you list them.
- Cron expression in Quartz syntax, seconds first.
0 */15 * ? * *is every 15 minutes,0 0 6 ? * MON-FRIis weekdays at 06:00. The form previews the next runs. - Scheduled: untick it to keep the job but never run it on a timer.
- Log retention: keep logs for a number of days, or a number of runs. Empty keeps everything.
- Groups: members of these groups can see and run the job.
A job that is still running skips its next tick, so runs never overlap.
Press Run now on a job to run it outside its schedule. To stop the timer without deleting the job, use Pause schedule in the row menu.
Chain jobs
Section titled “Chain jobs”Under Job sequencing, add the jobs that should start when this one finishes. Pick for each whether it starts on success or on failure. Use a failure chain for a notification job.
Hand data to the next job
Section titled “Hand data to the next job”A script stores data with Data.set("key", value). Under Import data, add the job whose data you want, and choose its last run or its last successful run. The importing script reads the values from Values:
local token = Values.token -- from the imported datalocal count = Values.job["fetch-orders"].count -- from a specific jobSuites
Section titled “Suites”A suite runs every script that carries certain tags, in parallel, and scores the run as the percentage of scripts that passed. Use a suite for questions like “is the release green?”.
Tag a script on its first line:
-- tags: smoke, checkoutIn Python use # tags: smoke, checkout. Then open Suites, choose New suite and set:
- Tags and the match mode: all tags (AND) or any tag (OR).
- Setup scripts, Groups and an optional cron expression, as for jobs.
The suite page shows the latest score, the runtime and how this run compares with the suite average. Every script run is one click away.
Look at the results
Section titled “Look at the results”Runs lists every run of the project. Filter by status, kind (script, job or suite), job, suite and time. Open a run to see its steps, console output, result files and data. For a failed run, go to Debugging.
Who can do what
Section titled “Who can do what”Roles control who can create jobs and suites (Edit jobs) and who can start them by hand (Start jobs by hand). See roles.