Setup CI to test against Postgres
Need to configure Circle CI to test not just MySQL but also Postgres (and possibly others)
https://circleci.com/docs/configuration#services
https://github.com/js-data/js-data-sql/commit/a10acf585d5515adb5e97c2613664521196e3c54 made the following changes:
- Allow specifying the database/knex client using
DB_CLIENTenv variable - Switch from a MySQL-specific .sql schema file to using knex migrations, and create
npm run migrate-dbscript - Setup
docker/docker-composeto 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:ubuntuwith 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)
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.
I was thinking CircleCi supported setting up a test matrix like Travis, but my first skim of the docs didn't turn anything up
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 [email protected] 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 https://github.com/js-data/js-data-sql/issues/59#issuecomment-174420251.
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).
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