You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ONBOARDING.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,10 +185,6 @@ To conditionally skip an entire *file* based on the homeserver being run, add a
185
185
```go
186
186
// +build !dendrite_blacklist
187
187
```
188
-
You can also do this based on features for MSC tests (which means you must run Complement *with* this tag for these tests *to run*):
189
-
```go
190
-
// +build msc_2836
191
-
```
192
188
See [GH Actions](https://github.com/matrix-org/complement/blob/master/.github/workflows/ci.yaml) for an example of how this is used for different homeservers in practice.
193
189
194
190
### Why do we use `t.Errorf` sometimes and `t.Fatalf` other times?
@@ -210,11 +206,11 @@ For Goland:
210
206
* Under "Run"->"Edit Configurations..."->"Edit Configuration Templates..."->"Go Test", and add `COMPLEMENT_BASE_IMAGE=complement-dendrite:latest` to "Environment"
211
207
* Then you can right-click on any test file or test case and "Run <testname>".
212
208
213
-
209
+
214
210
### How do I make the linter checks pass?
215
211
216
212
Use [`goimports`](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) to sort imports and format in the style of `gofmt`.
// It is not supported to call ServerName() before Listen() because Listen() modifies the server name.
143
144
// Listen() will select a random OS-provided high-numbered port to listen on, which then needs to be
144
145
// retrofitted into the server name so containers know how to route to it.
145
-
func (s*Server) ServerName() string {
146
+
func (s*Server) ServerName() spec.ServerName {
146
147
if!s.listening {
147
148
ct.Fatalf(s.t, "ServerName() called before Listen() - this is not supported because Listen() chooses a high-numbered port and thus changes the server name. Ensure you Listen() first!")
148
149
}
@@ -205,28 +206,31 @@ func (s *Server) FederationClient(deployment FederationDeployment) fclient.Feder
205
206
ct.Fatalf(s.t, "FederationClient() called before Listen() - this is not supported because Listen() chooses a high-numbered port and thus changes the server name and thus changes the way federation requests are signed. Ensure you Listen() first!")
206
207
}
207
208
identity:= fclient.SigningIdentity{
208
-
ServerName: spec.ServerName(s.ServerName()),
209
+
ServerName: s.ServerName(),
209
210
KeyID: s.KeyID,
210
211
PrivateKey: s.Priv,
211
212
}
212
-
f:=fclient.NewFederationClient(
213
+
fedClient:=fclient.NewFederationClient(
213
214
[]*fclient.SigningIdentity{&identity},
214
215
fclient.WithTransport(deployment.RoundTripper()),
215
216
)
216
-
returnf
217
+
returnfedClient
217
218
}
218
219
219
220
// MustSendTransaction sends the given PDUs/EDUs to the target destination, returning an error if the /send fails or if the response contains an error
0 commit comments