@@ -3,8 +3,34 @@ name: "Proxy Test: 3 Pads <> 3 Unique Backends"
3
3
# any branch is useful for testing before a PR is submitted
4
4
on : [push, pull_request]
5
5
6
+
6
7
jobs :
7
8
deployAndLoadTest :
9
+ services :
10
+ etherpad1 :
11
+ container_name : etherpad1
12
+ image : etherpad/etherpad
13
+ ports :
14
+ - 9001:9001
15
+ volumes :
16
+ - " ./support/settings.json:/opt/etherpad-lite/settings.json"
17
+ - " ./test1:/opt/etherpad-lite/var"
18
+ etherpad2 :
19
+ image : etherpad/etherpad
20
+ container_name : etherpad2
21
+ ports :
22
+ - 9002:9001
23
+ volumes :
24
+ - " ./support/settings.json:/opt/etherpad-lite/settings.json"
25
+ - " ./test2:/opt/etherpad-lite/var"
26
+ etherpad3 :
27
+ container_name : etherpad3
28
+ image : etherpad/etherpad
29
+ ports :
30
+ - 9003:9001
31
+ volumes :
32
+ - " ./support/settings.json:/opt/etherpad-lite/settings.json"
33
+ - " ./test3:/opt/etherpad-lite/var"
8
34
# run on pushes to any branch
9
35
# run on PRs from external forks
10
36
if : |
37
63
- name : install dependencies
38
64
run : pnpm i
39
65
40
- # install and run etherpad on ports 9001, 9002 and 9003
41
- - name : Git clone etherpad to test1
42
- uses : actions/checkout@v3
43
- with :
44
- repository : ether/etherpad-lite
45
- path : test1
46
-
47
- - name : prep etherpad >> test1
48
- run : cd test1 && pnpm i
49
- - name : Copy settings json for Dirty db to be active
50
- run : cp test1/settings.json.template test1/settings.json
51
-
52
- - name : start etherpad >> test1
53
- run : cd test1 && pnpm run prod > test1log.txt &
54
-
55
- - name : Git clone etherpad to test2
56
- uses : actions/checkout@v3
57
- with :
58
- repository : ether/etherpad-lite
59
- path : test2
60
-
61
- - name : Change port to 9002
62
- # "port" : 9001 >> "port" :9002
63
- run : sed 's/9001/9002/g' test2/settings.json.template > test2/settings.json
64
-
65
- - name : prep etherpad >> test2
66
- run : cd test2/src && pnpm i
67
-
68
- - name : start etherpad >> test2
69
- run : cd test2 && pnpm run prod > test2log.txt &
70
-
71
- - name : Git clone etherpad to test3
72
- uses : actions/checkout@v3
73
- with :
74
- repository : ether/etherpad-lite
75
- path : test3
76
-
77
- - name : Change port to 9003
78
- # "port" : 9001 >> "port" :9002
79
- run : sed 's/9001/9003/g' test2/settings.json.template > test3/settings.json
80
-
81
- - name : prep etherpad >> test3
82
- run : cd test3/src && pnpm i
83
-
84
- - name : start etherpad >> test3
85
- run : cd test3 && pnpm run prod > test3log.txt &
86
-
87
66
- name : support 1 pad per instances
88
67
run : sed 's/5/1/g' settings.json.template > settings.json
89
68
@@ -122,7 +101,11 @@ jobs:
122
101
uses : jakejarvis/wait-action@master
123
102
with :
124
103
time : ' 30s'
125
-
104
+ - name : " Generate log files"
105
+ run : |
106
+ docker logs etherpad1 > test1/test1log.txt
107
+ docker logs etherpad2 > test2/test2log.txt
108
+ docker logs etherpad3 > test3/test3log.txt
126
109
- name : proxy log
127
110
uses : actions/upload-artifact@v3
128
111
with :
@@ -151,25 +134,25 @@ jobs:
151
134
uses : actions/upload-artifact@v3
152
135
with :
153
136
name : test1
154
- path : test1/var/ dirty.db
137
+ path : test1/dirty.db
155
138
156
139
- name : Test2 DB
157
140
uses : actions/upload-artifact@v3
158
141
with :
159
142
name : test2
160
- path : test2/var/ dirty.db
143
+ path : test2/dirty.db
161
144
162
145
- name : Test3 DB
163
146
uses : actions/upload-artifact@v3
164
147
with :
165
148
name : test3
166
- path : test3/var/ dirty.db
149
+ path : test3/dirty.db
167
150
168
151
- name : check test1 has just one pad.
169
- run : test $(grep -oE '(test1|test2|test3)' test1/var/ dirty.db | sort -u | wc -l) -eq 1
152
+ run : test $(grep -oE '(test1|test2|test3)' test1/dirty.db | sort -u | wc -l) -eq 1
170
153
171
154
- name : check test2 has just one pad.
172
- run : test $(grep -oE '(test1|test2|test3)' test2/var/ dirty.db | sort -u | wc -l) -eq 1
155
+ run : test $(grep -oE '(test1|test2|test3)' test2/dirty.db | sort -u | wc -l) -eq 1
173
156
174
157
- name : check test3 has just one pad.
175
- run : test $(grep -oE '(test1|test2|test3)' test3/var/ dirty.db | sort -u | wc -l) -eq 1
158
+ run : test $(grep -oE '(test1|test2|test3)' test3/dirty.db | sort -u | wc -l) -eq 1
0 commit comments