Skip to content
Snippets Groups Projects
Commit 26080da9 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

do not always accept failing command

parent 52997aff
No related branches found
No related tags found
No related merge requests found
......@@ -26,5 +26,8 @@
self.base_command = get_var('command')
self.command = None
# XXX having a list of acceptable status would be better (default to [0])
self.accept_failure = bool(get_var('accept-failure'))
self.cwd = get_var('cwd')
......@@ -29,6 +32,5 @@
self.cwd = get_var('cwd')
def apply_data_env(self, data_env_data):
variables_data = self._benchmark_data['simple-command'].get('variables')
......@@ -100,6 +102,8 @@
"--",
cmd.command,
]
if cmd.accept_failure:
time_cmd.insert(-2, "--ignore-failure")
cwd = data_env_path
if cmd.cwd is not None:
......
......@@ -74,6 +74,7 @@
$ env-desc set black-tiny-bad.pbd meta.name black.check.tiny
$ env-desc set black-tiny-bad.pbd meta.method simple-command
$ env-desc set black-tiny-bad.pbd simple-command.command "black --check {file}"
$ env-desc set black-tiny-bad.pbd simple-command.accept-failure "1"
$ env-desc set black-tiny-bad.pbd simple-command.variables.file DATA-VARS:black.check.tiny.bad
$ env-desc set black-tiny-bad.pbd simple-command.cwd DATA-VARS:.
......@@ -83,6 +84,7 @@
method = simple-command
name = black.check.tiny
simple-command:
accept-failure = 1
command = black --check {file}
cwd = DATA-VARS:.
variables:
......@@ -120,6 +122,7 @@
method = simple-command
name = black.check.tiny
simple-command:
accept-failure = 1
command = black --check {file}
cwd = DATA-VARS:.
variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment