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

Smoke testing core features #660

Open
kegsay opened this issue Oct 4, 2023 · 1 comment
Open

Smoke testing core features #660

kegsay opened this issue Oct 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@kegsay
Copy link
Member

kegsay commented Oct 4, 2023

Matrix has many moving parts. Tests typically only care about one single moving part at a time e.g send a message, create a room, upload OTKs. The setup code that happens to get to the point where we can test that moving part is for the most part, boilerplate. Complement has to date provided helper functions in client to do this sort of thing, failing the test if the boilerplate fails e.g client.CreateRoom. However, this then fixes the test into a certain way to setup the test. This is "okay" in that it is clear what is happening, but it limits the ability to do smoke tests:

smoke testing is preliminary testing or sanity testing to reveal simple failures severe enough to, for example, reject a prospective software release. Smoke tests are a subset of test cases that cover the most important functionality of a component or system, used to aid assessment of whether main functions of the software appear to work correctly.

There are several projects which would benefit from smoke testing:

  • matrix-authentication-service - all tests could start by logging into MAS and getting MAS tokens before checking basic functionality (the tests) work.
  • sliding-sync - all tests could use sliding sync APIs to consume live data rather than mandating sync v2.
  • MSC4014 pseudo IDs - all tests could be made as pseudo ID rooms which would otherwise then function the same as a normal room.

These could "reasonably" be split into 3 interfaces:

  • give me a logged in user and access token.
  • give me live updates.
  • give me a room.

There may be more. Smoke testing in this way is error-prone. Some tests will fail due to this setup in flakey ways, e.g:

  • The MAS token expires.
  • The sliding sync proxy didn't get the event, or the API doesn't expose the data you want to see in the test.
  • The room version behaves in a subtley different way.

However, there is real value in being able to run a sanity check like this, even if it isn't fully reliable (read: likely not in CI).

@kegsay kegsay added the enhancement New feature or request label Oct 4, 2023
@kegsay
Copy link
Member Author

kegsay commented Oct 4, 2023

MAS use case:

Although I would expand "give me a logged in user and access token" to "create a user, start a session for user and stop session". Not sure if Complement has tests regarding device deletion when a user logs out, but that's the kind of thing I would like to make sure still works as expected with MAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant