Skip to content

Fix to use mongo client if MongoDB verison is less than or equal to 4. #216

Fix to use mongo client if MongoDB verison is less than or equal to 4.

Fix to use mongo client if MongoDB verison is less than or equal to 4. #216

name: Replica Set Tests
on: [push, pull_request]
jobs:
single-node-replica-set-on-default-port:
name: MongoDB v${{ matrix.mongodb-version }} RS — Node.js v${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-version: ['4.4', '5.0', '6.0']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: mongodb-test-rs
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test ./test/replica-set
env:
CI: true
MONGODB_REPLICA_SET: mongodb-test-rs
single-node-replica-set-on-custom-port:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
mongodb-port: [23456]
mongodb-version: ['4.4', '5.0', '6.0']
name: MongoDB v${{ matrix.mongodb-version }} RS, Port ${{ matrix.mongodb-port }} — Node.js v${{ matrix.node-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start MongoDB Server v${{ matrix.mongodb-version }}
uses: ./
with:
mongodb-port: ${{ matrix.mongodb-port }}
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: mongodb-test-rs
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test ./test/replica-set
env:
CI: true
MONGODB_PORT: ${{ matrix.mongodb-port }}
MONGODB_REPLICA_SET: mongodb-test-rs