Write attachment test reports to a temporary directory - #420
sunnnn2005 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCLI tests now write generated reports to unique temporary directories and remove those directories after execution. Retry, attachment, and lenient-mode tests no longer use the default output location. ChangesCLI test output isolation
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@Tests/XCTestHTMLReportTests/CliTests.swift`:
- Line 68: Update testRetryBundleWithSharedPayloadRefsExitsZero and
testLenientFlagIsAccepted to invoke xchtmlreportCmd with an isolated temporary
output directory, matching the defaultArgs setup used by assertAttachmentsExist.
Ensure each test creates and cleans up its temporary output location; if
default-output behavior must remain covered, execute it from an isolated
temporary bundle parent.
- Line 68: Update ResultFile.exportPayload so relocated report attachments are
self-contained: either copy assets beneath outputDirectory or emit URLs relative
to outputDirectory instead of TestResults.xcresult. In the CLI test using
defaultArgs, resolve emitted URLs against outputDirectory and assert the
resulting assets exist at those locations, covering links from
outputDirectory/index.html.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9bc2923e-b34f-4c48-b4f1-af18bbdd7f0d
📒 Files selected for processing (1)
Tests/XCTestHTMLReportTests/CliTests.swift
Summary
index.htmlfiles out of the package test resourcesRoot cause
The attachment tests passed
-rwithout-o, soxchtmlreportused the.xcresultparent directory as its output directory. That leftTests/XCTestHTMLReportTests/Resources/index.htmluntracked after runningswift test.Validation
swift test— 23 tests passed, 1 existing Xcode 26 skipswift test --filter CliTests— 7 tests passedswift testleaves noResources/index.htmlFixes #389
Summary by CodeRabbit