-
-
Notifications
You must be signed in to change notification settings - Fork 61
test(react-native): Add E2E iOS Tests for React Native #889
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
Conversation
# Conflicts: # e2e-tests/tests/react-native.test.ts
Adding a couple of missing declarations in the fork made the tests to run successfully on CI in strict mode 🎉 The next step would be to come up with a solution that doesn't require forking https://github.com/apache/cordova-node-xcode |
There was a problem hiding this 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 adds E2E tests for the iOS React Native wizard modifications to verify that key configuration files are added and that the xcode project is updated correctly.
- Adds tests for verifying the existence and contents of ios/sentry.properties and android/sentry.properties.
- Adds tests to check that the xcode project includes the expected Sentry build phase script updates.
- Updates the CI workflow configuration to run React-Native wizard tests on macos-15.
Reviewed Changes
Copilot reviewed 6 out of 15 changed files in this pull request and generated no comments.
File | Description |
---|---|
e2e-tests/tests/react-native.test.ts | Added tests for iOS sentry.properties, pod install prompt, prettier prompt, and xcode project updates. |
e2e-tests/test-applications/react-native-test-app/ios/AppDelegate.swift | Added a Swift AppDelegate leveraging React Native dependencies. |
e2e-tests/test-applications/react-native-test-app/ios/Podfile | Added Podfile for proper React Native iOS project configuration. |
.github/workflows/build.yml | Modified CI workflow to include/exclude React-Native wizard tests on macos-15. |
Files not reviewed (9)
- e2e-tests/test-applications/react-native-test-app/ios/.xcode.env: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078.xcodeproj/xcshareddata/xcschemes/reactnative078.xcscheme: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078/Images.xcassets/AppIcon.appiconset/Contents.json: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078/Images.xcassets/Contents.json: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078/Info.plist: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078/LaunchScreen.storyboard: Language not supported
- e2e-tests/test-applications/react-native-test-app/ios/reactnative078/PrivacyInfo.xcprivacy: Language not supported
- package.json: Language not supported
- patches/xcode+3.0.1.patch: Language not supported
Comments suppressed due to low confidence (2)
e2e-tests/tests/react-native.test.ts:32
- [nitpick] The comment does not accurately reflect the action. Update the comment to something like '// Prompt for pod install execution' since the prompt asks 'Do you want to run
pod install
now?'.
// Enable feedback widget
e2e-tests/tests/react-native.test.ts:47
- [nitpick] The inline comment contradicts the prompt message regarding Prettier. Consider updating it to '// Prompt for running Prettier' to clarify the expected action.
// Skip pod install
.github/workflows/build.yml
Outdated
- wizard: React-Native | ||
include: | ||
- wizard: React-Native | ||
os: macos-15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running on ubuntu-latest
will make the pod-install
step to be skipped and the test to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run the test with pod-install -> no
on ubuntu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that there is no pod-install
prompt and the test is stuck waiting. I'll check if I can make this check conditional 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the build.yml
change and optionally skipped the pod-install
check and iOS tests.
patches/xcode+3.0.1.patch
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patching was needed to fix the CI failure as described in #889 (comment)
Probably this also fixes failures in environments similar to our CI setup too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we were unable to reproduce this locally, it's okay to patch the lib for the E2E tests, but if we get any reports of this or we will be able to reproduce this in the future we need to fix the Xcode lib or migrate to a new supported lib (for example bacons/xcode).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
The test looks good, I just have a two questions about the post install script and one about the run on linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Looks good, thank you for adding the E2E tests.
Based on: #884
Part of #856
Description
This PR aims to test the iOS React Native wizard modification:
✅ xcode project is updated correctly
addBuildPhase
(library implementation) execution fails (stucks) on CI. Note that all tests complete successfully locally.xcode
library with 1d404ec using patch-package resolved the issues described in test(react-native): Add E2E iOS Tests for React Native #889 (comment)✅
ios/sentry.properties
is addedTo test locally run:
yarn test:e2e React-Native
#skip-changelog