@@ -66,6 +66,25 @@ If you're looking to run against a custom Dockerfile, it must meet the following
6666
6767To 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
7190Because ** M** <sup >* C* </sup > = ** 1** - ** M**
@@ -113,21 +132,26 @@ $ go run sytest_coverage.go -v
11313210apidoc/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
12414310apidoc/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+
12614710apidoc/10profile-displayname 0/2 tests
12714810apidoc/11profile-avatar_url 0/2 tests
12814910apidoc/12device_management 0/8 tests
12915010apidoc/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+
13115510apidoc/30room-create 0/10 tests
13215610apidoc/31room-state 0/14 tests
13315710apidoc/32room-alias 0/2 tests
@@ -143,8 +167,21 @@ $ go run sytest_coverage.go -v
14316712login/01threepid-and-password 0/1 tests
14416812login/02cas 0/3 tests
14516913logout 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+
14818521presence-events 0/3 tests
14918630rooms/01state 2/9 tests
150187 ✓ Room creation reports m.room.create to myself
@@ -183,7 +220,10 @@ $ go run sytest_coverage.go -v
18322030rooms/52members 0/3 tests
18422130rooms/60version_upgrade 0/19 tests
18522230rooms/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+
18722731sync/02sync 0/1 tests
18822831sync/03joined 0/6 tests
18922931sync/04timeline 0/8 tests
@@ -310,5 +350,5 @@ $ go run sytest_coverage.go -v
31035090jira/SYN-516 0/1 tests
31135190jira/SYN-627 0/1 tests
312352
313- TOTAL: 15 /690 tests converted
353+ TOTAL: 31 /690 tests converted
314354```
0 commit comments