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

Update tests that assumed PL50 for room upgrade, fix others #805

Merged
merged 10 commits into from
Feb 18, 2020

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 changed the title Remove tests that assumed PL50 for room upgrade, fix others Update tests that assumed PL50 for room upgrade, fix others Feb 17, 2020
@anoadragon453 anoadragon453 requested a review from a team February 17, 2020 13:02
tests/41end-to-end-keys/06-device-lists.pl Outdated Show resolved Hide resolved
@@ -510,6 +422,9 @@ sub upgrade_room_synced {
foreach my $k ( keys %STATE_DICT ) {
$levels->{events}->{$k} = 80;
}
# Modify tombstone requirements to 50 so we are able to upgrade the room
$levels->{events}->{"m.room.tombstone"} = 50;
Copy link
Member

Choose a reason for hiding this comment

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

Why? Doesn't the creator have 100?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just a couple lines below we modify creator to be PL50.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, ok, but why? If its trying to test that moderators can upgrade rooms by default then that sounds we're making the wrong change here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Originally moderators were allowed to update rooms by default, and that caused a bug where power levels could split brain. Technically someone could put a room back into this state, so it may still be worth testing?

Originally this PR just deleted this test, but rich thought it good to keep it as it's still a possibility.

Would you modify it in another way?

Copy link
Member

Choose a reason for hiding this comment

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

Just don't bother changing the creator to a mod? The test name suggests its trying to test that state gets copied over correctly, so testing that they can do so as a mod was probably just a cheeky extra test

Copy link
Member Author

@anoadragon453 anoadragon453 Feb 18, 2020

Choose a reason for hiding this comment

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

AH. Sorry, I was thinking of "/upgrade preserves the power level of the upgrading user in old and new rooms". This is a separate test. Yes, we can just pull the PL50 change out of here.

tests/30rooms/60version_upgrade.pl Show resolved Hide resolved
tests/30rooms/60version_upgrade.pl Show resolved Hide resolved

# Note that this test assumes that moderators by default are allowed to upgrade rooms
# Change the PL rules to allow moderators to send tombstones
$pl_content->{events}->{"m.room.tombstone"} = JSON::number(50);
Copy link
Member

Choose a reason for hiding this comment

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

I'd be tempted to instead have the creator upgrade tbh

Copy link
Member Author

Choose a reason for hiding this comment

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

I should stick this in a comment, but the bug that this tested for was a moderator getting upgraded to an admin in the old room. So changing the upgrader to be an admin initially may not preserve the test case?

Copy link
Member

Choose a reason for hiding this comment

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

hmm, Ok

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add a comment.

tests/30rooms/60version_upgrade.pl Outdated Show resolved Hide resolved
@anoadragon453 anoadragon453 merged commit ac23101 into develop Feb 18, 2020
@anoadragon453 anoadragon453 deleted the anoa/update_default_pls branch February 18, 2020 11:30
anoadragon453 added a commit that referenced this pull request Mar 23, 2020
…elease-v1.10.x

* commit '86ceaf920b21c4405794c867d60ad13552fec98e':
  Update tests that assumed PL50 for room upgrade, fix others (#805)
  Test /user/devices/ on fed reader (#799)
  Update tests to match removal of Synapse sending events when creating or deleting aliases.
  Route GET /groups queries to workers (#798)
  Don't push Dendrite images to Docker Hub (#797)
  Test that remote device list is refetched on leave/rejoin (#793)
  Update build.sh
  Update dendrite.Dockerfile
  Apply suggestions from code review
  add test for device key signatures over federation
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.

2 participants