- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Feature request: ability to have Ginkgo tests run with a different test runner #146
Comments
A lot of this can be accomplished today by scripting the I agree that adding yet more options to the cli is probably not the way to go - though even there we are already most of the way there: |
Scripting ginkgo cli only goes so far. For the type of scenarios envisioned, access to the tree is the right approach. For example, it's easier to setup and share external resources among the tests, as well as do things like change the behavior on panics (some may be acceptable to continue, some should stop all testing for stress failure investigation). While a lot of scenarios can be done with the current driver, burdening it with ever more options doesn't seem to be the right thing. |
Apologies for the length of this post. I don't mean to be difficult - just want to make sure we identify the actual problems you are trying to solve. If gaining access to the tree is the best solution to the problems you want to solve I am open to that implementation choice (note, however, that writing a runner is not completely trivial so this adds a substantial burden on the runner maintainer). At this point, I'm not convinced that this is the best solution for the problem at hand. Here are the problems you've raised so far:
I'm unconvinced that a custom runner is the best solution to these problems. I do believe that Ginkgo today, in an unmodified form, gives you most of these things - and that there are probably straightforward ways to extend Ginkgo to give you all of these things. I'd value the latter approach as it would give more people the kind of sophisticated tooling that they need. Let's go at these one at a time:
|
@fabioy: I'm actually with @onsi here. (@onsi, as a disclaimer, we're both on the Kubernetes project, so you've seen our questionable runner). We need to actually port our stuff over to the default ginkgo runner. There are technical blockers for us to do so and we just haven't gotten through them yet, but I think we either need to embrace the main Ginkgo runner, or (to be blunt) abandon the framework (and I don't want to do the latter). |
Yep - would love to hear more about your technical blockers and help y'all work through them. We have an equally (if not more) complex set of Ginkgo test suites for Diego. |
It probably makes more sense to do that as a either a separate issue, or an email thread. I'm happy to open an issue on our side and @ you on it, because it's something I've been threatening to do for a while. |
Let me dig a bit more into this. Meanwhile, the actual problem I'm trying Where I'd like to get to is to be able to say, "If you write your e2e tests Asking for access to the test tree was one way to get there. I think a lot I have a WIP change for my tool that prototypes some of this. If I have Thanks. On Thu, Mar 19, 2015 at 2:06 PM, Zach Loafman notifications@github.com
-- Fabio Yeon |
Heh. I miss fail(9) so much. (So much that I ported it out from the company I was at to FreeBSD. :P) @fabioy, I think what you're looking for is just a fixture that can be queried for whether failures should occur at particular junctions or not. You could easily imagine something as dumb as:
but maybe that's not what you had in mind? Maybe you wanted more implicit fault injection? |
alrighty - sorry for the delay but I ended up spending a bit of time prototyping something. https://github.com/onsi/composition-ginkgo-example presents one way to organize Ginkgo tests such that they can be shared between a traditional integration-style test and something more complex like a stress test. I'll be the first to admit that the stress test I wrote doesn't quite give you all the fine control you're envisioning @fabioy. One thing I did not include, for example, is the ability for the test writer to request failures at specific points in the code. This would be fairly trivial however (add something like but I also want to step back and dig into your proposed stress test approach. It sounds like you aren't proposing a "chaos-monkey" style approach where a standard integration test runs in the foreground while an autonomous process wreaks havoc on the object under test. Instead, it sounds like you want to have a lot of fine-grained control over when failures can occur and, perhaps, what the nature of the failures is, etc. We've taken a different approach. While we'd like to have the "chaos-monkey" style that I just described (we don't have it yet) we do have a test suite that exercises the system under test through specific high-value failure modes. For example: we request that the cluster take an action and then immediately shut down one of its components. We then bring the component back up and assert that, eventually, the system attains eventual consistency. We've found this sort of testing to be very useful and (most importantly) substantially easier to debug than a more chaotic approach. Granted this puts the onus on the developers to characterize the various failure modes of the system (and, no doubt, we've missed many!) - nonetheless I would argue that it's actually very valuable and guards against regressions to the various mechanisms that ensure robustness in the face of common failures (VMs disappearing, network partitions forming, etc...) Anywho -- take a look at the example if you have time. I'm not suggesting that it's ideal or perfect - just that Ginkgo does give you some flexibility here. |
(I'm on vacation and replies will be very delayed).
Thanks for the example. I've cloned it and will take a look when I can.
I don't think our approaches are all that far off. I look at "predicted
failure and recovery type of test" as another type of integration test.
Useful to ensure product works and to catch regressions. A category that
perhaps falls a bit above it, but not quite chaos-monkey, is what I call
"resiliency" test. I can induce failures at a random rate (though
influenced by what the test is doing), ensuring that the random factor may
expose other flaws. The hope is that this will help expose more of the edge
cases that may have been overlooked.
Anyway, again thanks for the example.
|
Allow tests written using Ginkgo's DSL to run with a different test runner.
A scenario that's being envisioned is to write end-to-end tests using Ginkgo, but to be able to reuse the same tests in a long-running or continual stress environment. The stress runner would do things like randomize test selections (with optional selection weights); run them repeatedly (and in parallel); and other monitoring. It's not envisioned that all tests could be run with a different runner, but it's something that could be enabled.
One way to achieve this would be to extend the current runner with a lot of other options, but it seems like a cleaner approach would be to set a different test runner run the Ginkgo tests. I think some of this could be done by having constructs that expose the "global***" vars in "ginkgo_dsl.go", and maybe add a few more abstractions/constructs.
The text was updated successfully, but these errors were encountered: