News for hackers. Stuff that matters.
Re:Postgression - A PostgreSQL database for every test case by Titanous on Monday January 21, 2013 @07:21PM (#5094649)
I'm not convinced that the cumulative latency this would introduce into test runs is lower than the amount of time required to use brew or apt-get to install Postgres.
Re:Postgression - A PostgreSQL database for every test case by rdegges on Monday January 21, 2013 @08:50PM (#5095028)
Hi Titanous, you're definitely right--the focus of postgression isn't speed, just convenience.

Installing a database server locally to run unit tests is something that has always annoyed me. 99.99% of the time when I'm testing things, I'm at a computer, hooked up to the internet, working on things--and I'm usually not all that concerned about an extra second of overhead.

I think the real benefit to this is that you can use the same DB harness regardless of where you're testing: locally, Jenkins, Travis-CI, whatever. This way, you don't have to write any code to make databases, check credentials, whatever, it's just a thoughtless process.

Re:Postgression - A PostgreSQL database for every test case by Titanous on Monday January 21, 2013 @08:58PM (#5095058)
I understand the premise, but this isn't performant enough to be used for anything but the smallest of projects. It isn't just "an extra second of overhead", it increased a 15 second test run to 15 minutes for me (on a fast fiber connection).

Locally I already have Postgres installed for development, and Travis does as well. I guess this might be useful for Jenkins on EC2 in the same AZ as Heroku Postgres, but the latency is still going to be painful.

Re:Postgression - A PostgreSQL database for every test case by nirvdrum on Monday January 21, 2013 @11:01PM (#5095436)
Sorry, I'm trying to wrap my head around the workflow. Do you use vagrant or something for tests? Othrewise, wouldn't you need the DB installed locally to run your site locally?
Re:Postgression - A PostgreSQL database for every test case by rdegges on Tuesday January 22, 2013 @03:00AM (#5096096)
I always use a remote db for developing my site locally (eg: Heroku PostgreSQL). On my laptop I typically install my libraries (in a Python virtualenv), and do coding.
Re:Postgression - A PostgreSQL database for every test case by willlll on Monday January 21, 2013 @07:24PM (#5094659)
Have you benchmarked it?
Re:Postgression - A PostgreSQL database for every test case by Titanous on Monday January 21, 2013 @08:18PM (#5094914)

    tentd git:(master) $ time bundle exec rake
    #...
    Finished in 14.6 seconds
    818 examples, 0 failures

    real	19.10s
    user	11.59s
    sys 	1.22s
 
    tentd git:(master) $ time bundle exec rake TEST_DATABASE_URL=$(curl http://api.postgression.com)
    #...
    Finished in 15 minutes 0.49244 seconds
    818 examples, 0 failures

    real	905.67s
    user	23.37s
    sys 	3.12s

    $ time brew install postgresql
    ==> Downloading http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.bz2
    ######################################################################## 100.0%
    #...
    ==> Summary
    🍺  /usr/local/Cellar/postgresql/9.2.2: 2819 files, 39M, built in 3.2 minutes

    real	190.33s
    user	338.87s
    sys 	60.70s
Re:Postgression - A PostgreSQL database for every test case by asparagui on Monday January 21, 2013 @08:08PM (#5094867)
🍺 /usr/local/Cellar/postgresql/9.2.2: 2819 files, 39M, built in 4.5 minutes