matrix-org / matrix-org/complement

Autogen per-test docs for discoverability

Aperta
#240 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

While working on importing sytests, i found myself `ctrl-shift-f`-ing on keywords to see what tests already existed to see if a sytest would fit that file, however, I think that this displays some poor test discoverability.

However, when i was documenting some sytests (and their behaviour), i came upon something like the following format;

```yaml
sytest:
- name: "Non-present room members cannot ban others"
type:
- power_level
- ban
desc:
When a user does not exist in a room, but has powerlevels there, it should not be able to ban users.
variants:
- user has never entered the room
- user has left the room
- user has been kicked while ban is sent out
- user server has been ACL-d
- name: "New federated private chats get full presence information (SYN-115)"
# ...
```

I think it would be useful to programmatically document (and maybe link) these tests, so that a quick glance can see which ones exist, what it does, what variants of behaviour it's also testing, and also in which "areas" of testing matrix it exists.

---

For a final variant of above schema, i think adding a `path` (something like `tests/csapi/rooms_state_test.go:TestRoomCreationReportsEventsToMyself`) would help auto-identify the corresponding function.

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 esaminando lo schema YAML proposto e il punto di ingresso di esempio tests/csapi/rooms_state_test.go:TestRoomCreationReportsEventsToMyself. Determina come sytests espongono nomi, comportamento, varianti e aree di test per la documentazione automatizzata. Il lavoro è completato quando la documentazione generata può elencare questi dettagli e collegare ogni voce al relativo percorso di test.

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

Valutazione

Stack tecnologico
go, yaml
Ambito
documentation, 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.