Request an invite
Docs menu

osmates matrix

Run one script in a throwaway clone of each of several machines, with a JUnit report.

Usage
osmates matrix [<options>] [<machines> ...]

Each machine or template gets a clone, which runs the script for its system as osmates run runs a program. The clone is deleted whatever happens. A machine that fails stops none of the others. Needs OSMates Pro.

As many clones run at once as fit in the Mac's free memory, keeping 4 GiB for the Mac, with two macOS machines at most. The first clone starts whatever its size.

Exits 0 when every script exited 0 and every clone was deleted, 1 otherwise, and 130 after Control-C.

Reports and artifacts: https://osmates.com/docs/matrix

Examples

sh
osmates matrix win11 ubuntu --script test.ps1 --script test.sh
osmates matrix dev --script ci.sh --copy-in ./src --copy-out /tmp/out.log

Arguments

<machines>Repeatable

The machines or templates to clone, each once.

--script <file>Repeatable

A script to copy into each clone and run there; one for Windows and one for Linux and macOS at most.

A .ps1, .cmd or .bat script runs on Windows, any other on Linux and macOS with /bin/sh. It's copied to /tmp/ or C:\Users\Public\ and runs there.

--copy-in <local[:guest]>Repeatable

Copy a local file or folder into each clone first, to the guest path or beside the script.

--copy-out <guest>Repeatable

Copy a file or folder out of each clone afterwards, into its machine's artifacts folder; a relative path is beside the script.

--to <folder>

A new or empty folder for the report and each machine's files. Default: ./matrix-<date>-<time>.

It gets junit.xml, with a testsuite for each machine and a testcase for each step with the script's output. Each machine gets a folder with stdout.txt, stderr.txt and the --copy-out files in artifacts.

--parallel <parallel>

Run at most this many clones at once.

--user <user>

The guest account to run as. Default: root, or LocalSystem in Windows.

With --desktop, the account expected at the screen. Windows takes an account only with --desktop.

--workdir <workdir>

The working directory. Default: the account's home, C:\ in Windows, or the user's profile with --desktop.

--env <name=value>Repeatable

Add a variable to the program's environment.

--timeout <timeout>

Seconds the program runs before it's killed. Default: no limit.

--desktop

Run as the user signed in at the screen, on their desktop.

--arch <arch>

Which code of a program built for several architectures runs.

One of arm64, x64.

--json

Print machine-readable JSON.

JSON output

With --json, it prints an object with these fields.

JSON Schema: /schemas/0/cli/matrix.json

elapsedintegerRequired
folderstringRequired
machinesarray of objectsRequired
machines[].clonestring
machines[].copiedOutarray of objectsRequired
machines[].elapsedintegerRequired
machines[].exitobject
machines[].failureobject
machines[].jobstring
machines[].machinestringRequired
machines[].operatingSystemstringRequired

One of linux, macOS, windows, freeBSD.

machines[].outcomestringRequired

One of passed, failed, error, cancelled.

machines[].outputarray of objectsRequired
machines[].startedstring (date-time)
machines[].stepsarray of objectsRequired
outcomestringRequired

One of passed, failed, error, cancelled.

reportstringRequired
startedstring (date-time)Required

Fields nested deeper are in the schema.

Exit statuses

Its exit status is one of these.

StatusMeaning
0The command did what it was asked.
1The command failed; with --json, standard error's last line is the error object.
64The command line is wrong, as ArgumentParser found before the command ran.
65What was given is wrong, found while the command ran; the same command fails until it changes.
75The same command can work later with nothing changed, as while an update finishes.
130Control-C cancelled what the command started.
1The command printed its result, whose check failed.

Report a problem with this page