Skip to content

Setup CI to test against Postgres #59

Open

Description

@techniq

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

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

Activity

  1. techniq commented on Jan 25, 2016

    @techniq
    MemberAuthor

    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)
  2. techniq commented on Jan 25, 2016

    @techniq
    MemberAuthor

    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.

  3. jmdobry commented on Jan 25, 2016

    @jmdobry
    Member

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

  4. techniq commented on Jan 25, 2016

    @techniq
    MemberAuthor

    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).

  5. techniq commented on Jan 25, 2016

    @techniq
    MemberAuthor

    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).

  6. jmdobry commented on Jan 25, 2016

    @jmdobry
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions