pytest-testinfra
pytest-testinfra copied to clipboard
parallel execution for multiple servers
I have few hundred small GCP, Azure servers. I want to run some basic tests against them. Is there a way to parallelize my tests? Each test test less than a few ms, but I have hundreds of checks I need to run.
My code looks like this
import unittest
import testinfra
class Test(unittest.TestCase):
def setUp(self):
self.host = testinfra.get_host("paramiko://user@localhost")
def test_foo_config(self):
self.assertEqual(self.host.run("/tmp/f.sh").rc,0)
if __name__=="__main__":
unittest.main()
Any help in organizing code, tips, and recommendations would be much appreciated.
Great tool BTW
Use pytest-xdist as documented in https://testinfra.readthedocs.io/en/latest/invocation.html#parallel-execution ?