← Back to Upcase

Continuous Integration and Databases

(Anthony Lee) #1

Hi Upcase folks! :grinning:

I am posting this because I know Thoughtboters use CircleCI for their continuous integration. I googled and searched in stackoverflow/circleci documenation and had not luck.

My scenario:

All my tests are passing locally, but failing in CircleCI due to database configuration(?)

So this is what my workflow looks like:

heroku db:pull the database from Heroku Connect to my local developing machine, a service that syncs your Heroku Postgres with Salesforce Objects (Thrid party).

Prior to heroku db:pull, I already had a database with Rails migrations that consist of “customers”, “delayed_job”, “payments”, “users”. So it added a new schema in my local machine called “salesforce”.

When I run full rake, all my tests are passing in my local machine:

But CircleCI is failing:

From what I see, the error messages are there since there are no migration files that build “salesforce” schema in CircleCI(?). I don’t have migration files for salesforce tables, because it was a heroku db:pull. I needed to pull the synced data that was already done by Heroku Connect and Salesforce data, since I needed the Rails to work with those synced data.

This is the “salesforce” schema tables that were pulled from heroku in my local machine:

and here are my basic controller and model:

How can I configure CircleCI so “salesforce” schema gets build? or is there another way to make CircleCI pass? Some people suggested forking or following the database on Heroku side and configuring the circleci config file—but that is too expensive. Is there another way?

Any suggestions are welcomed. Thanks. :grinning: