Skip to content

Commit

Permalink
add cockroach test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 28, 2024
1 parent d507a13 commit b4245d6
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 171 deletions.
170 changes: 0 additions & 170 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,90 +62,6 @@ jobs:
paths:
- ./node_modules
- <<: *save
test-pg-9:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:9.6-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-pg-10:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:10.19-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-pg-11:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:11.14-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-pg-12:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:12.9-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-pg-13:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:13.5-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-pg-14:
docker:
- <<: *node-image
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:14.1-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-cockroach-1:
docker:
- <<: *node-image
Expand Down Expand Up @@ -211,62 +127,6 @@ 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-node-12:
docker:
- image: circleci/node:12.20.0
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:14.1-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-node-14:
docker:
- image: circleci/node:14
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:14.1-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-node-16:
docker:
- image: circleci/node:16
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:14.1-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-node-17:
docker:
- image: circleci/node:17
environment:
- DATABASE_URL=postgres://ubuntu:ubuntu@localhost:5432/circle_test
- image: postgres:13.5-alpine
environment:
- POSTGRES_USER=ubuntu
- POSTGRES_PASSWORD=ubuntu
- POSTGRES_DB=circle_test
steps:
- <<: *restore
- <<: *postgres-wait
- <<: *test-postgres
test-config:
docker:
- <<: *node-image
Expand Down Expand Up @@ -513,24 +373,6 @@ workflows:
main_workflow:
jobs:
- install
- test-pg-9:
requires:
- install
- test-pg-10:
requires:
- install
- test-pg-11:
requires:
- install
- test-pg-12:
requires:
- install
- test-pg-13:
requires:
- install
- test-pg-14:
requires:
- install
- test-cockroach-1:
requires:
- install
Expand All @@ -546,18 +388,6 @@ workflows:
- test-cockroach-21:
requires:
- install
- test-node-12:
requires:
- install
- test-node-14:
requires:
- install
- test-node-16:
requires:
- install
- test-node-17:
requires:
- install
- test-config:
requires:
- install
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/cockroach-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Cockroach Test

on:
push:
branches:
- main
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [20]
cockroach_version: [19.2.12]
fail-fast: false
timeout-minutes: 10

services:
cockroach:
image: cockroachdb/cockroach:v${{ matrix.cockroach_version }}
env:
DATABASE_URL: postgresql://root@localhost:26257/integration_test
# Set health checks to wait until cockroach has started
options: >-
start
--insecure
--host=localhost
ports:
# Maps tcp port 26257 on service container to the host
- 26257:26257

name: 'Cockroach Test: cockroach-${{ matrix.cockroach_version }}, node-${{ matrix.node_version }}, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Required for docs/versions tests
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node_version }}
cache: 'pnpm'

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Integration Test
run: pnpm run migrate up -m test/cockroach --no-lock && pnpm run migrate down 0 -m test/cockroach --no-lock --timestamps
env:
DATABASE_URL: postgresql://root@localhost:26257/integration_test
2 changes: 1 addition & 1 deletion .github/workflows/postgres-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [20]
node_version: [18, 20]
postgres_version: [9.6, 10.23, 11.22, 12.18, 13.14, 14.11]
fail-fast: false
timeout-minutes: 10
Expand Down

0 comments on commit b4245d6

Please sign in to comment.