Search code examples
herokucontinuous-integrationheroku-postgres

How can I automatically import a dump from an app in Heroku CI's in-dyno postgres instance?


I am using Heroku CI with an in-dyno postgres instance. When the test dyno starts up I would like to fill the in-dyno postgres with the data of one of my running Heroku apps. How can I do this in the nicest way?


Solution

  • You would have a test-setup script that then restores a production-backup into your local postgres instance. We are doing this for some test-environments or database load-tests.

    But in general there is to say this not a good idea. Your tests should setup their own test-data (setup/teardown scripts for fixtures). Otherwise you'll quickly run at least into performance issues.