Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-12987] FIx React Native CLI iOS test #2250

Merged
merged 14 commits into from
Nov 1, 2024
3 changes: 1 addition & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
steps:

#
# License audit
#
- label: ":copyright: License Audit"
Expand All @@ -19,6 +17,7 @@ steps:
- docker-compose#v4.12.0:
run: minimal-packager
artifact_paths: min_packages.tar

- label: ":docker: Build and publish JS packages"
key: "publish-js"
timeout_in_minutes: 30
Expand Down
11 changes: 9 additions & 2 deletions scripts/react-native-cli-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
}

common.changeDir(`${destFixtures}/${rnVersion}`)
const bugsnagCliCommand = './node_modules/.bin/bugsnag-cli upload react-native-android --upload-api-root-url=http://localhost:9339 --overwrite'
const bugsnagCliCommand = 'npm run bugsnag:upload-rn-android -- --overwrite'
common.run(bugsnagCliCommand, true)

// Finally, copy the APK back to the host
Expand Down Expand Up @@ -89,9 +89,16 @@ module.exports = {
// Clean and build the archive
common.changeDir(`${initialDir}/${fixturesDir}/${rnVersion}/ios`)
common.run(`rm -rf ../${rnVersion}.xcarchive`, true)
common.run('pod install || pod install --repo-update', true)
common.run('bundle install')
common.run('bundle exec pod install || bundle exec pod install --repo-update', true)
const buildCmd = `xcodebuild -workspace ${rnVersion}.xcworkspace -scheme ${rnVersion} -configuration Release -sdk iphoneos build`
common.run(buildCmd, true)
const archiveCmd = `xcrun xcodebuild -scheme "${rnVersion}" -workspace "${rnVersion}.xcworkspace" -configuration Release -archivePath "../${rnVersion}.xcarchive" -allowProvisioningUpdates archive`
common.run(archiveCmd, true)

common.changeDir(`${initialDir}/${fixturesDir}/${rnVersion}`)
const bugsnagCliCommand = 'npm run bugsnag:upload-rn-ios -- --overwrite'
common.run(bugsnagCliCommand, true)
} catch (e) {
console.error(e, e.stack)
process.exit(1)
Expand Down
4 changes: 2 additions & 2 deletions test/react-native-cli/features/fixtures/rn0_69/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
gem 'xcodeproj', '< 1.26.0'
gem 'cocoapods', '1.14.3'
gem 'xcodeproj', '< 1.26.0'
15 changes: 2 additions & 13 deletions test/react-native-cli/scripts/init-and-build-test.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
VERSION=$1
set -euo pipefail

function check_status {
if [[ $1 != 0 ]]; then
popd
exit $1
fi
}
VERSION=$1

# Build the app within Maze Runner, checking for the source map upload
mkdir -p build
pushd test/react-native-cli
bundle install
REACT_NATIVE_VERSION=$VERSION bundle exec maze-runner features/build-app-tests/build-ios-app.feature

# TODO: Reinstate as part of PLAT-6764
#check_status $?

# Export the IPA separately from MazeRunner (running it inside failed for an unknown reason)
cd features/fixtures
xcrun --log xcodebuild -exportArchive -archivePath "${VERSION}/${VERSION}.xcarchive" -exportPath output -verbose -exportOptionsPlist exportOptions.plist
check_status $?

# Clear the archive away
rm -rf ${VERSION}/${VERSION}.xcarchive

# Copy file to build directory, ensuring the exit code bubbles up
cp output/${VERSION}.ipa ../../../../build
STATUS=$?
popd
exit $STATUS
Loading