Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CI to test against Postgres #59

Open
techniq opened this issue Jan 22, 2016 · 6 comments
Open

Setup CI to test against Postgres #59

techniq opened this issue Jan 22, 2016 · 6 comments

Comments

@techniq
Copy link
Member

techniq commented Jan 22, 2016

Need to configure Circle CI to test not just MySQL but also Postgres (and possibly others)

https://circleci.com/docs/configuration#services

@techniq
Copy link
Member Author

techniq commented Jan 25, 2016

a10acf5 made the following changes:

  • Allow specifying the database/knex client using DB_CLIENT env variable
  • Switch from a MySQL-specific .sql schema file to using knex migrations, and create npm run migrate-db script
  • Setup docker/docker-compose to easily startup up database instances for testing
    • Updated README to document how environment is setup
    • Tried best to mimic the Circle CI environment, although the official docker MySQL image does not allow setting an empty password (MYSQL_PASSWORD) for a custom user (MYSQL_USER), only for root (MYSQL_ALLOW_EMPTY_PASSWORD=yes). Circle CI uses the user: ubuntu with no password, and the configuration uses this as the default, which requires overriding the user (DB_USER=root) when performing some commands/scripts locally against the docker containers
  • Fixed some tests that expected MySQL backtick escaping or were not escaping reserved Postgres tables/keywords (ex. user)

@techniq
Copy link
Member Author

techniq commented Jan 25, 2016

Still need to determine how best to configure Circle CI to run both MySQL and Postgres. Currently the MySQL tests are ran as part of npm run cover. Also need to determine how best to handle npm run test (related to CI, but also for local development for users submitting PRs.

@jmdobry
Copy link
Member

jmdobry commented Jan 25, 2016

I was thinking CircleCi supported setting up a test matrix like Travis, but my first skim of the docs didn't turn anything up

@techniq
Copy link
Member Author

techniq commented Jan 25, 2016

Yeah, I didn't see anything either. Found this hack/workaround -
https://github.com/michaelcontento/circleci-matrix

On Mon, Jan 25, 2016, 1:58 AM Jason Dobry notifications@github.com wrote:

I was thinking CircleCi supported setting up a test matrix like Travis,
but my first skim of the docs didn't turn anything up


Reply to this email directly or view it on GitHub
#59 (comment).

@techniq
Copy link
Member Author

techniq commented Jan 25, 2016

Would be nice to run against different versions of Node (0.10, 0.12, 4.x, 5.x) but not sure if it would be overkill to also run all the different databases against all major versions of node (take a while without parallelism).

@jmdobry
Copy link
Member

jmdobry commented Jan 25, 2016

I've got the "Free and Open Source" setting turned on for js-data-sql, which apparently means that it gets 3 additional containers for a total of 4. Perhaps with that the parallelism can be configured to run the tests against different databases, versions of Node.js, etc.

https://circleci.com/docs/parallel-manual-setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants