Skip to content

[Tests] Add regression tests for scan batch isolation and finding preservation - #386

Merged
LarsLaskowski merged 5 commits into
mainfrom
claude/admiring-gauss-b4h8am
Oct 31, 2026
Merged

LarsLaskowski merged 5 commits into
mainfrom
claude/admiring-gauss-b4h8am

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

F-024 (a failing item aborting the scan batch) and F-025 (active findings lost on a transient feed error) are already fixed on main, but two paths still had no regression test. This change adds three tests: a two-image and a two-instance batch where the first item fails before its inner try and the other item must still be scanned to completion, and an observed image whose derived .NET finding must stay active when the release feed fails. The SaveChangesFailingDbContext test double gets a FailOnSaveAttempt option that fails exactly one save attempt. No production code changes; each test was shown to fail when its guard is removed.

🎫 Issues

Closes #19

💬 Reviewer Notes

Tests only. The batch order of the scan is not fixed, so the tests assert on "the item that failed" and "the other one", never on which comes first. While writing them, two related defects surfaced and were filed separately: #384 and #385.

📑 Test Plan

Three new tests in ImageScanOrchestratorTests and RuntimeContainerScanOrchestratorTests. Full suite passes (1008 + 21), overall line coverage 88.3 %.

✅ Checklist

  • I have added or updated Unit Tests for the change.
  • I have tested my changes.
  • I have run Format and Build from .squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file.
  • The Coverage gate in .squad/stack.md passes (line coverage on new or changed production code and overall).
  • I have updated the project documentation (README.md, ARCHITECTURE.md) to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • New dependencies, if any, were added the way Dependencies in .squad/stack.md prescribes.
  • The C# rules in csharp.instructions.md are followed.

⏭ Next Steps

@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski marked this pull request as ready for review October 31, 2026 17:09
@LarsLaskowski
LarsLaskowski merged commit 93d634a into main Oct 31, 2026
6 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/admiring-gauss-b4h8am branch October 31, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F-048 (P7) — Scan-resilience defects (F-024 batch abort, F-025 transient finding loss) without regression test

2 participants