Skip to content

feat: enable TestRunner suite and metadata availability checks on visionOS#407

Merged
NathanWalker merged 1 commit into
mainfrom
fix/visionos-tests-and-availability
Jul 21, 2026
Merged

feat: enable TestRunner suite and metadata availability checks on visionOS#407
NathanWalker merged 1 commit into
mainfrom
fix/visionos-tests-and-availability

Conversation

@edusperoni

@edusperoni edusperoni commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

What

Three fixes that make the full TestRunner suite build, run, and pass on visionOS for the first time, and make API availability filtering actually work on that platform.

1. visionOS test infrastructure (project.pbxproj)

  • TestFixtures and TestRunnerTests now declare xros/xrsimulator in SUPPORTED_PLATFORMS.
  • TestRunner's target dependency on TestFixtures drops its ios-only platformFilter (now ios, xros, matching the NativeScript/TKLiveSync dependencies).

Previously, building the TestRunner scheme for a visionOS destination silently skipped libTestFixtures.a and the link failed — the suite could never run on visionOS.

2. Fixture availability portability (TNSVersions.h)

The two "never available" fixtures (TNSProtocolNeverAvailable, TNSInterfaceNeverAvailable) gain an explicit visionos availability attribute at the same MAX_AVAILABILITY version. Clang's iOS→visionOS availability mapping turned the ios-only attribute into a hard 'unavailable on visionOS' error at their reference sites; declaring visionos explicitly keeps them warning-level (potentially unavailable), matching the iOS semantics. Metadata output is unchanged.

3. Real availability checking on visionOS (Metadata.mm)

Meta::isAvailable() no longer short-circuits to true on visionOS. getSystemVersion() now runs there too, mapping pre-unified visionOS majors onto the iOS scale used by metadata introducedIn values (visionOS 1.x ≈ iOS 17.x, 2.x ≈ 18.x; aligned from 26 onward).

Behavior change: previously every API was reported as available on visionOS, so metadata for APIs marked unavailable leaked into JS (and VersionDiffTests fails on visionOS because unavailable base classes are not skipped). Apps that accidentally relied on such leaked metadata will now see those APIs correctly hidden.

Validation

  • visionOS 26.2 simulator (Apple Vision Pro): full TestRunner suite — 849 tests, 0 failures (first-ever green visionOS run), including VersionDiffTests 9/9.
  • iOS simulator regression: full suite — 849 tests, 0 failures.

Summary by CodeRabbit

  • Bug Fixes

    • Improved metadata availability handling for visionOS and aligned version detection with iOS-style numbering.
    • Corrected availability checks for APIs introduced on visionOS.
  • Tests

    • Expanded test configuration and fixtures to support iOS, visionOS, and their simulators.
    • Updated platform availability coverage for unavailable protocols and interfaces.

…ionOS

Three fixes that make the full TestRunner suite build, run, and pass on
visionOS for the first time, and make API availability filtering real
on that platform:

- project.pbxproj: TestFixtures and TestRunnerTests now declare
  xros/xrsimulator in SUPPORTED_PLATFORMS, and TestRunner's dependency
  on TestFixtures drops its ios-only platformFilter. Previously Xcode
  silently skipped building libTestFixtures.a for visionOS and the
  TestRunner link failed.
- TNSVersions.h: the two 'never available' fixtures gain an explicit
  visionos availability attribute. Clang's ios-to-visionos mapping
  turned the ios-only MAX_AVAILABILITY attribute into a hard
  'unavailable on visionOS' error at their reference sites; declaring
  visionos explicitly keeps them warning-level (potentially
  unavailable), matching iOS semantics. Metadata output is unchanged.
- Metadata.mm: Meta::isAvailable() no longer short-circuits to true on
  visionOS. getSystemVersion() now also runs there, mapping pre-unified
  visionOS majors onto the iOS scale used by metadata introducedIn
  values (visionOS 1.x ~ iOS 17.x, 2.x ~ 18.x; aligned from 26 on).
  Before this, every API was reported available on visionOS, so
  metadata for APIs that do not exist there leaked into JS.

Validated on visionOS 26.2 simulator (Apple Vision Pro): full suite
849 tests, 0 failures — including VersionDiffTests, which previously
failed because unavailable base classes were not skipped. iOS
regression run: 849 tests, 0 failures.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 10b98e57-d2ed-4f38-b028-bbd49b219884

📥 Commits

Reviewing files that changed from the base of the PR and between 2098243 and 5d1cb6d.

📒 Files selected for processing (3)
  • NativeScript/runtime/Metadata.mm
  • TestFixtures/Api/TNSVersions.h
  • v8ios.xcodeproj/project.pbxproj

📝 Walkthrough

Walkthrough

The runtime now computes and evaluates metadata availability on visionOS, including version remapping. Test fixtures declare visionOS availability, and Xcode configurations enable iOS and xros platforms for relevant targets.

Changes

visionOS metadata support

Layer / File(s) Summary
Runtime version detection and availability
NativeScript/runtime/Metadata.mm
getSystemVersion() now supports visionOS version remapping, and Meta::isAvailable() applies introduced-version checks on visionOS. Remaining metadata traversal changes are formatting-only.
VisionOS availability fixtures
TestFixtures/Api/TNSVersions.h
Fixture protocols and interfaces gain visionOS availability attributes, with declaration formatting updates.
xros build configuration
v8ios.xcodeproj/project.pbxproj
TestFixtures dependencies and Debug/Release configurations include iOS, xros, and simulator platforms.

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

Sequence Diagram(s)

sequenceDiagram
  participant VisionOS
  participant getSystemVersion
  participant Meta
  VisionOS->>getSystemVersion: provide operating-system version
  getSystemVersion->>Meta: return encoded systemVersion
  Meta->>Meta: evaluate introducedIn <= systemVersion
Loading

Poem

A rabbit hops through xros skies,
With version numbers neatly wise.
Metadata blooms, fixtures align,
Platforms join the build-time line.
Hop, hop—vision’s gates now chime!

🚥 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 summarizes the main change: enabling TestRunner coverage and metadata availability checks on visionOS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@NathanWalker
NathanWalker merged commit d907487 into main Jul 21, 2026
9 checks passed
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.

2 participants