Started rust impl #181
This file contains 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: "Proxy Test: 3 Pads <> 3 Unique 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: 3 Pads <> 3 Unique 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 | |
- name: Setup etherpads | |
run: docker compose up -d | |
- name: support 1 pad per instances | |
run: sed 's/5/1/g' settings.json.template > settings.json | |
- name: check settings | |
run: cat settings.json | |
- name: Start proxy | |
run: pnpm run start > proxyLog.txt & | |
- 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: Sleep for 5 seconds | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '5s' | |
- name: Load test >> test2 | |
run: etherpad-loadtest http://localhost:9000/p/test2 -d 60 & | |
- name: Sleep for 5 seconds | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '5s' | |
- name: Load test >> test3 | |
run: etherpad-loadtest http://localhost:9000/p/test3 -d 60 & | |
- name: Sleep for 30 seconds | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '30s' | |
- name: "Generate log files" | |
run: | | |
docker logs etherpad1 > test1/test1log.txt | |
docker logs etherpad2 > test2/test2log.txt | |
docker logs etherpad3 > test3/test3log.txt | |
- name: proxy log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: proxy | |
path: proxyLog.txt | |
- name: test1 log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: proxy | |
path: test1/test1log.txt | |
- name: test2 log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: proxy | |
path: test2/test2log.txt | |
- name: test3 log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: proxy | |
path: test3/test3log.txt | |
- name: Test1 DB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test1 | |
path: test1/dirty.db | |
- name: Test2 DB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test2 | |
path: test2/dirty.db | |
- name: Test3 DB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test3 | |
path: test3/dirty.db | |
- name: check test1 has just one pad. | |
run: test $(grep -oE '(test1|test2|test3)' test1/dirty.db | sort -u | wc -l) -eq 1 | |
- name: check test2 has just one pad. | |
run: test $(grep -oE '(test1|test2|test3)' test2/dirty.db | sort -u | wc -l) -eq 1 | |
- name: check test3 has just one pad. | |
run: test $(grep -oE '(test1|test2|test3)' test3/dirty.db | sort -u | wc -l) -eq 1 |