Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel execution for multiple servers #714

Open
TheKushIsGood opened this issue Jul 1, 2023 · 1 comment
Open

parallel execution for multiple servers #714

TheKushIsGood opened this issue Jul 1, 2023 · 1 comment
Labels

Comments

@TheKushIsGood
Copy link

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

@philpep
Copy link
Contributor

philpep commented Aug 24, 2023

Use pytest-xdist as documented in https://testinfra.readthedocs.io/en/latest/invocation.html#parallel-execution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants