Skip to content

Commit 3890321

Browse files
committed
Merge branch 'master' into eric/msc2716-backfilling-history
Conflicts: dockerfiles/synapse/workers-shared.yaml internal/client/client.go tests/msc2403_test.go
2 parents 35c8f76 + ab4304a commit 3890321

21 files changed

+944
-265
lines changed

ONBOARDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Get a Federation client:
7878
// automatically maps localhost:12345 to the right container
7979
// automatically signs requests
8080
// srv == federation.Server
81-
fedClient := srv.FederationClient(deployment, "hs1")
81+
fedClient := srv.FederationClient(deployment)
8282
```
8383

8484
## FAQ

README.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ If you're looking to run against a custom Dockerfile, it must meet the following
6666

6767
To get started developing Complement tests, see [the onboarding documentation](ONBOARDING.md).
6868

69+
### Build tags
70+
71+
Complement uses build tags to include or exclude tests for each homeserver. Build tags are comments at the top of the file that look
72+
like:
73+
```go
74+
// +build msc2403
75+
```
76+
We have tags for MSCs (the above is in `msc2403_test.go`) as well as general blacklists for a homeserver implementation e.g Dendrite,
77+
which has the name `dendrite_blacklist`. These are implemented as inverted tags such that specifying the tag results in the file not
78+
being picked up by `go test`. For example, `apidoc_presence_test.go` has:
79+
```go
80+
// +build !dendrite_blacklist
81+
```
82+
and all Dendrite tests run with `-tags="dendrite_blacklist"` to cause this file to be skipped. You can run tests with build tags like this:
83+
```
84+
COMPLEMENT_BASE_IMAGE=complement-synapse:latest go test -v -tags="synapse_blacklist,msc2403" ./tests
85+
```
86+
This runs Complement with a Synapse HS and ignores tests which Synapse doesn't implement, and includes tests for MSC2403.
87+
6988
## Why 'Complement'?
7089

7190
Because **M**<sup>*C*</sup> = **1** - **M**
@@ -113,21 +132,26 @@ $ go run sytest_coverage.go -v
113132
10apidoc/01request-encoding 1/1 tests
114133
✓ POST rejects invalid utf-8 in JSON
115134
116-
10apidoc/02login 3/6 tests
135+
10apidoc/02login 6/6 tests
117136
✓ GET /login yields a set of flows
118137
✓ POST /login can log in as a user
119138
✓ POST /login returns the same device_id as that in the request
120-
× POST /login can log in as a user with just the local part of the id
121-
× POST /login as non-existing user is rejected
122-
× POST /login wrong password is rejected
139+
POST /login can log in as a user with just the local part of the id
140+
POST /login as non-existing user is rejected
141+
POST /login wrong password is rejected
123142
124143
10apidoc/03events-initial 0/2 tests
125-
10apidoc/04version 0/1 tests
144+
10apidoc/04version 1/1 tests
145+
✓ Version responds 200 OK with valid structure
146+
126147
10apidoc/10profile-displayname 0/2 tests
127148
10apidoc/11profile-avatar_url 0/2 tests
128149
10apidoc/12device_management 0/8 tests
129150
10apidoc/13ui-auth 0/4 tests
130-
10apidoc/20presence 0/2 tests
151+
10apidoc/20presence 2/2 tests
152+
✓ GET /presence/:user_id/status fetches initial status
153+
✓ PUT /presence/:user_id/status updates my presence
154+
131155
10apidoc/30room-create 0/10 tests
132156
10apidoc/31room-state 0/14 tests
133157
10apidoc/32room-alias 0/2 tests
@@ -143,8 +167,21 @@ $ go run sytest_coverage.go -v
143167
12login/01threepid-and-password 0/1 tests
144168
12login/02cas 0/3 tests
145169
13logout 0/4 tests
146-
14account/01change-password 0/7 tests
147-
14account/02deactivate 0/4 tests
170+
14account/01change-password 5/7 tests
171+
✓ After changing password, can't log in with old password
172+
✓ After changing password, can log in with new password
173+
✓ After changing password, existing session still works
174+
✓ After changing password, a different session no longer works by default
175+
✓ After changing password, different sessions can optionally be kept
176+
× Pushers created with a different access token are deleted on password change
177+
× Pushers created with a the same access token are not deleted on password change
178+
179+
14account/02deactivate 3/4 tests
180+
✓ Can deactivate account
181+
✓ Can't deactivate account with wrong password
182+
✓ After deactivating account, can't log in with password
183+
× After deactivating account, can't log in with an email
184+
148185
21presence-events 0/3 tests
149186
30rooms/01state 2/9 tests
150187
✓ Room creation reports m.room.create to myself
@@ -183,7 +220,10 @@ $ go run sytest_coverage.go -v
183220
30rooms/52members 0/3 tests
184221
30rooms/60version_upgrade 0/19 tests
185222
30rooms/70publicroomslist 0/5 tests
186-
31sync/01filter 0/2 tests
223+
31sync/01filter 2/2 tests
224+
✓ Can create filter
225+
✓ Can download filter
226+
187227
31sync/02sync 0/1 tests
188228
31sync/03joined 0/6 tests
189229
31sync/04timeline 0/8 tests
@@ -310,5 +350,5 @@ $ go run sytest_coverage.go -v
310350
90jira/SYN-516 0/1 tests
311351
90jira/SYN-627 0/1 tests
312352
313-
TOTAL: 15/690 tests converted
353+
TOTAL: 31/690 tests converted
314354
```

dockerfiles/SynapseWorkers.Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This dockerfile builds on top of Dockerfile-worker and includes a built-in postgres instance
22
# as well as sets up the homeserver so that it is ready for testing via Complement
3-
FROM matrixdotorg/synapse:workers
3+
FROM matrixdotorg/synapse-workers
44

55
# Download a caddy server to stand in front of nginx and terminate TLS using Complement's
66
# custom CA.
@@ -25,7 +25,7 @@ RUN pg_ctlcluster 11 main start && su postgres -c "echo \
2525
# and the disabling of rate-limiting
2626
COPY synapse/workers-shared.yaml /conf/workers/shared.yaml
2727

28-
WORKDIR /root
28+
WORKDIR /data
2929

3030
# Copy the caddy config
3131
COPY synapse/caddy.complement.json /root/caddy.json
@@ -46,8 +46,21 @@ ENTRYPOINT \
4646
SYNAPSE_REPORT_STATS=no \
4747
# Set postgres authentication details which will be placed in the homeserver config file
4848
POSTGRES_PASSWORD=somesecret POSTGRES_USER=postgres POSTGRES_HOST=localhost \
49-
# Use all available worker types
50-
SYNAPSE_WORKERS=* \
49+
# Specify the workers to test with
50+
SYNAPSE_WORKER_TYPES="\
51+
event_persister, \
52+
event_persister, \
53+
background_worker, \
54+
frontend_proxy, \
55+
event_creator, \
56+
user_dir, \
57+
media_repository, \
58+
federation_inbound, \
59+
federation_reader, \
60+
federation_sender, \
61+
synchrotron, \
62+
appservice, \
63+
pusher" \
5164
# Run the script that writes the necessary config files and starts supervisord, which in turn
5265
# starts everything else
5366
/configure_workers_and_start.py

dockerfiles/synapse/workers-shared.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ experimental_features:
6666
msc2403_enabled: true
6767
# Enable history backfilling support
6868
msc2716_enabled: true
69+
# Enable spaces support
70+
spaces_enabled: true

0 commit comments

Comments
 (0)