-
-
Notifications
You must be signed in to change notification settings - Fork 3
173 lines (137 loc) · 4.71 KB
/
1maxPadPerInstance.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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
# 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/src && pnpm i
- name: start etherpad >> test1
run: cd test1 && pnpm run prod > test1log.txt &
- 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/src && pnpm i
- name: start etherpad >> test2
run: cd test2 && pnpm run prod > test2log.txt &
- 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/src && pnpm i
- name: start etherpad >> test3
run: cd test3 && pnpm run prod > test3log.txt &
- 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: node app.js > proxyLog.txt &
- name: Install etherpad-load-test
run: npm 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: 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/var/dirty.db
- name: Test2 DB
uses: actions/upload-artifact@v3
with:
name: test2
path: test2/var/dirty.db
- name: Test3 DB
uses: actions/upload-artifact@v3
with:
name: test3
path: test3/var/dirty.db
- name: check test1 has just one pad.
run: test $(grep -oE '(test1|test2|test3)' test1/var/dirty.db | sort -u | wc -l) -eq 1
- name: check test2 has just one pad.
run: test $(grep -oE '(test1|test2|test3)' test2/var/dirty.db | sort -u | wc -l) -eq 1
- name: check test3 has just one pad.
run: test $(grep -oE '(test1|test2|test3)' test3/var/dirty.db | sort -u | wc -l) -eq 1