Skip to content

Commit e1a429a

Browse files
Run lint script to format Complement tests introduced in #19509 (#19636)
Run `poetry run ./scripts-dev/lint.sh` which exposed some formatted Complement tests that were introduced in #19509 There is no CI for this so it's easy to miss.
1 parent 72711a3 commit e1a429a

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

changelog.d/19636.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run lint script to format Complement tests introduced in [#19509](https://github.com/element-hq/synapse/pull/19509).

complement/tests/internal/dockerutil/files.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import (
1414
//
1515
// Internally, produces an uncompressed single-file tape archive (tar) that is sent to the docker
1616
// daemon to be unpacked into the container filesystem.
17-
func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID string, path string, data []byte) error {
17+
func WriteFileIntoContainer(
18+
t *testing.T,
19+
docker *client.Client,
20+
containerID string,
21+
path string,
22+
data []byte,
23+
) error {
1824
// Create a fake/virtual tar file in memory that we can copy to the container
1925
// via https://stackoverflow.com/a/52131297/796832
2026
var buf bytes.Buffer
@@ -25,7 +31,11 @@ func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID str
2531
Size: int64(len(data)),
2632
})
2733
if err != nil {
28-
return fmt.Errorf("WriteIntoContainer: failed to write tarball header for %s: %v", path, err)
34+
return fmt.Errorf(
35+
"WriteIntoContainer: failed to write tarball header for %s: %v",
36+
path,
37+
err,
38+
)
2939
}
3040
_, err = tw.Write([]byte(data))
3141
if err != nil {
@@ -34,7 +44,11 @@ func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID str
3444

3545
err = tw.Close()
3646
if err != nil {
37-
return fmt.Errorf("WriteIntoContainer: failed to close tarball writer for %s: %w", path, err)
47+
return fmt.Errorf(
48+
"WriteIntoContainer: failed to close tarball writer for %s: %w",
49+
path,
50+
err,
51+
)
3852
}
3953

4054
// Put our new fake file in the container volume

complement/tests/oidc_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ func TestOIDCProviderUnavailable(t *testing.T) {
9393
// by the user's browser in order to start the login flow.
9494
queryParams := url.Values{}
9595
queryParams.Add("redirectUrl", "http://redirect.invalid/redirect")
96-
res := unauthedClient.Do(t, "GET", []string{"_matrix", "client", "v3", "login", "sso", "redirect", "oidc-test_provider"},
96+
res := unauthedClient.Do(
97+
t,
98+
"GET",
99+
[]string{"_matrix", "client", "v3", "login", "sso", "redirect", "oidc-test_provider"},
97100
client.WithQueries(queryParams),
98101
)
99102

0 commit comments

Comments
 (0)