ckit
ckit copied to clipboard
Re-enable the test for abort-on-fail command
https://github.com/fpgmaas/ckit/blob/main/tests/test_command.py#L26
Caused issues in tox
============================= test session starts ==============================
platform linux -- Python 3.9.16, pytest-7.2.2, pluggy-1.0.0
cachedir: .tox/py39/.pytest_cache
rootdir: /home/runner/work/ckit/ckit
plugins: cov-4.0.0, anyio-3.6.2
collected 8 items
tests/test_command.py ..F [ 37%]
tests/config/test_common.py . [ 50%]
tests/config/test_config.py . [ 62%]
tests/config/test_config_files_initiator.py . [ 75%]
tests/config/test_config_loader.py . [ 87%]
tests/config/test_yaml_parser.py . [100%]
=================================== FAILURES ===================================
_____________________ test_command_stops_running_on_error ______________________
capsys = <_pytest.capture.CaptureFixture object at 0x7fce25a54af0>
def test_command_stops_running_on_error(capsys):
command = Command(name="test", cmd=["echo123", "echo Hello"])
> output = command.run()
tests/test_command.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ckit/command.py:70: in run
proc = subprocess.run(shlex.split(self._expand_env_vars(command)))
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py:505: in run
with Popen(*popenargs, **kwargs) as process:
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py:951: in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Popen: returncode: 255 args: ['echo123']>, args = ['echo123']
executable = b'echo123', preexec_fn = None, close_fds = True, pass_fds = ()
cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False
p2cread = -1, p2cwrite = -1, c2pread = -1, c2pwrite = -1, errread = -1
errwrite = -1, restore_signals = True, gid = None, gids = None, uid = None
umask = -1, start_new_session = False
def _execute_child(self, args, executable, preexec_fn, close_fds,
pass_fds, cwd, env,
startupinfo, creationflags, shell,
err_msg = ""
# The error must be from chdir(cwd).
err_filename = cwd
else:
err_filename = orig_executable
if errno_num != 0:
err_msg = os.strerror(errno_num)
> raise child_exception_type(errno_num, err_msg, err_filename)
E FileNotFoundError: [Errno 2] No such file or directory: 'echo123'
/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/subprocess.py:1821: FileNotFoundError
----------------------------- Captured stdout call -----------------------------
echo123
---------- coverage: platform linux, python 3.9.16-final-0 -----------
Coverage XML written to file coverage.xml
=========================== short test summary info ============================
FAILED tests/test_command.py::test_command_stops_running_on_error - FileNotFo...
========================= 1 failed, 7 passed in 0.52s ==========================
py39: exit 1 (1.44 seconds) /home/runner/work/ckit/ckit> pytest --doctest-modules tests --cov --cov-config=pyproject.toml --cov-report=xml pid=1961
py39: FAIL code 1 (16.10=setup[1.24]+cmd[13.42,1.44] seconds)
evaluation failed :( (16.18 seconds)