Test coverage: AddRangeFromSync failure dump (DumpFailedSync) path
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14
- Forks
- 4
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
Follow-up from the test-suite review (batches merged as #92–#96).
Gap
DataModel.AddRangeFromSync: on a DbUpdateException the catch block logs, writes last-failed-import.json (DumpFailedSync), and rethrows. Neither the dump-file side effect nor the rethrow is asserted anywhere.
Suggested test
AddRangeFromSync_OnDbUpdateException_DumpsFailedImportAndRethrows
Why it matters
This is the sync failure-diagnostics contract — if it silently breaks, all sync debugging output is lost with no signal. The test needs a way to force a DbUpdateException during import (e.g. a conflicting/duplicate commit) and to point FailedSyncOutputPath at a temp directory.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/SIL.Harmony/DataModel.cs at AddRangeFromSync and DumpFailedSync, then inspect the surrounding test project for import and exception patterns. Create the suggested AddRangeFromSync_OnDbUpdateException_DumpsFailedImportAndRethrows case using a temporary FailedSyncOutputPath. Done means the test forces a DbUpdateException, verifies last-failed-import.json is written, and confirms the exception is rethrown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100