Skip to content

Commit

Permalink
Adding more cockroach versions to tests (#719)
Browse files Browse the repository at this point in the history
* Adding more cockroach versions to tests

* Do not recreate constraint on down migration

* Run cockroach 20 in sigle node mode
  • Loading branch information
dolezel committed Nov 23, 2020
1 parent bc47f81 commit ff61e4e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,32 @@ jobs:
- run:
name: test
command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps
test-cockroach-19:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgresql://root@localhost:26257/circle_test
- image: cockroachdb/cockroach:v19.2.11
command: ['start', '--insecure', '--host=localhost']
steps:
- <<: *restore
- <<: *cockroach-wait
- run:
name: test
command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps
test-cockroach-20:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgresql://root@localhost:26257/circle_test
- image: cockroachdb/cockroach:v20.2.1
command: ['start-single-node', '--insecure', '--host=localhost']
steps:
- <<: *restore
- <<: *cockroach-wait
- run:
name: test
command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps
test-node-10:
docker:
- image: circleci/node:10
Expand Down Expand Up @@ -454,6 +480,12 @@ workflows:
- test-cockroach-2:
requires:
- install
- test-cockroach-19:
requires:
- install
- test-cockroach-20:
requires:
- install
- test-node-10:
requires:
- install
Expand Down
4 changes: 4 additions & 0 deletions test/cockroach/014_add_constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ exports.up = (pgm) => {
check: 'id < 30',
})
}

exports.down = () => {
// do nothing
}
6 changes: 2 additions & 4 deletions test/cockroach/017_drop_constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ exports.up = (pgm) => {
pgm.dropConstraint('t1', constraint.constraint)
}

exports.down = (pgm) => {
pgm.addConstraint('t1', constraint.constraint, {
check: 'true',
})
exports.down = () => {
// do nothing
}

0 comments on commit ff61e4e

Please sign in to comment.