Plugin System 1.0 Docs #4741
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-24.04 | |
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-24.04 | |
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: Check for license-breaking includes | |
run: bin/check-for-src-commercial.sh | |
- name: Check for bad log imports | |
run: bin/check-for-electron-log-imports.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 | |
- name: Unit Tests (UI Kit) | |
run: yarn workspace @beekeeperstudio/ui-kit run test --silent | |
integration: | |
name: 🥞 ${{ matrix.chunk[0] }} | |
runs-on: ubuntu-24.04 | |
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: Install libaio (for oracle) | |
run: sudo apt install libaio-dev | |
- name: Symlink libaio v1 (for oracle) | |
run: sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 | |
- 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: 2 | |
on_retry_command: "docker ps -aq | xargs docker stop | xargs docker rm" | |
command: yarn workspace beekeeper-studio run test:integration --runInBand --ci ${{ matrix.chunk[1] }} | |
env: | |
TESTCONTAINERS_RYUK_DISABLED: true | |
# codemirror: | |
# name: CodeMirror 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: Test | |
# uses: nick-fields/retry@v2 | |
# with: | |
# timeout_minutes: 20 | |
# max_attempts: 2 | |
# on_retry_command: "docker ps -aq | xargs docker stop | xargs docker rm" | |
# command: yarn workspace beekeeper-studio run test:codemirror --runInBand --ci | |
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: Start postgres container | |
run: docker compose up psql15 -d | |
- name: Serve + Run Tests | |
run: | | |
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" bash -c ' | |
yarn run electron:serve > server.log 2>&1 & | |
sleep 15 | |
cat server.log # (Optional: see if it launched correctly) | |
yarn workspace beekeeper-studio test:e2e:ci | |
' | |
env: | |
ELECTRON_ENABLE_LOGGING: 1 | |
ELECTRON_DISABLE_SANDBOX: 1 | |
ELECTRON_EXTRA_LAUNCH_ARGS: "--disable-gpu" | |
# - name: Run E2E Tests | |
# run: yarn test:e2e:ci | |
# continue-on-error: true | |
- name: Upload test results | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: apps/studio/test-results | |
retention-days: 30 |