Great points David. Your post makes this hack seems way less fun, and
yet, way more productive.

About automigrate: Yes. We still use in memory databases for 140 of
the tests (more than 90%). I'll refrain from speculating how much less
time it would take without testing. The test setup gets a bit more
compicated and that would really need to pay off to make it.

About the ramdisk: we don't touch files anywhere else, as good unit
tests do. But, the trick should really go a mile for NOSQL databases,
should
we need them (don't spect to be soon, but we rely on data, not
expectations).


Regards,
[]
On Sep 20, 12:37 am, David Masover <[email protected]> wrote:
> On Sunday, September 19, 2010 08:52:18 pm Daniel Ribeiro wrote:
>
> > Yes, this is the ultimate hack. It is quite fragile, and setup
> > intensive, as all team members must have a ramdisk enabled, and have
> > the same path.
>
> While true, it's also not as bad as you'd think. If you're running a modern
> Linux, it's as simple as:
>
> sudo mount tmpfs /wherever/i/want/a/ramdisk
>
> ...and done! You could easily put that in a script.
>
> I have a tmpfs mounted somewhere convenient all the time, because I find it
> generally useful.
>
> > Or, what is worse, configurable ones (breaking our
> > "don't make me think" test rule).
>
> Symlinks.
>
> > Hacking sequel seems a lot less
> > work.
>
> The above was a one-liner.
>
> Now, if you're on Windows or OS X, I don't know how you'd do that. It also may
> violate other rules, like "Don't make me run things as root". I just don't see
> it being harder than hacking sequel, certainly not if you're on a Linux.
>
> > And it might pay off, as truncating all databases is far more
> > performatic than automigrate! (for clearing up tests).
>
> Have you run automigrate on anything not disk-backed?
>
> By all means, don't let me stop you from doing this a cleaner way, if you can.
> I just like the one-liner, dirt-simple, generic solution.

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to