Skip to content

Use options

Use options #177

name: "Proxy Test: 9 Pads <> 3 Backends"
# any branch is useful for testing before a PR is submitted
on: [push, pull_request]
jobs:
deployAndLoadTest:
# 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: 9 Pads <> 3 Backends
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.0.4
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: install dependencies
run: pnpm i
# install and run etherpad on ports 9001, 9002 and 9003
- name: Git clone etherpad to test1
uses: actions/checkout@v3
with:
repository: ether/etherpad-lite
path: test1
- name: prep etherpad >> test1
run: cd test1 && pnpm i
- name: Copy settings json for Dirty db to be active
run: cp test1/settings.json.template test1/settings.json
- name: start etherpad >> test1
run: cd test1 && pnpm run prod &
- name: Git clone etherpad to test2
uses: actions/checkout@v3
with:
repository: ether/etherpad-lite
path: test2
- name: Change port to 9002
# "port" : 9001 >> "port" :9002
run: sed 's/9001/9002/g' test2/settings.json.template > test2/settings.json
- name: prep etherpad >> test2
run: cd test2 && pnpm i
- name: start etherpad >> test2
run: cd test2 && pnpm run prod &
- name: Git clone etherpad to test3
uses: actions/checkout@v3
with:
repository: ether/etherpad-lite
path: test3
- name: Change port to 9003
# "port" : 9001 >> "port" :9002
run: sed 's/9001/9003/g' test2/settings.json.template > test3/settings.json
- name: prep etherpad >> test3
run: cd test3 && pnpm i
- name: start etherpad >> test3
run: cd test3 && pnpm run prod &
- name: support 3 pads per instances
run: sed 's/5/3/g' settings.json.template > settings.json
- name: Start proxy
run: pnpm run start &
- name: Install etherpad-load-test
run: pnpm install etherpad-load-test -g
- name: wait for Etherpad
run: curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9003/p/test
- name: Load test >> test1
run: etherpad-loadtest http://localhost:9000/p/test1 -d 60 &
- name: Load test >> test2
run: etherpad-loadtest http://localhost:9000/p/test2 -d 60 &
- name: Load test >> test3
run: etherpad-loadtest http://localhost:9000/p/test3 -d 60 &
- name: Sleep for 5 seconds
uses: jakejarvis/wait-action@master
with:
time: '5s'
- name: Load test >> test4
run: etherpad-loadtest http://localhost:9000/p/test4 -d 60 &
- name: Load test >> test5
run: etherpad-loadtest http://localhost:9000/p/test5 -d 60 &
- name: Load test >> test6
run: etherpad-loadtest http://localhost:9000/p/test6 -d 60 &
- name: Sleep for 5 seconds
uses: jakejarvis/wait-action@master
with:
time: '5s'
- name: Load test >> test7
run: etherpad-loadtest http://localhost:9000/p/test7 -d 60 &
- name: Load test >> test8
run: etherpad-loadtest http://localhost:9000/p/test8 -d 60 &
- name: Load test >> test9
run: etherpad-loadtest http://localhost:9000/p/test9 -d 60 &
- name: Sleep for 30 seconds
uses: jakejarvis/wait-action@master
with:
time: '30s'
## TODO: Tests for this..