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

Room version 6 tests #869

Merged
merged 36 commits into from Jun 3, 2020
Merged

Room version 6 tests #869

merged 36 commits into from Jun 3, 2020

Conversation

clokep
Copy link
Contributor

@clokep clokep commented May 14, 2020

This adds some sytests for room version 6, mostly geared around the integer validation of MSC2540.

This requires matrix-org/synapse#7506

To Do:

Bad event sent to:

  • /_matrix/federation/v1/send
  • /_matrix/federation/vN/send_join
  • /_matrix/federation/vN/send_leave
  • /_matrix/federation/vN/invite

Bad event returned from:

  • /_matrix/federation/v1/backfill/{roomId}
  • /_matrix/federation/v1/get_missing_events/{roomId}

@clokep
Copy link
Contributor Author

clokep commented May 14, 2020

We should probably add some sytests to the other added features as well. I'll see how hard that is.

@clokep
Copy link
Contributor Author

clokep commented May 14, 2020

Also -- these tests are almost definitely in the wrong file now. :) I'll see if I can find a better one...

@clokep
Copy link
Contributor Author

clokep commented May 14, 2020

We should probably add some sytests to the other added features as well. I'll see how hard that is.

  • Looks like tests for MSC2209 should be added to tests/30rooms/08levels.pl
  • It looks like there's already tests for the changes in alias behavior.

@clokep clokep requested a review from a team May 15, 2020 19:05
@@ -16,8 +16,7 @@ use SyTest::Assertions qw( :all );
use URI::Escape qw( uri_escape );

use constant SUPPORTED_ROOM_VERSIONS => [qw(
1 2 3 4 5
org.matrix.msc2260
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This room version was previously removed from Synapse, it also seems a bit weird to bit unstable room versions in here.

tests/80torture/20json.pl Outdated Show resolved Hide resolved
tests/30rooms/08levels.pl Outdated Show resolved Hide resolved
@clokep clokep requested a review from anoadragon453 May 18, 2020 17:11
@clokep
Copy link
Contributor Author

clokep commented May 18, 2020

@anoadragon453 Do you have any thoughts on where the JSON tests should go or if the current file is reasonable?

@richvdh
Copy link
Member

richvdh commented May 19, 2020

@anoadragon453 Do you have any thoughts on where the JSON tests should go or if the current file is reasonable?

it seems reasonable to me, fwiw (though I do tend to forget that 80torture exists).

@anoadragon453
Copy link
Member

@clokep Seems fine to me as well.

anoadragon453
anoadragon453 previously approved these changes May 19, 2020
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

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

lgtm other than what I mentioned above.

@clokep clokep requested a review from anoadragon453 May 19, 2020 19:49
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.

we should probably test what happens when we send a bad event to /_matrix/federation/v1/send

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.

probably also those sent to :

  • /_matrix/federation/vN/send_{join,leave}
  • /_matrix/federation/vN/invite

... and those sent in response to

  • /_matrix/federation/v1/backfill/{roomId}
  • /_matrix/federation/v1/get_missing_events/{roomId}

@richvdh
Copy link
Member

richvdh commented May 20, 2020

(I should say: happy for this to land as-is and the additional tests to end up in a different PR)

@clokep clokep removed the request for review from anoadragon453 May 20, 2020 17:29
@clokep clokep requested a review from richvdh June 1, 2020 15:16
@clokep
Copy link
Contributor Author

clokep commented Jun 1, 2020

@richvdh I think this is ready for another look. Hopefully the tests are reasonably self-explanatory, but let me know if additional comments should be added!

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.

a few bits and bobs.

As a general theme: it's hard to tell what some of these tests are testing, and how they are doing it, from the short summary. I'd like to see some more comments describing exactly what they are testing, and also explaining how each test works. It's particularly useful to pick out which bits of the tests are boilerplate "setup" and where the interesting stuff is.

tests/50federation/30room-join.pl Outdated Show resolved Hide resolved
tests/50federation/30room-join.pl Outdated Show resolved Hide resolved
tests/50federation/30room-join.pl Outdated Show resolved Hide resolved
my ( $outbound_client, $inbound_server, $creator, $room_id, $user_id ) = @_;
my $first_home_server = $creator->server_name;

my $local_server_name = $outbound_client->server_name;
Copy link
Member

Choose a reason for hiding this comment

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

seems unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used to set the origin below in the send_join request.

tests/50federation/33room-get-missing-events.pl Outdated Show resolved Hide resolved
tests/50federation/33room-get-missing-events.pl Outdated Show resolved Hide resolved
tests/50federation/33room-get-missing-events.pl Outdated Show resolved Hide resolved
tests/50federation/34room-backfill.pl Outdated Show resolved Hide resolved
tests/50federation/34room-backfill.pl Outdated Show resolved Hide resolved
tests/50federation/34room-backfill.pl Outdated Show resolved Hide resolved
@clokep clokep requested a review from richvdh June 2, 2020 17:26
@clokep
Copy link
Contributor Author

clokep commented Jun 2, 2020

@richvdh I think I've hit all your comments. Thanks for pointing out the additional fixtures! 👍

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.

lgtm!

tests/50federation/30room-join.pl Outdated Show resolved Hide resolved
tests/50federation/34room-backfill.pl Outdated Show resolved Hide resolved
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@clokep clokep merged commit dd51dcb into develop Jun 3, 2020
@clokep clokep deleted the clokep/room-ver-6 branch June 3, 2020 18:11
pull bot pushed a commit to valkum/sytest that referenced this pull request Jun 3, 2020
anoadragon453 added a commit that referenced this pull request Jun 24, 2020
…insic-release-v1.15.x

* 'release-v1.15.0' of github.com:matrix-org/sytest:
  Use the standardized form for SSO login via user interactive auth. (#884)
  Add tests for room version 6. (#869)
  Add a retry_until_success around room join (#882)
  Have frontend proxy persist events when using redis (#870)
  Squashed commit of the following:
  Fix link to Synapse's contributing docs. (#879)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants