etherpad-lite/bin/plugins/lib/backend-tests.yml
John McLear 0a76256075
Enable globstar in plugin backend-tests template (#7414)
* fix: re-apply retries: 0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Enable globstar in backend-tests template for recursive test discovery

Without shopt -s globstar, bash ** doesn't recurse into subdirectories,
causing mocha to miss test files in paths like specs/api/exportHTML.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:01:29 +01:00

72 lines
2.2 KiB
YAML

name: Backend Tests
# any branch is useful for testing before a PR is submitted
on:
workflow_call:
jobs:
withplugins:
# run on pushes to any branch
# run on PRs from external forks
if: |
(github.event_name != 'pull_request')
|| (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
name: with Plugins
runs-on: ubuntu-latest
steps:
-
name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
with:
packages: libreoffice libreoffice-pdfimport
version: 1.0
-
name: Install etherpad core
uses: actions/checkout@v4
with:
repository: ether/etherpad-lite
path: etherpad-lite
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 10
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
-
name: Checkout plugin repository
uses: actions/checkout@v4
with:
path: plugin
- name: Remove tests
working-directory: ./etherpad-lite
run: rm -rf ./src/tests/backend/specs
-
name: Install Etherpad core dependencies
working-directory: ./etherpad-lite
run: bin/installDeps.sh
- name: Install plugin
working-directory: ./etherpad-lite
run: |
pnpm run plugins i --path ../../plugin
-
name: Run the backend tests
working-directory: ./etherpad-lite/src
run: |
shopt -s globstar
res=$(find ./plugin_packages -path "*/static/tests/backend/specs/*" 2>/dev/null | wc -l)
if [ $res -eq 0 ]; then
echo "No backend tests found"
else
npx cross-env NODE_ENV=production mocha --import=tsx --timeout 120000 --recursive node_modules/ep_*/static/tests/backend/specs/**
fi