Skip to content

Merge pull request #2212 from therealrinku/fix/disabled-filter-state #2150

Merge pull request #2212 from therealrinku/fix/disabled-filter-state

Merge pull request #2212 from therealrinku/fix/disabled-filter-state #2150

Workflow file for this run

name: Studio - Unit Tests
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
- master
paths-ignore:
- apps/sqltools/**
pull_request:
paths-ignore:
- apps/sqltools/**
jobs:
setup:
runs-on: ubuntu-latest
outputs:
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
steps:
- name: 'Setup jq'
uses: dcarbone/install-jq-action@v2
with:
version: "1.7"
force: true
- uses: actions/checkout@v2
- id: set-test-chunks
name: Set Chunks
run: echo "::set-output name=test-chunks::$(./bin/get-db-files-as-json.sh)"
unit:
name: Non-terrible tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
- name: Lint
run: yarn workspace beekeeper-studio run lint
- name: Check for bad files
run: bin/check-for-only-tests.sh
- name: Unit Tests
run: yarn workspace beekeeper-studio run test:unit --ci --silent
- name: Non-DB Integration Tests
run: yarn workspace beekeeper-studio run test:ci --ci --silent
integration:
name: 🥞 ${{ matrix.chunk[0] }}
runs-on: ubuntu-latest
needs:
- setup
strategy:
fail-fast: false
matrix:
chunk: ${{ fromJson(needs.setup.outputs['test-chunks']) }}
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- name: yarn install (with retry)
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 3
command: "yarn install --frozen-lockfile --network-timeout 100000"
env:
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
- name: Test
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 3
command: yarn workspace beekeeper-studio run test:integration --runInBand --ci --silent ${{ matrix.chunk[1] }}
env:
TESTCONTAINERS_RYUK_DISABLED: true
e2e:
name: E2E tests
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
- name: E2E Tests
run: yarn workspace beekeeper-studio run test:e2e
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-results
path: apps/studio/test-results
retention-days: 30