WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions testing/matrix-sdk-integration-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ access the synapse server and `HOMESERVER_DOMAIN` to be set to the domain config
that server. These variables are set to a default value that matches the default `docker-compose.yml`
template; if you haven't touched it, you don't need to manually set those environment variables.

The integration tests can be configured to use a HTTP proxy using the
`MATRIX_SDK_PROXY` environment variable. This plays well with `mitmproxy`
allowing you to inspect the requests tests make to the homeserver.

For example, if you start `mitmproxy` in another terminal, you can see the list
of HTTP requests the test will make by running:

```bash
$ MATRIX_SDK_PROXY=http://localhost:8080 cargo nextest run -p matrix-sdk-integration-testing my_test_name --retries=0
```

## Maintenance

### Delete all instance data
Expand Down
5 changes: 4 additions & 1 deletion testing/matrix-sdk-integration-testing/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ impl TestClientBuilder {
client_builder.cross_process_store_locks_holder_name(holder_name.clone());
}

if let Some(proxy) = &self.http_proxy {
let environment_proxy = option_env!("MATRIX_SDK_PROXY");
let proxy = self.http_proxy.as_deref().or(environment_proxy);

if let Some(proxy) = proxy {
client_builder = client_builder.proxy(proxy);
}

Expand Down
Loading