Conversation
kegsay
approved these changes
Feb 18, 2022
| return gjson.GetBytes(body, "event_id").Str | ||
| } | ||
|
|
||
| func syncUntilInvite(t *testing.T, alice *client.CSAPI) string { |
Member
There was a problem hiding this comment.
Needs a comment explaining why you can't use client.SyncInvitedTo - you don't know the room ID!
tests/csapi/admin_test.go
Outdated
| syncUntilInvite(t, alice) | ||
| }) | ||
| t.Run("Alice cannot reject the invite", func(t *testing.T) { | ||
| sendServerNotice(t, admin, reqBody, nil) |
Member
There was a problem hiding this comment.
Why are we constantly sending server notices? These subtests will run sequentially.
Contributor
Author
There was a problem hiding this comment.
I was running them in parallel first, but remembered that this might race since there can only be one active notice room. Fixed.
kegsay
approved these changes
Feb 18, 2022
3 tasks
MadLittleMods
added a commit
to element-hq/synapse
that referenced
this pull request
Feb 5, 2026
This is useful so we can test Synapse specific behaviors like our admin API. (see docs in PR, `complement/README.md`) ``` COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh --in-repo ``` Complement calls these ["out-of-repo"](https://github.com/matrix-org/complement/blob/78c255edcebfcb0ac5e3c86d49d76cb21fdd035a/OUT-OF-REPO-TESTS.md) tests but it's a bit of a misnomer once they're in your project. (just depends on the perspective) There has been [previous desire](#19021 (comment)) for this kind of thing but this is spawning from wanting to have some tests for our purge history admin API (element-hq/synapse-rust-apps#430). There are some Sytest tests ([`matrix-org/sytest` -> `tests/48admin.pl#L91-L618`](https://github.com/matrix-org/sytest/blob/1be04cce46c0f84abac736390dc3fab17f35a756/tests/48admin.pl#L91-L618)) for this already but I'd much rather work in Complement instead of Sytest. I'm wanting these tests to ensure that our new `event-cache` rust app for Synapse Pro doesn't break these kind of erasure features (element-hq/synapse-rust-apps#366 and element-hq/synapse-rust-apps#153). Interestingly, there is already [`matrix-org/complement` -> `tests/csapi/admin_test.go`](https://github.com/matrix-org/complement/blob/78c255edcebfcb0ac5e3c86d49d76cb21fdd035a/tests/csapi/admin_test.go) (added in matrix-org/complement#322) in the Complement repo iteslf that tests the `/_synapse/admin/v1/send_server_notice` endpoint but it's a bit of an interesting case as [Dendrite also supports this endpoint](matrix-org/dendrite#2180). I don't think it's good practice to continually shove in more and more Synapse-specific behavior into the Complement repo itself. We already have success with other out-of-repo tests for projects like the [SBG](https://github.com/element-hq/sbg/tree/b76b05b53e40bf6890e51dd1b83cec3460274eb2/complement_tests), [TI-Messenger Proxy](https://github.com/element-hq/ti-messenger-proxy/tree/c8fa87feccc743c01cccbbc2685321206b532925/complement), and our [Synapse Pro for small hosts](https://github.com/element-hq/synapse-small-hosts/tree/c2ea7eabf3e1d7c26a5312ebef326b254937be99/complement).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests for matrix-org/dendrite#2180