CycloneDX / CycloneDX/cyclonedx-python-lib

docs: explain model fixture and snapshot workflow

Chiusa Adatta ai principianti
#1,030 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
116
Fork
67
Merge medio
8g 2h
PR unite (30g)
2

Descrizione

### Description

The contributor documentation links to `tests/_data/snapshots/README.md`, but that file currently explains only how to regenerate snapshots. It does not explain how BOM model factories in `tests/_data/models.py` are discovered or how they feed the JSON, XML, and round-trip tests.

This gap came up in the maintainer guidance on #914: https://github.com/CycloneDX/cyclonedx-python-lib/pull/914#issuecomment-3562249425. The maintainer explicitly welcomed a dedicated documentation pull request.

### Proposed documentation

Document the existing workflow without changing test behavior:

- `get_bom_*` factory discovery and snapshot naming;
- `_invalid` fixtures;
- registration of deliberately incomplete dependency graphs;
- regenerating snapshots, reviewing only the intended files, and rerunning tests with snapshot recreation disabled.

### Acceptance

- The documented paths and collector names match the current default branch.
- The shared JSON/XML output and deserialization fixture tests pass.
- The full test suite remains green.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with tests/_data/snapshots/README.md and compare its current guidance with tests/_data/models.py and the shared JSON/XML output and deserialization fixture tests. Document the existing factory discovery, snapshot naming, _invalid fixtures, incomplete dependency graphs, and regeneration review workflow; done means the paths and collector names match the default branch and the specified tests and full suite pass with recreation disabled.

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

Valutazione

Stack tecnologico
python
Ambito
documentation, testing
Tipo di issue
Documentazione
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
74/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.