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
https://github.com/element-hq/synapse/pull/19509

There is no CI for this so it's easy to miss.
This commit is contained in:
Eric Eastwood
2026-03-31 11:01:12 -05:00
committed by GitHub
parent 72711a3329
commit e1a429ae2e
3 changed files with 22 additions and 4 deletions

1
changelog.d/19636.misc Normal file
View File

@@ -0,0 +1 @@
Run lint script to format Complement tests introduced in [#19509](https://github.com/element-hq/synapse/pull/19509).

View File

@@ -14,7 +14,13 @@ import (
//
// Internally, produces an uncompressed single-file tape archive (tar) that is sent to the docker
// daemon to be unpacked into the container filesystem.
func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID string, path string, data []byte) error {
func WriteFileIntoContainer(
t *testing.T,
docker *client.Client,
containerID string,
path string,
data []byte,
) error {
// Create a fake/virtual tar file in memory that we can copy to the container
// via https://stackoverflow.com/a/52131297/796832
var buf bytes.Buffer
@@ -25,7 +31,11 @@ func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID str
Size: int64(len(data)),
})
if err != nil {
return fmt.Errorf("WriteIntoContainer: failed to write tarball header for %s: %v", path, err)
return fmt.Errorf(
"WriteIntoContainer: failed to write tarball header for %s: %v",
path,
err,
)
}
_, err = tw.Write([]byte(data))
if err != nil {
@@ -34,7 +44,11 @@ func WriteFileIntoContainer(t *testing.T, docker *client.Client, containerID str
err = tw.Close()
if err != nil {
return fmt.Errorf("WriteIntoContainer: failed to close tarball writer for %s: %w", path, err)
return fmt.Errorf(
"WriteIntoContainer: failed to close tarball writer for %s: %w",
path,
err,
)
}
// Put our new fake file in the container volume

View File

@@ -93,7 +93,10 @@ func TestOIDCProviderUnavailable(t *testing.T) {
// by the user's browser in order to start the login flow.
queryParams := url.Values{}
queryParams.Add("redirectUrl", "http://redirect.invalid/redirect")
res := unauthedClient.Do(t, "GET", []string{"_matrix", "client", "v3", "login", "sso", "redirect", "oidc-test_provider"},
res := unauthedClient.Do(
t,
"GET",
[]string{"_matrix", "client", "v3", "login", "sso", "redirect", "oidc-test_provider"},
client.WithQueries(queryParams),
)