Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Richer tests for Synapse modules #11084

Open
matrixbot opened this issue Dec 19, 2023 · 0 comments
Open

Richer tests for Synapse modules #11084

matrixbot opened this issue Dec 19, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 19, 2023

This issue has been migrated from #11084.


It would be useful to have richer tests for Synapse modules.

The idea of making Complement extensible (if it's not already) and doing tests that way has been suggested but it seems like quite a chunk of work.

One simple-seeming way of doing better tests for Synapse modules might be to do tests in the style of actual Synapse features. For example, using HomeserverTestCase and checking that various REST requests all give the expected results.

(We seem happy to acknowledge for now that this could be a bit brittle if we wind up refactoring Synapse's test helpers, but that's infrequent enough)

This is not as simple as I first thought; Synapse's test helpers are contained in the tests package which is explicitly excluded by setup.py: https://github.com/matrix-org/synapse/blob/b3698f945cabb44649df03617db3c51d9fc62674/setup.py#L141 .

The effect of this seems to be that it's not possible (at least, without imagining some nasty hacks) to import those test helpers into a module test.

What should we do about this?

Naïvely, I would perhaps like to see these pulled out into a separate package which is installable as e.g. matrix-synapse-test-helpers, but really not sure what is ergonomic or typical here in Python-land (it also seems like we'd have a circular dependency if we did that, synapse <---> test helpers).

@matrixbot matrixbot changed the title Dummy issue Richer tests for Synapse modules Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants