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

Run a single suite with N instances in parallel with different BeforeSuite Setup. #1385

Closed
anveshreddy18 opened this issue Apr 9, 2024 · 3 comments

Comments

@anveshreddy18
Copy link

anveshreddy18 commented Apr 9, 2024

Hello, firstly, thanks for the wonderful framework.

I would like to know if I can run the same test suite with say 3-4 instances running in parallel where the only difference between them would be the BeforeSuite setup.

This is coming from Kubernetes related integration tests requirement where I want to run the test suite in parallel in multiple namespaces with different cloud providers in each of them, so the required BeforeSuite setup is different but the specs are all the same. Is there a way to achieve this? I'm new to Ginkgo and researched fairly about this but I'm afraid I didn't find much info related to running instances of same spec in parallel.

Can I know if this is possible? Can someone explain in detail.

Thanks for your time :)

@anveshreddy18 anveshreddy18 changed the title Run the same suite with N instances in parallel with different BeforeSuite Setup. Run a single suite with N instances in parallel with different BeforeSuite Setup. Apr 10, 2024
@anveshreddy18
Copy link
Author

@onsi can you PTAL at this once. Thanks :)

@onsi
Copy link
Owner

onsi commented Apr 15, 2024

heyo - sorry for the delay. I've been out of pocket for a couple of weeks.

Ginkgo doesn't directly support this usecase. I can imagine some workarounds but nothing that will be super clean. I would, personally, approach this by making the cloud provider configurable (e.g. via a command line argument or an environment variable) and then invoke ginkgo multiple times for each cloud provider (e.g. in series). This gives you a building block that you can then leverage in CI. For example, back in the day the Cloud Foundry test suite could run against a variety of cloud providers. A single Ginkgo suite could target any of these given different configuration inputs. We would run them in parallel in CI - using the CI system's built in capacity for parallel builds to nicely sequester and monitor the different ginkgo suites.

This is, honestly, a bit cleaner as you end up with logs and reports that are cleanly sequestered by cloud provider. It also makes it a bit easier to write cloud-provider-specific specs.

Could something like this be added to Ginkgo? No doubt. But it's not something that's currently on the roadmap. I'd suggest going down the CI route.

@anveshreddy18
Copy link
Author

anveshreddy18 commented Apr 16, 2024

Thanks @onsi for taking the time to comment. Yes it does seem like more approachable and cleaner way to run them in parallel in CI. Thanks for the advice :)

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

No branches or pull requests

2 participants