Skip to content

Fix the run destination OS name - #429

Open
floze-the-genius wants to merge 1 commit into
XCTestHTMLReport:mainfrom
floze-the-genius:fix/364-device-os-name
Open

floze-the-genius wants to merge 1 commit into
XCTestHTMLReport:mainfrom
floze-the-genius:fix/364-device-os-name

Conversation

@floze-the-genius

@floze-the-genius floze-the-genius commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • derive the destination platform name from ActionSDKRecord.name instead of hardcoding iOS
  • strip the simulator prefix and SDK version before rendering it beside the actual device OS version
  • generate a real macOS .xcresult alongside the existing iOS fixtures and assert both rendered platform names

Validation

  • hosted macOS/Xcode validation: real iOS and macOS fixture generation, then 24 tests with 1 expected skip and 0 failures
  • the same hosted run passes SwiftFormat, SwiftLint, and ShellCheck
  • local swift build --target XCTestHTMLReportCore passes
  • exported macOS metadata confirms targetSDKRecord.name = macOS 15.5 and operatingSystemVersion = 15.5

My local machine only has Command Line Tools, so the full Xcode-only fixture and test pipeline was run on the linked hosted macOS runner before opening this PR.

Fixes #364

AI assistance: Codex helped with implementation and validation; I reviewed the diff and verified every result reported above.

Summary by CodeRabbit

  • New Features

    • Reports now identify the device operating system dynamically, including macOS and iOS.
    • Device details display the correct platform name alongside the operating-system version.
  • Bug Fixes

    • Corrected device labels that previously displayed “iOS” for non-iOS test results.
    • Improved handling of simulator and platform names in generated HTML reports.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

RunDestination derives the device operating-system name from SDK data and renders it in HTML. A generated macOS result fixture and integration test verify platform names and versions for iOS and macOS reports.

Changes

Device OS rendering

Layer / File(s) Summary
Derive and render the operating-system name
Sources/XCTestHTMLReportCore/Classes/Models/RunDestination.swift, Sources/XCTestHTMLReportCore/Classes/HTMLTemplates.swift, Sources/XCTestHTMLReportCore/HTML/device.html
RunDestination derives the operating-system name from the SDK record and supplies DEVICE_OS_NAME to the device template.
Generate the macOS result fixture
XCTestHTMLReportSampleApp/MacOSResultFixture/..., prepareTestResults.sh, .gitignore
Adds a macOS fixture package, test, result-generation step, and ignore rules for generated artifacts.
Register and validate the fixture
Package.swift, Tests/XCTestHTMLReportTests/CoreTests.swift
Processes MacOSResults.xcresult and verifies platform/version rendering for iOS and macOS results.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: tylervick

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change to run destination OS name rendering.
Linked Issues check ✅ Passed The changes replace the hardcoded iOS label with a derived platform name and add macOS coverage, satisfying issue #364.
Out of Scope Changes check ✅ Passed The fixture, resource, manifest, ignore-rule, and test changes directly support platform-name validation and remain in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 @.gitignore:
- Line 4: Update the MacOSResults ignore rule to target only the generated
source path, while allowing
Tests/XCTestHTMLReportTests/Resources/MacOSResults.xcresult to remain tracked
for Package.swift and CoreTests.swift.
🪄 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: 9c491afe-3289-47a5-8de5-1b954d732de0

📥 Commits

Reviewing files that changed from the base of the PR and between 822129f and dc77ec6.

📒 Files selected for processing (10)
  • .gitignore
  • Package.swift
  • Sources/XCTestHTMLReportCore/Classes/HTMLTemplates.swift
  • Sources/XCTestHTMLReportCore/Classes/Models/RunDestination.swift
  • Sources/XCTestHTMLReportCore/HTML/device.html
  • Tests/XCTestHTMLReportTests/CoreTests.swift
  • XCTestHTMLReportSampleApp/MacOSResultFixture/Package.swift
  • XCTestHTMLReportSampleApp/MacOSResultFixture/Sources/Fixture/Fixture.swift
  • XCTestHTMLReportSampleApp/MacOSResultFixture/Tests/FixtureTests/FixtureTests.swift
  • prepareTestResults.sh

Comment thread .gitignore
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.

Device OS name is not correct

1 participant