Created
August 8, 2023 16:49
-
-
Save giodamelio/ba4bb2053218d6972fa8c6afc21e3984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "OneShot", | |
"description": "Top-level data in `cmd.toml` files", | |
"type": "object", | |
"properties": { | |
"bin": { | |
"anyOf": [ | |
{ | |
"$ref": "#/definitions/Bin" | |
}, | |
{ | |
"type": "null" | |
} | |
] | |
}, | |
"args": { | |
"default": [], | |
"allOf": [ | |
{ | |
"$ref": "#/definitions/Args" | |
} | |
] | |
}, | |
"env": { | |
"default": { | |
"add": {}, | |
"inherit": null, | |
"remove": [] | |
}, | |
"allOf": [ | |
{ | |
"$ref": "#/definitions/Env" | |
} | |
] | |
}, | |
"stdin": { | |
"default": null, | |
"type": [ | |
"string", | |
"null" | |
] | |
}, | |
"stdout": { | |
"default": null, | |
"type": [ | |
"string", | |
"null" | |
] | |
}, | |
"stderr": { | |
"default": null, | |
"type": [ | |
"string", | |
"null" | |
] | |
}, | |
"stderr-to-stdout": { | |
"default": false, | |
"type": "boolean" | |
}, | |
"status": { | |
"anyOf": [ | |
{ | |
"$ref": "#/definitions/CommandStatus" | |
}, | |
{ | |
"type": "null" | |
} | |
] | |
}, | |
"binary": { | |
"default": false, | |
"type": "boolean" | |
}, | |
"timeout": { | |
"default": null, | |
"anyOf": [ | |
{ | |
"$ref": "#/definitions/Duration" | |
}, | |
{ | |
"type": "null" | |
} | |
] | |
}, | |
"fs": { | |
"default": { | |
"base": null, | |
"cwd": null, | |
"sandbox": null | |
}, | |
"allOf": [ | |
{ | |
"$ref": "#/definitions/Filesystem" | |
} | |
] | |
} | |
}, | |
"definitions": { | |
"Bin": { | |
"description": "Target under test", | |
"oneOf": [ | |
{ | |
"type": "string", | |
"enum": [ | |
"ignore" | |
] | |
}, | |
{ | |
"type": "object", | |
"required": [ | |
"path" | |
], | |
"properties": { | |
"path": { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
{ | |
"type": "object", | |
"required": [ | |
"name" | |
], | |
"properties": { | |
"name": { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": false | |
} | |
] | |
}, | |
"Args": { | |
"anyOf": [ | |
{ | |
"$ref": "#/definitions/JoinedArgs" | |
}, | |
{ | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
] | |
}, | |
"JoinedArgs": { | |
"type": "object", | |
"required": [ | |
"inner" | |
], | |
"properties": { | |
"inner": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"Env": { | |
"description": "Describe command's environment", | |
"type": "object", | |
"properties": { | |
"inherit": { | |
"default": null, | |
"type": [ | |
"boolean", | |
"null" | |
] | |
}, | |
"add": { | |
"default": {}, | |
"type": "object", | |
"additionalProperties": { | |
"type": "string" | |
} | |
}, | |
"remove": { | |
"default": [], | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
} | |
} | |
}, | |
"CommandStatus": { | |
"description": "Expected status for command", | |
"oneOf": [ | |
{ | |
"type": "string", | |
"enum": [ | |
"success", | |
"failed", | |
"interrupted", | |
"skipped" | |
] | |
}, | |
{ | |
"type": "object", | |
"required": [ | |
"code" | |
], | |
"properties": { | |
"code": { | |
"type": "integer", | |
"format": "int32" | |
} | |
}, | |
"additionalProperties": false | |
} | |
] | |
}, | |
"Duration": { | |
"type": "object", | |
"required": [ | |
"nanos", | |
"secs" | |
], | |
"properties": { | |
"secs": { | |
"type": "integer", | |
"format": "uint64", | |
"minimum": 0.0 | |
}, | |
"nanos": { | |
"type": "integer", | |
"format": "uint32", | |
"minimum": 0.0 | |
} | |
} | |
}, | |
"Filesystem": { | |
"description": "Describe the command's filesystem context", | |
"type": "object", | |
"properties": { | |
"cwd": { | |
"type": [ | |
"string", | |
"null" | |
] | |
}, | |
"base": { | |
"description": "Sandbox base", | |
"type": [ | |
"string", | |
"null" | |
] | |
}, | |
"sandbox": { | |
"type": [ | |
"boolean", | |
"null" | |
] | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment