2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
ansible-core,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
paramiko,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pywinrm,
|
|
|
|
salt,
|
|
|
|
setuptools-scm,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-testinfra";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "10.1.0";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-93Qzm5R3Ws3zqMSjeTqOrS6N/HD/NLd4vhWquhQPoZ4=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools-scm ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
ansible-core
|
|
|
|
paramiko
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
pywinrm
|
|
|
|
salt
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# Markers don't get added when docker is not available (leads to warnings):
|
2023-10-09 19:29:22 +00:00
|
|
|
# https://github.com/pytest-dev/pytest-testinfra/blob/9.0.0/test/conftest.py#L223
|
2023-07-15 17:15:38 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
sed -i '54imarkers = \
|
|
|
|
\ttestinfra_hosts(host_selector): mark test to run on selected hosts \
|
|
|
|
\tdestructive: mark test as destructive \
|
|
|
|
\tskip_wsl: skip test on WSL, no systemd support' setup.cfg
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# docker is required for all disabled tests
|
2023-07-15 17:15:38 +00:00
|
|
|
# test/test_backends.py
|
|
|
|
"test_command"
|
|
|
|
"test_encoding"
|
|
|
|
"test_ansible_any_error_fatal"
|
|
|
|
"test_user_connection"
|
|
|
|
"test_sudo"
|
|
|
|
"test_docker_encoding"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Broken because salt package only built for Python
|
2023-08-04 22:07:22 +00:00
|
|
|
"test_backend_importables"
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTestPaths = [ "test/test_modules.py" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Pytest plugin for testing your infrastructure";
|
|
|
|
homepage = "https://github.com/pytest-dev/pytest-testinfra";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/pytest-dev/pytest-testinfra/releases/tag/${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ hulr ];
|
|
|
|
};
|
|
|
|
}
|