Skip to content

Commit

Permalink
Import OCMock as a pod for RNTester on iOS (#36239)
Browse files Browse the repository at this point in the history
Summary:
This is a change we have implemented in React Native macOS that I am now upstreaming: microsoft#1257

The library `ocMock` is currently imported as a checked in binary by RN-Tester to help run unit tests on iOS. That binary is only compiled for x86 on macOS, which meant we could not run tests on M1 / M2 Macs. Switching  it so that we import from source as a pod should make maintenance easier for both iOS and macOS! :)

Original change notes:

>Previously, we've been unable to test RNTester for macOS on an M1 machine. This is because we were using a framework that was prebuilt for Intel architecture, so the test components would fail to build.
>
> The fix is to build OCMock from source directly instead of using a prebuilt version.
>
> This is only necessary on macOS. The iOS version is already built for ARM architecture, as iOS devices have been running exclusively on ARM for a while now.

## Changelog

[INTERNAL] [CHANGED] -  Import OCMock as a pod

Pull Request resolved: #36239

Test Plan: CI should pass as it did before.

Reviewed By: dmytrorykun

Differential Revision: D43732219

Pulled By: cipolleschi

fbshipit-source-id: 028b5a7f384042145bf1966c8c2730d7437940ec
  • Loading branch information
Saadnajmi authored and facebook-github-bot committed Mar 6, 2023
1 parent 350c055 commit d00c150
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 451 deletions.
1 change: 1 addition & 0 deletions packages/rn-tester/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ end
target 'RNTesterUnitTests' do
pods('RNTesterUnitTests')
pod 'React-RCTTest', :path => "./RCTTest"
pod 'OCMock', '~> 3.9.1'
end

target 'RNTesterIntegrationTests' do
Expand Down
8 changes: 6 additions & 2 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ PODS:
- hermes-engine/JSI (1000.0.0)
- hermes-engine/Public (1000.0.0)
- libevent (2.1.12)
- OCMock (3.9.1)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.07.22.00):
- boost
Expand Down Expand Up @@ -825,6 +826,7 @@ DEPENDENCIES:
- glog (from `../../third-party-podspecs/glog.podspec`)
- hermes-engine (from `../../sdks/hermes/hermes-engine.podspec`)
- libevent (~> 2.1.12)
- OCMock (~> 3.9.1)
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../../third-party-podspecs/RCT-Folly.podspec`)
- RCT-Folly/Fabric (from `../../third-party-podspecs/RCT-Folly.podspec`)
Expand Down Expand Up @@ -880,6 +882,7 @@ SPEC REPOS:
- FlipperKit
- fmt
- libevent
- OCMock
- OpenSSL-Universal
- SocketRocket
- YogaKit
Expand Down Expand Up @@ -986,8 +989,9 @@ SPEC CHECKSUMS:
FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 7907a32084d03d32827639c9d977a4581ab0ef71
hermes-engine: 9dd16fe1cfa47002229300b94e89fc661e198b10
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 54a4f03dbbebb0cfdb4e2ba8d3b1d0b1258f8c08
Expand Down Expand Up @@ -1028,6 +1032,6 @@ SPEC CHECKSUMS:
Yoga: 1b1a12ff3d86a10565ea7cbe057d42f5e5fb2a07
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 5f0460f3a7599f90e5d4759fdec7d7343fe7923d
PODFILE CHECKSUM: 041d77a36c7a31e8cd4f62ad87890e1436d3e1a9

COCOAPODS: 1.12.0

This file was deleted.

56 changes: 0 additions & 56 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMArg.h

This file was deleted.

65 changes: 0 additions & 65 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMConstraint.h

This file was deleted.

35 changes: 0 additions & 35 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMLocation.h

This file was deleted.

43 changes: 0 additions & 43 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMMacroState.h

This file was deleted.

37 changes: 0 additions & 37 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMRecorder.h

This file was deleted.

55 changes: 0 additions & 55 deletions packages/rn-tester/RNTesterUnitTests/OCMock/OCMStubRecorder.h

This file was deleted.

Loading

0 comments on commit d00c150

Please sign in to comment.