Postgression - A PostgreSQL database for every test case
postgression.com
postgression.com
http://rdegges.com/postgression-a-postgresql-database-for-ev...
So I'm really curious how that slogan is meant to be understood.
(I don't typically run postgres locally, but work on open source software, both projects of my own as well as projects of other peoples I contribute to -- which need to support postgres for others. This has been a pain in the past for me. Your service is quite exactly what I need -- to be able to run automated test suites against postgres without needing a local install of postgres.)
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.70sInstalling 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.
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.
I can't see other's query activity, but I can see some of the pg_catalog tables.
For instance
select count(*) from pg_stat_database;
count
-------
1900
(1 row)Here is a sample response when attempting to do anything with a database other than your own:
FATAL: permission denied for database "xxxxxxxxxxxx" DETAIL: User does not have CONNECT privilege. Previous connection kept
At the moment, our integration test run takes nearly two hours but this is rolling out the schema and the sheer number of test cases (we have over 1 million lines of test cases). Something that speeds it up would be welcome but this is not for us.
In regards to the schema stuff, however, we don't touch any user data at all. I've actually added a section to the bottom of our website: http://www.postgression.com/ which explicitly states our policy:
"In regards to security: postgression does not look at, log, or use any data stored by our users. All data is completely ephemeral, and disappears after 30 minutes."
We built this to combat the pain of testing in multiple locations. Sure, it adds an extra second to the start of each test run, and sure, you have to talk to a public database server, but the benefits you get are:
- No database server needs to be running on your local machine, vagrant, jenkins instance, or travis CI instance. This means one test configuration and you can run the tests anywhere.
- No need to write scaffolding code to make testing work with vagrant, jenkins, etc., again--things just work.
It's certainly not suitable for everyone, but it fits my personal use case well, which is why I decided to build it ^^
This is really meant so that you don't need to run PostgreSQL at all locally. It adds a small bit of overhead, but makes it much easier to run tests locally, on a remote server (Jenkins, Travis CI, etc.), and doesn't require any scaffolding code to create a db, etc. It just works :)