Add test case reproducing matrix-org/synapse#5677 for local users#199
Conversation
|
The new test case seems to fail when ran against dendrite, because the first request to |
| @@ -0,0 +1,64 @@ | |||
| // +build !synapse_blacklist | |||
|
|
|||
| // Rationale for being included in Synapse's blacklist: https://github.com/matrix-org/synapse/issues/5677 | |||
There was a problem hiding this comment.
You probably don't want this on Synapse's blacklist.
There was a problem hiding this comment.
My thinking was that I wouldn't want synapse CI to suddenly light up red. But maybe your point is "it should do!"
|
|
||
| alice := deployment.Client(t, "hs1", "@alice:hs1") | ||
| bob := deployment.RegisterUser(t, "hs1", "bob", "bob-pw") | ||
| eve := deployment.RegisterUser(t, "hs1", "eve", "eve-pw") |
There was a problem hiding this comment.
These passwords will be too short for some servers, which is probably why it 400s on Dendrite.
| alice.JoinRoom(t, privateRoom, nil) | ||
|
|
||
| // Alice reveals her private name to Bob | ||
| alice.MustDo( |
There was a problem hiding this comment.
Prefer MustDoFunc. MustDo is the older format which doesn't allow for vargs and will be removed in the future. MustDoFunc also logs HTTP response bodies on error.
There was a problem hiding this comment.
Will do, thanks. Mind if I mark MustDo as deprecated?
| bob := deployment.RegisterUser(t, "hs1", "bob", "bob-pw") | ||
| eve := deployment.RegisterUser(t, "hs1", "eve", "eve-pw") | ||
|
|
||
| t.Run("Usernames specific to a room aren't leaked in the user directory", func(t *testing.T) { |
There was a problem hiding this comment.
There's no real need to do this as a subtest, unless you plan to add more tests around username leaks?
There was a problem hiding this comment.
That's fair. Could add one for avatar leaks too perhaps.
Probably bloat that belongs in the specific test?
for consistency with other matchers
hopefully will now pass on dendrite
tried to make this just a warning but I couldn't figure out the config.
|
Dendrite now failing with Logs
|
It's not required that you can search for people by per-room names (and per-room names are kind of an accident anyway right now)
|
CI seems to be failing for both Synapse and Dendrite for an unrelated test. Any idea what's going on there? (Old branch? or have you accidentally broken something?) |
In both runs I see two failures, both in the newly written tests: TestRoomSpecificUsernameHandling and TestRoomSpecificUsernameHandlingOverFederation. Which ones are you seeing fail, and where? |
oh, sorry. The output is confusing. I saw this at the end of the report: But that doesn't mean what I thought it means. |
kegsay
left a comment
There was a problem hiding this comment.
Looks great overall, thank you!
|
Tests are failing however: |
this unfortunately got bundled in with changes I'd already started.
|
Running this against my changes in matrix-org/synapse#10695 yields dmr on titan in complement on dmr/per-room-nick-leakage via 🐹 v1.16.6 via 🐍 v3.9.6 (env) took 24s
2021-09-06 18:10:20 ✗ 1 ERROR $ COMPLEMENT_BASE_IMAGE=complement-synapse go test ./... -run TestRoomSpecificUsername | grep FAIL
318:--- FAIL: TestRoomSpecificUsernameHandlingOverFederation (19.90s)
332: --- FAIL: TestRoomSpecificUsernameHandlingOverFederation/Eve_can_find_Charlie_by_profile_display_name (0.03s)
335: --- FAIL: TestRoomSpecificUsernameHandlingOverFederation/Eve_can_find_Charlie_by_mxid (0.00s)
336: user_directory_federated_display_names_test.go:112: MatchResponse all checks failed:
340: --- FAIL: TestRoomSpecificUsernameHandlingOverFederation/Eve_cannot_find_Charlie_by_room-specific_name_that_Eve_is_not_privy_to (0.00s)
343: --- FAIL: TestRoomSpecificUsernameHandlingOverFederation/Bob_can_find_Charlie_by_profile_display_name (0.00s)
346: --- FAIL: TestRoomSpecificUsernameHandlingOverFederation/Bob_can_find_Charlie_by_mxid (0.00s)
347: user_directory_federated_display_names_test.go:155: MatchResponse all checks failed:
350:FAIL
351:FAIL github.com/matrix-org/complement/tests 21.022s
353:FAILEdit: and this is good, because it's only the federated tests failing; the other ones pass. |
We could maybe try not passing
|
I think "alice" rather than "@alice:example.com" is nicer to display in the UI until we've confirmed their public profile.
|
Please add these tests to dendrite's blacklist, then fix the synapse issue then I'm happy to merge this. |
|
Thanks @kegsay, will do. Working on this in synapse now. |
The issue is fixed for Synapse for local users now. The other tests over federation ( How does that sound to everyone? |
|
I don't like the idea of merging tests which fail on all HS implementations. I don't like it because:
Remove the failing tests and add them when the underlying issues are resolved. |
|
@DMRobertson what's the status of this PR? Can we merge the bits that work and back out the things which don't? |
Ahh sorry, I missed this.
The tests in /csapi should all pass against Synapse now. I'll get that done now. |
Will return to these when I pick up matrix-org/synapse#5677 again.
|
The failed dendrite tests don't look related to this one: AFAICS these are failing on |
|
Yep that's fine, @neilalexander is working on that now. |
|
Happy for me to merge this @DMRobertson ? |
@kegsay Let's do it. |
Limited golang experience; feedback graciously accepted