Skip to content

TestPowerLevels/GET_/rooms/:room_id/state/m.room.power_levels_can_fetch_levels fails when default values are omitted #957

Open

Description

@timedoutuk

If the JSON serialiser omits keys with values matching their defaults, as ruma does via serde, the test fails because it cannot find the specified key, even though this has no functional impact:

  ❌ TestPowerLevels/GET_/rooms/:room_id/state/m.room.power_levels_can_fetch_levels (0s)
    power_levels_test.go:105: MatchJSONBytes key 'ban' missing with input = {
          "events": {
            "m.poll.response": 0,
            "m.room.encryption": 100,
            "m.room.history_visibility": 100,
            "m.room.power_levels": 100,
            "m.room.server_acl": 100,
            "m.room.tombstone": 150,
            "org.matrix.msc3381.poll.response": 0
          }
        }

It looks like I added a skip for this when getting Venator running with complement, but forgot to open an issue for it

// Venator skips marshalling default values, which means all of these checks fail:
// > MatchJSONBytes key 'ban' missing with input = {}
// This is a feature :D
runtime.SkipIf(t, runtime.Venator)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions