Skip to content

fix: resolve iOS Native test execution issues#113

Open
MrSmart00 wants to merge 2 commits intomainfrom
fix/ios-native-test-execution
Open

fix: resolve iOS Native test execution issues#113
MrSmart00 wants to merge 2 commits intomainfrom
fix/ios-native-test-execution

Conversation

@MrSmart00
Copy link
Contributor

@MrSmart00 MrSmart00 commented Aug 14, 2025

Summary

  • Switch test-native from swift test to xcodebuild test to avoid SwiftGen prebuild plugin errors
  • Update Makefile to run both ComponentTests and FeatureTests on iOS Simulator
  • Add iOS Native tests to GitHub Actions workflow with macOS runner

Background

The swift test command was failing with SwiftGen prebuild plugin errors:

error: a prebuild command cannot use executables built from source, including executable target 'swiftgen'

This is due to SwiftPM's security restrictions on prebuild plugins, which cannot use executable targets built from source.

Changes

  • Makefile: Replace swift test with xcodebuild test for test-native target
  • GitHub Actions: Add test-native job using macOS 15 + Xcode 16.4
  • Use iPhone 16 Pro simulator for consistent test results
  • Enable parallel execution of Core tests (Ubuntu) and Native tests (macOS)

Test Plan

  • Verify xcodebuild test works locally with SwiftGen plugin
  • ComponentTests and FeatureTests execute successfully
  • CI pipeline runs both test jobs in parallel

Dependencies

This PR depends on #112 for the FeatureTests target definition.

🤖 Generated with Claude Code

MrSmart00 and others added 2 commits August 15, 2025 00:40
- Switch test-native from swift test to xcodebuild test to avoid SwiftGen prebuild plugin errors
- Add FeatureTests target to Package.swift for AboutFeature tests
- Update Makefile to run both ComponentTests and FeatureTests on iOS Simulator
- Use iPhone 16 Pro as test destination for consistent results

This resolves the "a prebuild command cannot use executables built from source" error
that was preventing Native module tests from running with swift test command.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test-native job to ios-test.yml workflow for iOS Native module testing
- Use macos-15 runner with Xcode 16.4 for iOS Simulator testing
- Run ComponentTests and FeatureTests via xcodebuild to avoid SwiftGen plugin issues
- Add SPM dependencies caching for faster CI builds
- Enable parallel execution of Core tests (Ubuntu) and Native tests (macOS)

This resolves iOS Native testing in CI by using xcodebuild instead of swift test,
which properly handles SwiftGen prebuild plugins.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MrSmart00 MrSmart00 requested review from a team as code owners August 14, 2025 15:42
@MrSmart00 MrSmart00 requested review from ry-itto and removed request for a team August 14, 2025 15:42
@MrSmart00 MrSmart00 marked this pull request as draft August 14, 2025 15:42
Base automatically changed from feat/add-feature-tests-target to main August 15, 2025 04:16
@MrSmart00 MrSmart00 marked this pull request as ready for review August 17, 2025 09:40
Copilot AI review requested due to automatic review settings August 17, 2025 09:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes iOS Native test execution issues by switching from swift test to xcodebuild test to resolve SwiftGen prebuild plugin errors, and adds iOS Native testing to the CI pipeline.

  • Replace swift test with xcodebuild test using iPhone 16 Pro simulator
  • Add macOS-based GitHub Actions job for Native tests with proper Xcode setup
  • Enable parallel execution of Core tests (Ubuntu) and Native tests (macOS)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app-ios/Makefile Updates test-native target to use xcodebuild with iPhone 16 Pro simulator instead of swift test
.github/workflows/ios-test.yml Adds new test-native job with macOS 15 runner and Xcode 16.4 configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer

- name: Cache SPM dependencies
uses: actions/cache@v3
Copy link

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Consider upgrading to actions/cache@v4 for better performance and compatibility with newer GitHub Actions runners.

Suggested change
uses: actions/cache@v3
uses: actions/cache@v4

Copilot uses AI. Check for mistakes.
@MrSmart00
Copy link
Contributor Author

This PR is failing in CI, but the failure is due to a check unrelated to the content of this PR, so I think it's fine to proceed with the review as is 🤔

Copy link
Member

@touyou touyou left a comment

Choose a reason for hiding this comment

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

LGTM👍
I thought the CI would likely pass if we merge the latest main branch, so it would be good to confirm that.

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.

3 participants