up
This commit is contained in:
		
							
								
								
									
										34
									
								
								docs/dev/fixtures.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/dev/fixtures.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
# Feedser Fixture Maintenance
 | 
			
		||||
 | 
			
		||||
Feedser uses a handful of deterministic fixtures to keep connector regressions in check. This guide lists the
 | 
			
		||||
fixture sets, where they live, and how to regenerate them safely.
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## GHSA ↔ OSV parity fixtures
 | 
			
		||||
 | 
			
		||||
- **Location:** `src/StellaOps.Feedser.Source.Osv.Tests/Fixtures/osv-ghsa.*.json`
 | 
			
		||||
- **Purpose:** Exercised by `OsvGhsaParityRegressionTests` to ensure OSV + GHSA outputs stay aligned on aliases,
 | 
			
		||||
  ranges, references, and credits.
 | 
			
		||||
- **Regeneration:** Either run the test harness with online regeneration (`UPDATE_PARITY_FIXTURES=1 dotnet test src/StellaOps.Feedser.Source.Osv.Tests/StellaOps.Feedser.Source.Osv.Tests.csproj`)
 | 
			
		||||
  or execute the fixture updater (`dotnet run --project tools/FixtureUpdater/FixtureUpdater.csproj`). Both paths
 | 
			
		||||
  normalise timestamps and canonical ordering.
 | 
			
		||||
- **Verification:** Inspect the diff, then re-run `dotnet test src/StellaOps.Feedser.Source.Osv.Tests/StellaOps.Feedser.Source.Osv.Tests.csproj` to confirm parity.
 | 
			
		||||
 | 
			
		||||
## GHSA credit parity fixtures
 | 
			
		||||
 | 
			
		||||
- **Location:** `src/StellaOps.Feedser.Source.Ghsa.Tests/Fixtures/credit-parity.{ghsa,osv,nvd}.json`
 | 
			
		||||
- **Purpose:** Exercised by `GhsaCreditParityRegressionTests` to guarantee GHSA/NVD/OSV acknowledgements remain in lockstep.
 | 
			
		||||
- **Regeneration:** `dotnet run --project tools/FixtureUpdater/FixtureUpdater.csproj` rewrites all three canonical snapshots.
 | 
			
		||||
- **Verification:** `dotnet test src/StellaOps.Feedser.Source.Ghsa.Tests/StellaOps.Feedser.Source.Ghsa.Tests.csproj`.
 | 
			
		||||
 | 
			
		||||
> Always commit fixture changes together with the code that motivated them and reference the regression test that guards the behaviour.
 | 
			
		||||
 | 
			
		||||
## Apple security update fixtures
 | 
			
		||||
 | 
			
		||||
- **Location:** `src/StellaOps.Feedser.Source.Vndr.Apple.Tests/Apple/Fixtures/*.html` and `.expected.json`.
 | 
			
		||||
- **Purpose:** Exercised by `AppleLiveRegressionTests` to guarantee the Apple HTML parser and mapper stay deterministic while covering Rapid Security Responses and multi-device advisories.
 | 
			
		||||
- **Regeneration:** Use the helper scripts (`scripts/update-apple-fixtures.sh` or `scripts/update-apple-fixtures.ps1`). They export `UPDATE_APPLE_FIXTURES=1`, propagate the flag through `WSLENV`, touch `.update-apple-fixtures`, and then run the Apple test project. This keeps WSL/VSCode test invocations in sync while the refresh workflow fetches live Apple support pages, sanitises them, and rewrites both the HTML and expected DTO snapshots with normalised ordering.
 | 
			
		||||
- **Verification:** Inspect the generated diffs and re-run `dotnet test src/StellaOps.Feedser.Source.Vndr.Apple.Tests/StellaOps.Feedser.Source.Vndr.Apple.Tests.csproj` without the env var to confirm determinism.
 | 
			
		||||
 | 
			
		||||
> **Tip for other connector owners:** mirror the sentinel + `WSLENV` pattern (`touch .update-<connector>-fixtures`, append the env var via `WSLENV`) when you add fixture refresh scripts so contributors running under WSL inherit the regeneration flag automatically.
 | 
			
		||||
		Reference in New Issue
	
	Block a user