matrix-org / matrix-org/complement

Smoke testing core features

Aperta
#660 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Go
Stelle
99
Fork
72
Merge medio
4g 1h
PR unite (30g)
8

Descrizione

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).

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con l’interfaccia helper client esistente, incluso client.CreateRoom, e con i test Complement che la utilizzano. Confronta le interfacce proposte per utente autenticato/token, aggiornamenti in tempo reale e stanze con gli scenari di matrix-authentication-service, sliding-sync e MSC4014; il lavoro è completato quando è definito un approccio di smoke testing, con modalità di errore e ambito concordati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.