Conversation
📝 WalkthroughWalkthrough
ChangesAttachment validation correction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Tests/XCTestHTMLReportTests/FaultReportingTests.swift (1)
53-72: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd coverage for payload-bearing unresolved attachments.
This test verifies only the payload-less case. It does not verify that a non-
nilpayloadIdwith.nonecontent still creates an.unresolvedAttachmentfault. The test would pass ifSummary.validate()skipped all.noneattachments. Add or retain a fixture case for the required positive behavior.This matches the PR objective to continue reporting attachments with payload references that resolve to
.none.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Tests/XCTestHTMLReportTests/FaultReportingTests.swift` around lines 53 - 72, Extend the test around summary.validate() to include an attachment with a non-nil payloadId and .none content, then assert that validation reports it as an .unresolvedAttachment fault. Preserve the existing assertion that payload-less attachments are not reported, and ensure the fixture covers both behaviors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Tests/XCTestHTMLReportTests/FaultReportingTests.swift`:
- Around line 53-72: Extend the test around summary.validate() to include an
attachment with a non-nil payloadId and .none content, then assert that
validation reports it as an .unresolvedAttachment fault. Preserve the existing
assertion that payload-less attachments are not reported, and ensure the fixture
covers both behaviors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a7afa8f5-29c5-4a69-9297-72476560133a
📒 Files selected for processing (4)
Sources/XCTestHTMLReportCore/Classes/Models/Summary.swiftTests/XCTestHTMLReportTests/CoreTests.swiftTests/XCTestHTMLReportTests/FaultReportingTests.swiftXCTestHTMLReportSampleApp/SampleAppUITests/FirstSuite.swift
|
Closing as superseded: #438 landed the same fix (only fault attachments whose payload existed but failed to resolve) with tests that go through the production decode path and pin that a genuinely unexportable payload still faults. Thanks for surfacing the issue-side of this — the fixture-based test idea from this PR is noted as a follow-up. |
Summary by CodeRabbit
Tighten the post-condition in
Summary.validate()so.noneis fault-worthy only when the attachment also has a payload identifier, preserving the existing idempotent fault deduplication and genuine unresolved-payload behavior. Add a passing sample UI test that records an attachment with XCTest's payload-removing lifetime soprepareTestResults.shproduces a real attachment entry without apayloadRef; keep fixture generation and production parsing unchanged. StrengthenFaultReportingTestsby first proving the generated fixture contains that payload-less attachment, then asserting validation does not report it as unresolved, so the regression test cannot pass vacuously.Verification
TestResults.xcresultfrom the sample project and verify the fixture contains at least one attachment whosepayloadIdis absent and whose rendered content is.none.unresolvedAttachmentfault; running the CLI against the same fixture must continue to exit 0 without a degradation warning..noneis still reported as unresolved, and repeated validation does not duplicate that fault or disturb previously collected faults.Why
Summary.validate()currently records anunresolvedAttachmentfault whenever an attachment's rendering content is.none.Attachmentalso uses.nonefor attachments that never had apayloadRef, so a valid payload-less attachment is misclassified as failed resolution and can make the CLI exit 3. The model already retainsAttachment.payloadId, which distinguishes an attempted payload resolution from the absence of a payload without adding a new state or test-only abstraction. The current generated fixtures contain no payload-less attachment, leaving this false-positive path untested.Closes #387
Summary by CodeRabbit
Bug Fixes
Tests