sillsdev / sillsdev/harmony

Test coverage: AddRangeFromSync failure dump (DumpFailedSync) path

Open
#99 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

https://github.com/sillsdev/harmony/blob/03f609f11a560433ce4a7ecd598a21921b324add/src/SIL.Harmony/DataModel.cs#L138-L168

https://github.com/sillsdev/harmony/blob/03f609f11a560433ce4a7ecd598a21921b324add/src/SIL.Harmony/DataModel.cs#L170-L182

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.