Skip to content

Conversation

neilalexander
Copy link
Contributor

@neilalexander neilalexander commented Jun 2, 2020

This adds a new deprecated_endpoints qw to require, and adds a command-line flag --exclude-deprecated. The idea is that we can not bother running tests at all that test endpoints that we know are deprecated, e.g. in Dendrite we will never implement /initialSync.

@neilalexander neilalexander marked this pull request as ready for review June 2, 2020 15:06
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
@neilalexander neilalexander changed the title Add ability to exclude tests that require deprecated endpoints Add ability to exclude tests for deprecated endpoints Jun 2, 2020
@neilalexander neilalexander requested a review from richvdh June 2, 2020 16:40
richvdh
richvdh previously requested changes Jun 3, 2020
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.

using requires in this way will mean that the tests are skipped in a normal run:

  Testing if: POST /rooms/:room_id/state/m.room.name sets name... SKIP due to lack of can_room_initial_sync
  Testing if: GET /rooms/:room_id/state/m.room.name gets name... SKIP due to lack of can_set_room_name
  Testing if: POST /rooms/:room_id/state/m.room.topic sets topic... SKIP due to lack of can_room_initial_sync
  Testing if: GET /rooms/:room_id/state/m.room.topic gets topic... SKIP due to lack of can_set_room_topic

I think a better way would just be to define a different parameter instead of requires (and do the filtering in _push_test).

run-tests.pl Outdated
Comment on lines 873 to 876
if ($req eq "deprecated_endpoints" && !$INCLUDE_DEPRECATED_ENDPOINTS) {
$excluded_count++;
next TESTS;
}
Copy link
Member

Choose a reason for hiding this comment

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

indentation

@@ -4,7 +4,7 @@

test "initialSync sees my presence status",
requires => [ local_user_fixture( with_events => 1 ),
qw( can_initial_sync )],
qw( can_initial_sync, deprecated_endpoints )],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
qw( can_initial_sync, deprecated_endpoints )],
qw( can_initial_sync deprecated_endpoints )],

@@ -131,7 +131,7 @@ sub test_history_visibility
test(
"$name non-joined user can call /events on world_readable room",

requires => [ $fixture->(), local_user_fixture( with_events => 1 ), local_user_fixture( with_events => 1 ) ],
requires => [ $fixture->(), local_user_fixture( with_events => 1 ), local_user_fixture( with_events => 1 ), qw ( deprecated_endpoints ) ],
Copy link
Member

Choose a reason for hiding this comment

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

long line is long

Suggested change
requires => [ $fixture->(), local_user_fixture( with_events => 1 ), local_user_fixture( with_events => 1 ), qw ( deprecated_endpoints ) ],
requires => [
$fixture->(), local_user_fixture( with_events => 1 ), local_user_fixture( with_events => 1 ),
qw ( deprecated_endpoints ),
],

@neilalexander neilalexander requested a review from richvdh August 13, 2020 14:38
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.

looks good. Can you add some words to https://github.com/matrix-org/sytest/blob/develop/DEVELOP.rst?

@neilalexander neilalexander merged commit b987436 into develop Aug 14, 2020
@neilalexander neilalexander deleted the neilalexander/excludes branch August 14, 2020 09:20
anoadragon453 added a commit that referenced this pull request Oct 21, 2020
…c_release_1_21_x

* origin/release-v1.20.1: (27 commits)
  Pin Alien::Sodium to an old version, to fix install errors (#949)
  Disable rate limiting on Dendrite (#947)
  Wait for synapse to start by using sd_notify. (#943)
  Fix bad tests (#939)
  Add ability to exclude tests for deprecated endpoints (#881)
  Abide by the spec when making /keys/query requests
  When putting device keys, may the JSON body spec compliant
  Remove trailing slashes from /state_ids and /backfill in ACL tests (#936)
  Fix /send server ACL test to match spec (#935)
  Call matrix_get_e2e_keys correctly
  Removed unused params from pydron invocation (#931)
  Deflake 'Server correctly resyncs when server leaves and rejoins a room' (#932)
  Dendrite configuration format v1 (#921)
  Disable TLS validation for Dendrite
  Set Dendrite loglevel to trace (#933)
  Merge Synapse::ViaHaproxy and -I Synapse::Dendron (#930)
  Use ProcessManager in Synapse.pm (#929)
  Add redis support to synapse docker image (#928)
  Update the README for the docker images (#927)
  Some minor cleanups to the startup scripts (#926)
  ...
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.

3 participants