osmates matrix
Run one script in a throwaway clone of each of several machines, with a JUnit report.
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
osmates matrix win11 ubuntu --script test.ps1 --script test.sh
osmates matrix dev --script ci.sh --copy-in ./src --copy-out /tmp/out.logArguments
<machines>RepeatableThe machines or templates to clone, each once.
--script <file>RepeatableA 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]>RepeatableCopy a local file or folder into each clone first, to the guest path or beside the script.
--copy-out <guest>RepeatableCopy 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>RepeatableAdd a variable to the program's environment.
--timeout <timeout>Seconds the program runs before it's killed. Default: no limit.
--desktopRun 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.--jsonPrint machine-readable JSON.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/matrix.json
elapsedintegerRequiredfolderstringRequiredmachinesarray of objectsRequiredmachines[].clonestringmachines[].copiedOutarray of objectsRequiredmachines[].elapsedintegerRequiredmachines[].exitobjectmachines[].failureobjectmachines[].jobstringmachines[].machinestringRequiredmachines[].operatingSystemstringRequiredOne of
linux,macOS,windows,freeBSD.machines[].outcomestringRequiredOne of
passed,failed,error,cancelled.machines[].outputarray of objectsRequiredmachines[].startedstring (date-time)machines[].stepsarray of objectsRequiredoutcomestringRequiredOne of
passed,failed,error,cancelled.reportstringRequiredstartedstring (date-time)Required
Fields nested deeper are in the schema.
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |
| 1 | The command printed its result, whose check failed. |