Here is the performance I see for 2 simple tests on different backends.
It seems that ansible is much, much, much slower !
Admittedly ansible needs more time to update its inventory, but the task themselves are slow as if it were connecting to the machine at every single test.
Here is some sample output:
1/ test with IP provided
2/ test with ansible
<!> Also output is not the same for some unknown reason
$ testinfra [email protected],[email protected],[email protected],[email protected],[email protected] main.py
================================================= test session starts =================================================
platform linux2 -- Python 2.7.6, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
rootdir: /home/emayssat/workspaces/emayssat/devtools-vpc/devops/aws/release/tests, inifile:
plugins: testinfra-1.0.0.0a21
collected 10 items
main.py ..........
============================================== 10 passed in 7.62 seconds ==============================================
(aws)~/workspaces/emayssat/devtools-vpc/devops/aws/release/tests
emayssat@xps13 $ make execute_tests
AWS_PROFILE=7009 testinfra -v --connection=ansible --ansible-inventory=inventories/ec2_7009 --hosts=key_Release001 main.py
================================================= test session starts =================================================
platform linux2 -- Python 2.7.6, pytest-2.8.5, py-1.4.31, pluggy-0.3.1 -- /home/emayssat/.virtualenvs/aws/bin/python
cachedir: .cache
rootdir: /home/emayssat/workspaces/emayssat/devtools-vpc/devops/aws/release/tests, inifile:
plugins: testinfra-1.0.0.0a21
collected 10 items
main.py::test_passwd_file[ansible://52.8.21.124] PASSED
main.py::test_surrogate_file[ansible://52.8.21.124] PASSED
main.py::test_passwd_file[ansible://54.67.33.158] PASSED
main.py::test_surrogate_file[ansible://54.67.33.158] PASSED
main.py::test_passwd_file[ansible://52.9.29.73] PASSED
main.py::test_surrogate_file[ansible://52.9.29.73] PASSED
main.py::test_passwd_file[ansible://54.67.6.175] PASSED
main.py::test_surrogate_file[ansible://54.67.6.175] PASSED
main.py::test_passwd_file[ansible://54.67.81.102] PASSED
main.py::test_surrogate_file[ansible://54.67.81.102] PASSED
============================================= 10 passed in 82.07 seconds ==============================================
(aws)~/workspaces/emayssat/devtools-vpc/devops/aws/release/tests
emayssat@xps13 $ make execute_tests
AWS_PROFILE=7009 testinfra -v --connection=ansible --ansible-inventory=inventories/ec2_7009 --hosts=key_Release001 main.py
================================================= test session starts =================================================
platform linux2 -- Python 2.7.6, pytest-2.8.5, py-1.4.31, pluggy-0.3.1 -- /home/emayssat/.virtualenvs/aws/bin/python
cachedir: .cache
rootdir: /home/emayssat/workspaces/emayssat/devtools-vpc/devops/aws/release/tests, inifile:
plugins: testinfra-1.0.0.0a21
collected 10 items
main.py::test_passwd_file[ansible://52.8.21.124] PASSED
main.py::test_surrogate_file[ansible://52.8.21.124] PASSED
main.py::test_passwd_file[ansible://54.67.33.158] PASSED
main.py::test_surrogate_file[ansible://54.67.33.158] PASSED
main.py::test_passwd_file[ansible://52.9.29.73] PASSED
main.py::test_surrogate_file[ansible://52.9.29.73] PASSED
main.py::test_passwd_file[ansible://54.67.6.175] PASSED
main.py::test_surrogate_file[ansible://54.67.6.175] PASSED
main.py::test_passwd_file[ansible://54.67.81.102] PASSED
main.py::test_surrogate_file[ansible://54.67.81.102] PASSED
============================================= 10 passed in 47.62 seconds ==============================================
(aws)~/workspaces/emayssat/devtools-vpc/devops/aws/release/tests
emayssat@xps13 $ make execute_tests
AWS_PROFILE=7009 testinfra -v --connection=ansible --ansible-inventory=inventories/ec2_7009 --hosts=key_Release001 main.py
================================================= test session starts =================================================
platform linux2 -- Python 2.7.6, pytest-2.8.5, py-1.4.31, pluggy-0.3.1 -- /home/emayssat/.virtualenvs/aws/bin/python
cachedir: .cache
rootdir: /home/emayssat/workspaces/emayssat/devtools-vpc/devops/aws/release/tests, inifile:
plugins: testinfra-1.0.0.0a21
collected 10 items
main.py::test_passwd_file[ansible://52.8.21.124] PASSED
main.py::test_surrogate_file[ansible://52.8.21.124] PASSED
main.py::test_passwd_file[ansible://54.67.33.158] PASSED
main.py::test_surrogate_file[ansible://54.67.33.158] PASSED
main.py::test_passwd_file[ansible://52.9.29.73] PASSED
main.py::test_surrogate_file[ansible://52.9.29.73] PASSED
main.py::test_passwd_file[ansible://54.67.6.175] PASSED
main.py::test_surrogate_file[ansible://54.67.6.175] PASSED
main.py::test_passwd_file[ansible://54.67.81.102] PASSED
main.py::test_surrogate_file[ansible://54.67.81.102] PASSED
============================================= 10 passed in 54.28 seconds ==============================================
(aws)~/workspaces/emayssat/devtools-vpc/devops/aws/release/tests
question