Skip to content

add test pipeline

add test pipeline #43

Workflow file for this run

name: Test
on:
push:
branches: [ main, improvement/** ]
pull_request:
branches: [ main ]
permissions:
contents: read
packages: write
jobs:
test-mongodb-backend:
name: Test with MongoDB backend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: TypeScript typecheck
run: yarn typecheck
- name: Lint
run: yarn lint
- name: Start Cloudserver with MongoDB backend
run: docker compose -f docker-compose.cloudserver-mongo.yml up -d
- name: Wait for Cloudserver to be ready
run: |
set -o pipefail
bash .github/workflows/wait_for_local_port.bash 8000 40
- name: Run indexes apis tests
run: yarn test tests/testIndexesApis.test.ts
- name: Run error handling tests
run: yarn test tests/testErrorHandling.test.ts
- name: Run multiple backend apis tests
run: yarn test tests/testMultipleBackendApis.test.ts
- name: Stop Cloudserver
if: always()
run: docker compose -f docker-compose.cloudserver-mongo.yml down
test-metadata-backend:
name: Test with Scality metadata backend
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Start Cloudserver with Scality metadata backend
run: docker compose -f docker-compose.cloudserver-metadata.yml up -d
- name: Wait for metadata to be ready
run: |
set -o pipefail
bash .github/workflows/wait_for_local_port.bash 9000 40
- name: Wait for Cloudserver to be ready
run: |
set -o pipefail
bash .github/workflows/wait_for_local_port.bash 8000 60
- name: Run general apis tests
run: yarn test tests/testApis.test.ts
- name: Run lifecycle apis tests
run: yarn test tests/testLifecycleApis.test.ts
- name: Run metadata apis tests
run: yarn test tests/testMetadataApis.test.ts
- name: Run raft apis tests
run: yarn test tests/testRaftApis.test.ts
- name: Stop Cloudserver
if: always()
run: docker compose -f docker-compose.cloudserver-metadata.yml down