-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xcode): Only parse Plist when required during RN source maps uplo…
…ad (#1940)
- Loading branch information
1 parent
26da328
commit 5657d86
Showing
8 changed files
with
108 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/integration/_cases/react_native/xcode-upload-source-maps-invalid-plist.trycmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
``` | ||
$ CONFIGURATION=Release sentry-cli react-native xcode tests/integration/_fixtures/react_native/react-native-xcode.sh --force-foreground | ||
? failed | ||
react-native-xcode.sh called with args: | ||
Using React Native Packager bundle and source map. | ||
Processing react-native sourcemaps for Sentry upload. | ||
> Analyzing 2 sources | ||
> Rewriting sources | ||
> Adding source map references | ||
error: Info.plist was not found or an parsing error occurred | ||
|
||
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. | ||
Please attach the full debug log to all bug reports. | ||
|
||
``` |
26 changes: 26 additions & 0 deletions
26
...integration/_cases/react_native/xcode-upload-source-maps-release_and_dist_from_env.trycmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
``` | ||
$ CONFIGURATION=Release SENTRY_RELEASE=test-release SENTRY_DIST=test-dist sentry-cli react-native xcode tests/integration/_fixtures/react_native/react-native-xcode.sh --force-foreground | ||
? success | ||
react-native-xcode.sh called with args: | ||
Using React Native Packager bundle and source map. | ||
Processing react-native sourcemaps for Sentry upload. | ||
> Analyzing 2 sources | ||
> Rewriting sources | ||
> Adding source map references | ||
> Bundled 2 files for upload | ||
> Bundle ID: [..]-[..]-[..]-[..]-[..] | ||
> Uploaded files to Sentry | ||
> File upload complete (processing pending on server) | ||
> Organization: wat-org | ||
> Project: wat-project | ||
> Release: test-release | ||
> Dist: test-dist | ||
> Upload type: artifact bundle | ||
|
||
Source Map Upload Report | ||
Scripts | ||
~/react-native-xcode-bundle.js.map | ||
Minified Scripts | ||
~/react-native-xcode-bundle.js (sourcemap at react-native-xcode-bundle.map) | ||
|
||
``` |
3 changes: 3 additions & 0 deletions
3
tests/integration/_fixtures/react_native/react-native-xcode-bundle.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tests/integration/_fixtures/react_native/react-native-xcode-bundle.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
tests/integration/_fixtures/react_native/react-native-xcode.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
echo "react-native-xcode.sh called with args: $@" | ||
|
||
echo '{ | ||
"packager_bundle_path": "tests/integration/_fixtures/react_native/react-native-xcode-bundle.js", | ||
"packager_sourcemap_path": "tests/integration/_fixtures/react_native/react-native-xcode-bundle.js.map" | ||
}' > "$SENTRY_RN_SOURCEMAP_REPORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#[cfg(target_os = "macos")] | ||
use crate::integration::register_test; | ||
#[cfg(target_os = "macos")] | ||
use crate::integration::{mock_common_upload_endpoints, ChunkOptions, ServerBehavior}; | ||
#[cfg(target_os = "macos")] | ||
use mockito::Mock; | ||
|
||
#[test] | ||
#[cfg(target_os = "macos")] | ||
fn xcode_upload_source_maps_missing_plist() { | ||
let _upload_endpoints = | ||
mock_common_upload_endpoints(ServerBehavior::Modern, ChunkOptions::default()); | ||
register_test("react_native/xcode-upload-source-maps-invalid-plist.trycmd"); | ||
} | ||
|
||
#[test] | ||
#[cfg(target_os = "macos")] | ||
fn xcode_upload_source_maps_release_and_dist_from_env() { | ||
let upload_endpoints = | ||
mock_common_upload_endpoints(ServerBehavior::Modern, ChunkOptions::default()); | ||
register_test("react_native/xcode-upload-source-maps-release_and_dist_from_env.trycmd"); | ||
assert_endpoints(&upload_endpoints); | ||
} | ||
|
||
#[cfg(target_os = "macos")] | ||
pub fn assert_endpoints(mocks: &[Mock]) { | ||
for mock in mocks { | ||
mock.assert(); | ||
} | ||
} |