-
Notifications
You must be signed in to change notification settings - Fork 129
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
Allow running of facts in parallel #108
Comments
Midje's emphasis on treating facts as forms to be evaluated immediately would seem to make this harder. I could imagine something like having each fact be a future, though that pushes off a lot of work onto the runtime. The old XPer in me is inclined to say something like "if running your unit tests is taking too long, the solution is not to parallelize: it's to find out why you can't get reasonable assurance that your last small change didn't break something without requiring heroic efforts to run every last check you ever wrote." |
More on previous: the point of tests is to have intellectual control over what you're doing. My (and I'm not alone!) style is to aim for a sequence of small changes to code. What does it say about things like coupling or test coverage if a single small change to the code could break something that'd only be detected by running a large test suit? Yes, it's wise to run all the tests every so often. But if you're dependent on running so many so often (or if each one is so slow you can't run many), you're doing it wrong. |
In general I agree. I might lean a little further in the direction of "if If we ever snag some more contributors maybe this could make sense to do, On Fri, Feb 24, 2012 at 6:53 PM, Brian Marick <
|
IMO, facts should be functions. Several reasons
Tags is an important feature for me. The best way to test code is not always with a unit test. Some tests are better expressed as integration tests, or selenium tests, or require interacting with 3rd party services. All of these take time, and can't be unit tested. As to 3) I have emacs midje mode, and use it constantly, but having (run-tests 'my-ns) would still improve my REPL experience. I understand I can do (require 'my-ns :reload), but that's less pleasant. As for running the whole test suite, I'm human. Sometimes even when I am making a series of localized changes, it can still have effects on tests in other namespaces that I should have remembered to run, but didn't. The existing user semantics don't need to be changed to allow this. Have the current fact macro expand to something like: (fact ...) => (let [f (fn [] (existing-fact-expansion))]
(def fn-name f)
(when *should-run-facts*
(f)) The def is important, because then I can attach metadata to the fact, and write a test runner that says "Go run all selenium tests", or "don't run the tests that cost money to run". |
On Feb 24, 2012, at 9:04 PM, Allen Rohner wrote:
Where does the Brian Marick, Artisanal Labrador |
We can generate a name from the fact description. Strip out all characters that aren't legal in a var name, and then add gensym. (fact "here is a simple test") => (gensym "here-is-a-simple-test") => here-is-a-simple-test371 |
gen-sym? Perhaps all we really need is the metadata (aka tags) on the fn, so having a gen-sym'd name could work. |
On Feb 25, 2012, at 4:10 PM, Allen Rohner wrote:
Oh, I get it: you don't want the var for human use, but only so there's some handle upon which to hang metadata. There's already namespace-specific (and also global I think) Midje-specific state. Maybe there should be some sort of registry that tools could query. Brian Marick, Artisanal Labrador |
This won't happen without someone stepping forward to do major work. |
I haven't spent time thinking about how to do this. However, it would be a nice feature for teams with lots of unit tests.
@marick (when you have time - no rush) would you mind listing the hurdles to achieving this that are in the current implementation of the reporting?
The text was updated successfully, but these errors were encountered: