-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Does go test run ginkgo tests parallel automatically? #111
Comments
Hey @AlexLuya Yes, I'd strongly recommend you use the
Ginkgo supports a different model of parallelization than |
thanks,I will try it. |
@onsi can you share more context of why parallel test suites are terrible? if anything, i'd expect to hear that parallel tests within a suite are terrible, not that parallel suites are terrible. interested in helping to get suites running in parallel or understand why our tests should be parallel instead of suites. thanks! |
"terrible" is probably way too strong. running different test suites (especially integration test suites) that might share some sort of global resource (e.g. both pointed at an external cluster, or an external resource set up on the box) could lead to conflicts and surprising/difficult to reproduce test results. running unit tests in parallel this way is arguably fine. tests running in parallel within a suite is also problematic - same reason. any global state (or accidental global state - and this can crop up easily) could be a source of random difficult to understand error. i chose a very particular approach with ginkgo that gives the test author a bit more context and control. when you run a suite in parallel ginkgo launches multiple processes and shards the tests across those processes making available the current parallel node. this lets you manage any shared resources and shard your usage of said resources deterministically. (Ginkgo was built to help test drive Cloud Foundry and this particular strategy is super helpful for our many integration suites). there's also some fancy behavior around but in all fairness... |
@onsi thanks for the response - I'm actually pretty interested in being able to run suites in parallel, using something like https://github.com/codahale/testdb to allow them to function completely separately. this way it's very easy/fast to say:
and
can both run totally in parallel. Any suggestions for that? |
Would entityA and entityB share the same test suite? Or different test suites? What makes more semantic sense for your project? If they can be in the same suite then I encourage you to look at Ginkgo's parallelization techniques. In cases like this I've seen the following pattern work:
Another approach is to use Both approaches work and allow you to use If entityA and entityB need to be in separate suites (e.g. they are in separate folders and therefore packages) you have two options:
FWIW I've never seen anyone do the latter but it should be possible. |
I was going to suggest wrapping multiple processes in bash. I've seen it done before, but it's gross. Handling the processes and the output gets tricky quickly. You could wrap the |
I have a project with structure like this
skeleton of toAnotherUpdateDao_test.go and toMasterUpdateDao_test.go
Problem is:
The text was updated successfully, but these errors were encountered: