From a5993abc0407c7df8fe405f81d76f76f37b34f91 Mon Sep 17 00:00:00 2001 From: anoa's Codex Agent Date: Wed, 4 Jun 2025 12:36:12 +0100 Subject: [PATCH 1/2] Create AGENTS.md A basic AGENTS.md to get us started --- AGENTS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000000..9227acd97bb --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,14 @@ +# Contributor Guide + +Synapse is a Python application that has Rust modules via pyo3 for performance. + +## Dev Environment Tips +- Source code is primarily in `synapse/`, tests are in `tests/`. +- Run `poetry install --dev` to install development python dependencies. This will also build and install the Synapse rust code. +- Use `./scripts-dev/lint.sh` to lint the codebase (this attempts to fix issues as well). This should be run and produce no errors before every commit. + +## Testing Instructions +- Find the CI plan in the .github/workflows folder. +- Use `poetry run trial tests` to run all unit tests, or `poetry run trial tests.metrics.test_phone_home_stats.PhoneHomeStatsTestCase` (for example) to run a single test case. The commit should pass all tests before you merge. +- Some typing warnings are expected currently. Fix any test or type *errors* until the whole suite is green. +- Add or update relevant tests for the code you change, even if nobody asked. From 1e90d896f1e23bb74e5e62a6e7aeef703f426ead Mon Sep 17 00:00:00 2001 From: anoa's Codex Agent Date: Fri, 6 Jun 2025 14:12:00 +0100 Subject: [PATCH 2/2] tests: clear proxy env vars --- tests/http/federation/test_matrix_federation_agent.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/http/federation/test_matrix_federation_agent.py b/tests/http/federation/test_matrix_federation_agent.py index 0fbb4db2f7d..54bbdfa19e8 100644 --- a/tests/http/federation/test_matrix_federation_agent.py +++ b/tests/http/federation/test_matrix_federation_agent.py @@ -84,6 +84,15 @@ def setUp(self) -> None: self.tls_factory = FederationPolicyForHTTPS(config) + # ensure any proxy settings from the environment do not interfere with + # the tests. In some execution environments (like CI or the test + # runner's container) `https_proxy` or `http_proxy` may be preset which + # would cause the agent to attempt to proxy outbound connections. + for var in ("http_proxy", "https_proxy", "HTTP_PROXY", "HTTPS_PROXY"): + if var in os.environ: + old = os.environ.pop(var) + self.addCleanup(os.environ.__setitem__, var, old) + self.well_known_cache: TTLCache[bytes, Optional[bytes]] = TTLCache( "test_cache", timer=self.reactor.seconds )