Skip to content

Conversation

@bodqhrohro
Copy link
Contributor

@bodqhrohro bodqhrohro commented Nov 18, 2020

Signed-off-by: Bohdan Horbeshko <bodqhrohro@gmail.com>
@clokep clokep requested a review from a team November 19, 2020 12:19
@erikjohnston
Copy link
Member

Hi, sorry its taken a while to get back to you! It's great to see people diving into SyTest 🙂

I've been trying to think if this is something that we want in SyTest, namely there is nothing in the spec that requires servers to accept these characters in names (indeed, synapse will refuse to allow you to register usernames starting with a number or underscore).

On the other hand, it is somewhat useful to test whether a server accepts the full range of characters in usernames or not. I guess ideally we'd somehow mark this test as "informational, but not required for spec compliance", we do have a bunch of tests already that sort of ish fit into similar categories (mainly Synapse specific tests), but I don't think we currently have a way of actually marking tests.

I think I am probably mildly in favour of merging this PR, and if other server implementations run into issues we can cross that bridge down the line. I'll wait a bit before merging in case anyone else has opinions.

@richvdh
Copy link
Member

richvdh commented Nov 25, 2020

it's also worth noting that there is nothing that requires the username passed to register to be the same as the mxid that the server allocates that user: the server is free to allocate mxids sequentially if it so chooses, for example.

We should probably at least have a comment on the test to say that it's making assumptions about the server implementation?

@bodqhrohro
Copy link
Contributor Author

there is nothing that requires the username passed to register to be the same as the mxid that the server allocates that user

Uh oh, I missed that point.

Does it mean that the tests for rejected characters (which I based these tests on) are making this assumption too? Can a home server, for example, automatically escape the prohibited characters in MXID instead of returning M_INVALID_USERNAME?

@richvdh
Copy link
Member

richvdh commented Nov 26, 2020

Does it mean that the tests for rejected characters (which I based these tests on) are making this assumption too?

yes, indeed they are.

Can a home server, for example, automatically escape the prohibited characters in MXID instead of returning M_INVALID_USERNAME?

yes.

but as erik says: we don't have a great way of testing this stuff otherwise, and given that all the server implementations we know about handle these scenarios in the way sytest assumes, it's probably ok - but I do think that we should include comments in the tests where we are making new assumptions about implementation.

@bodqhrohro
Copy link
Contributor Author

but I don't think we currently have a way of actually marking tests

So the implementation_specific argument is not exactly for denoting the Synapse-like behaviour, right?

Then I guess it should be split into two arguments: one for strictly implementation-specific tests, and one for behaviour-specific tests, which may be used for HS that strive to mimick the behaviour of other HS beyond the specification. So it would become possible to run something like -I Dendrite::Monolith -M Synapse, where -M is for "mimick".

Should I post a separate issue about it and mark the tests with implementation_specific => "synapse" for now?

@richvdh
Copy link
Member

richvdh commented Dec 1, 2020

Then I guess it should be split into two arguments: one for strictly implementation-specific tests, and one for behaviour-specific tests,

I'm not sure, to be honest. That sounds a bit overcomplicated to me, and I don't think it's a big enough problem to make that worthwhile.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you just add a comment like this

@richvdh richvdh added the X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged label Dec 1, 2020
bodqhrohro and others added 2 commits December 1, 2020 18:24
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@richvdh
Copy link
Member

richvdh commented Dec 1, 2020

Thanks. I'm pretty sure the CI is failing for unrelated reasons, so I'm going to go ahead and merge this

@richvdh richvdh merged commit 136e441 into matrix-org:develop Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X-Awaiting-Changes A contributed PR which needs changes and re-review before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants