No subject
Sun Mar 31 09:34:23 UTC 2013
as fast as it could be due to using sqlite as well.
I distinctly remember making the postgres tests start up faster but not
being able to due to the complication of having to support sqlite as well.
> But just in case that takes another 3 years before that is complete,
> may I suggest keeping sqlite in the meantime? ;-)
>
> Interesting idea about 'defaulting' developers to using a test mode
> that uses sqlite for some tests and postgres for others. Sounds like a
> can of worms though, judging by the existing debate on sqlite.
>
> David
>
>
> On 14 June 2013 15:15, Sean Hammond <sean.hammond at okfn.org> wrote:
> >> > Right, I'll often run the specific test modules that the code I'm
> >> working on affects frequently as I'm developing, but only run the whole
> >> test suite at the end before merging to master (if at all, Travis will
> >> often have run it for me).
> >>
> >> Great, you're finally addressing the situation that I'm talking about
> >> (I'm in agreement about not running the full tests - leave it to
> >> Travis).
> >>
> >> As per my example, postgres takes 12s versus sqlite 3s for running a
> >> couple of simple tests - the ones relevant to the code currently being
> >> written. As you add a couple of lines of code and add a new assert to
> >> the test in parallel with the feature, you'll find yourself running
> >> the relevant tests several times a minute. Waiting 12s for them to run
> >> each time and you simply break your flow.
> >
> > I'm not convinced about this. You're telling me that the unit tests for
> > one module takes 12s to run with postgres and 3s with sqlite? And this
> > isn't because either the tests or the ckan module is badly designed?
> >
> > Anyway, from my point of view, there should only be one way of running
> > the tests and it should be fast. As discussed introducing "run the tests
> > with postgres" and "run the same tests, but with sqlite" creates various
> > problems. I think the right way to do this might be to write more
> > testable code that's easier and faster to test in the first place, and
> > then write better and faster tests for it.
> >
> > For example, rather than either running all the tests with postgres and
> > then having a different command to run all the tests with sqlite
> > instead, a particular CKAN module that uses the database should accept a
> > database object as parameter, in normal operation it would be passed a
> > postgres database object but the tests could pass it an in-memory sqlite
> > database object instead.
> >
> > If we used this approach throughout then you would have just one command
> > "run the tests" and each test would use either a postgres database
> > (when really necessary) or a faster sqlite one whenever possible.
> > Hopefully the tests overall would be pretty fast, and running the tests
> > for most individual modules would be very fast and not touch the disk at
> > all. And no problem with having two separate ways of running the tests.
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
--089e01538800685a8304df23e80f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Fri, Jun 14, 2013 at 3:59 PM, David Read <span dir=3D"ltr"><<=
a href=3D"mailto:david.read at hackneyworkshop.com" target=3D"_blank">david.re=
ad at hackneyworkshop.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">The time taken on postgres is nothing to do =
with CKAN core or the<br>
specific tests. It is a result of postgres dropping dozens of tables<br>
and recreating them. I think when David did the current postgres test<br>
setup it was in haste and it is clear to anyone reading logging during<br>
tests that it could be improved somewhat. So please do improve it! :-)<br><=
/blockquote><div><br>I also did the current sqlite test setup if that is th=
e case and there was a lot of pain in doing it and is why I still want it r=
emoved.<br>
=A0<br></div><div>From what I remember there where compromises in making th=
e postgres setup as fast as it could be due to using sqlite as well.=A0 <br=
>I distinctly remember making the postgres tests start up faster but not be=
ing able to due to the complication of having to support sqlite as well.<br=
>
<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex">
<br>
But just in case that takes another 3 years before that is complete,<br>
may I suggest keeping sqlite in the meantime? ;-)<br>
<br>
Interesting idea about 'defaulting' developers to using a test mode=
<br>
that uses sqlite for some tests and postgres for others. Sounds like a<br>
can of worms though, judging by the existing debate on sqlite.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
David<br>
</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br>
<br>
On 14 June 2013 15:15, Sean Hammond <<a href=3D"mailto:sean.hammond at okfn=
.org">sean.hammond at okfn.org</a>> wrote:<br>
>> > Right, I'll often run the specific test modules that the =
code I'm<br>
>> working on affects frequently as I'm developing, but only run =
the whole<br>
>> test suite at the end before merging to master (if at all, Travis =
will<br>
>> often have run it for me).<br>
>><br>
>> Great, you're finally addressing the situation that I'm ta=
lking about<br>
>> (I'm in agreement about not running the full tests - leave it =
to<br>
>> Travis).<br>
>><br>
>> As per my example, postgres takes 12s versus sqlite 3s for running=
a<br>
>> couple of simple tests - the ones relevant to the code currently b=
eing<br>
>> written. As you add a couple of lines of code and add a new assert=
to<br>
>> the test in parallel with the feature, you'll find yourself ru=
nning<br>
>> the relevant tests several times a minute. Waiting 12s for them to=
run<br>
>> each time and you simply break your flow.<br>
><br>
> I'm not convinced about this. You're telling me that the unit =
tests for<br>
> one module takes 12s to run with postgres and 3s with sqlite? And this=
<br>
> isn't because either the tests or the ckan module is badly designe=
d?<br>
><br>
> Anyway, from my point of view, there should only be one way of running=
<br>
> the tests and it should be fast. As discussed introducing "run th=
e tests<br>
> with postgres" and "run the same tests, but with sqlite"=
; creates various<br>
> problems. I think the right way to do this might be to write more<br>
> testable code that's easier and faster to test in the first place,=
and<br>
> then write better and faster tests for it.<br>
><br>
> For example, rather than either running all the tests with postgres an=
d<br>
> then having a different command to run all the tests with sqlite<br>
> instead, a particular CKAN module that uses the database should accept=
a<br>
> database object as parameter, in normal operation it would be passed a=
<br>
> postgres database object but the tests could pass it an in-memory sqli=
te<br>
> database object instead.<br>
><br>
> If we used this approach throughout then you would have just one comma=
nd<br>
> "run the tests" and each test would use either a postgres da=
tabase<br>
> (when really necessary) or a faster sqlite one whenever possible.<br>
> Hopefully the tests overall would be pretty fast, and running the test=
s<br>
> for most individual modules would be very fast and not touch the disk =
at<br>
> all. And no problem with having two separate ways of running the tests=
.<br>
><br>
> _______________________________________________<br>
> ckan-dev mailing list<br>
> <a href=3D"mailto:ckan-dev at lists.okfn.org">ckan-dev at lists.okfn.org</a>=
<br>
> <a href=3D"http://lists.okfn.org/mailman/listinfo/ckan-dev" target=3D"=
_blank">http://lists.okfn.org/mailman/listinfo/ckan-dev</a><br>
> Unsubscribe: <a href=3D"http://lists.okfn.org/mailman/options/ckan-dev=
" target=3D"_blank">http://lists.okfn.org/mailman/options/ckan-dev</a><br>
<br>
_______________________________________________<br>
ckan-dev mailing list<br>
<a href=3D"mailto:ckan-dev at lists.okfn.org">ckan-dev at lists.okfn.org</a><br>
<a href=3D"http://lists.okfn.org/mailman/listinfo/ckan-dev" target=3D"_blan=
k">http://lists.okfn.org/mailman/listinfo/ckan-dev</a><br>
Unsubscribe: <a href=3D"http://lists.okfn.org/mailman/options/ckan-dev" tar=
get=3D"_blank">http://lists.okfn.org/mailman/options/ckan-dev</a><br>
</div></div></blockquote></div><br></div></div>
--089e01538800685a8304df23e80f--
More information about the ckan-dev
mailing list