Skip to content

Commit bf3329e

Browse files
authored
Merge pull request #170 from getsentry/feature/tests
Add Appium Device Farm tests
2 parents e5bbe13 + 0f4d5c7 commit bf3329e

30 files changed

+866
-54
lines changed

.gitignore

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ Carthage/Checkouts
4848
**/Pods
4949

5050
# Fastlane
51-
fastlane/test_output/
52-
report.xml
53-
.env
51+
appium/fastlane/test_output/
52+
appium/fastlane/report.xml
53+
appium/.env
54+
appium/fastlane/README.md
55+
56+
# Appium
57+
58+
aws
59+
test_bundle.zip
60+
__pycache__
61+
.cache
62+
wheelhouse

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "ios/KSCrash"]
55
path = ios/KSCrash
66
url=https://github.com/kstenerud/KSCrash
7+
[submodule "examples"]
8+
path = examples
9+
url = https://github.com/getsentry/examples

.travis.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
matrix:
2+
include:
3+
- language: android
4+
os: linux
5+
jdk: oraclejdk8
6+
before_cache:
7+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
8+
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
9+
cache:
10+
directories:
11+
- $HOME/.yarn-cache
12+
- $HOME/.gradle/caches/
13+
- $HOME/.gradle/wrapper/
14+
sudo: required
15+
before_install:
16+
- nvm install 7
17+
- node --version
18+
- travis_retry curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
19+
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
20+
- travis_retry sudo apt-get update -qq
21+
- travis_retry sudo apt-get install -y -qq yarn
22+
android:
23+
components:
24+
- build-tools-23.0.1
25+
- android-23
26+
- extra-android-m2repository
27+
- extra-google-google_play_services
28+
- extra-google-m2repository
29+
- addon-google_apis-google-16
30+
script:
31+
- .travis/run.sh
32+
- language: objective-c
33+
os: osx
34+
osx_image: xcode8.3
35+
cache:
36+
- bundler
37+
- pip
38+
env:
39+
- LANE='ios'
40+
before_install:
41+
- brew update
42+
- brew install yarn
43+
- brew outdated yarn || brew upgrade yarn
44+
script:
45+
- .travis/run.sh
46+
notifications:
47+
email: false

.travis/run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
cd appium
3+
bundle install
4+
pip wheel --wheel-dir wheelhouse -r requirements.txt
5+
6+
if [ "$LANE" = "ios" ];
7+
then
8+
make test
9+
else
10+
make test-android
11+
fi

.vscode/.ropeproject/config.py

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# The default ``config.py``
2+
# flake8: noqa
3+
4+
5+
def set_prefs(prefs):
6+
"""This function is called before opening the project"""
7+
8+
# Specify which files and folders to ignore in the project.
9+
# Changes to ignored resources are not added to the history and
10+
# VCSs. Also they are not returned in `Project.get_files()`.
11+
# Note that ``?`` and ``*`` match all characters but slashes.
12+
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
13+
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
14+
# '.svn': matches 'pkg/.svn' and all of its children
15+
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
16+
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
17+
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
18+
'.hg', '.svn', '_svn', '.git', '.tox']
19+
20+
# Specifies which files should be considered python files. It is
21+
# useful when you have scripts inside your project. Only files
22+
# ending with ``.py`` are considered to be python files by
23+
# default.
24+
#prefs['python_files'] = ['*.py']
25+
26+
# Custom source folders: By default rope searches the project
27+
# for finding source folders (folders that should be searched
28+
# for finding modules). You can add paths to that list. Note
29+
# that rope guesses project source folders correctly most of the
30+
# time; use this if you have any problems.
31+
# The folders should be relative to project root and use '/' for
32+
# separating folders regardless of the platform rope is running on.
33+
# 'src/my_source_folder' for instance.
34+
#prefs.add('source_folders', 'src')
35+
36+
# You can extend python path for looking up modules
37+
#prefs.add('python_path', '~/python/')
38+
39+
# Should rope save object information or not.
40+
prefs['save_objectdb'] = True
41+
prefs['compress_objectdb'] = False
42+
43+
# If `True`, rope analyzes each module when it is being saved.
44+
prefs['automatic_soa'] = True
45+
# The depth of calls to follow in static object analysis
46+
prefs['soa_followed_calls'] = 0
47+
48+
# If `False` when running modules or unit tests "dynamic object
49+
# analysis" is turned off. This makes them much faster.
50+
prefs['perform_doa'] = True
51+
52+
# Rope can check the validity of its object DB when running.
53+
prefs['validate_objectdb'] = True
54+
55+
# How many undos to hold?
56+
prefs['max_history_items'] = 32
57+
58+
# Shows whether to save history across sessions.
59+
prefs['save_history'] = True
60+
prefs['compress_history'] = False
61+
62+
# Set the number spaces used for indenting. According to
63+
# :PEP:`8`, it is best to use 4 spaces. Since most of rope's
64+
# unit-tests use 4 spaces it is more reliable, too.
65+
prefs['indent_size'] = 4
66+
67+
# Builtin and c-extension modules that are allowed to be imported
68+
# and inspected by rope.
69+
prefs['extension_modules'] = []
70+
71+
# Add all standard c-extensions to extension_modules list.
72+
prefs['import_dynload_stdmods'] = True
73+
74+
# If `True` modules with syntax errors are considered to be empty.
75+
# The default value is `False`; When `False` syntax errors raise
76+
# `rope.base.exceptions.ModuleSyntaxError` exception.
77+
prefs['ignore_syntax_errors'] = False
78+
79+
# If `True`, rope ignores unresolvable imports. Otherwise, they
80+
# appear in the importing namespace.
81+
prefs['ignore_bad_imports'] = False
82+
83+
# If `True`, rope will insert new module imports as
84+
# `from <package> import <module>` by default.
85+
prefs['prefer_module_from_imports'] = False
86+
87+
# If `True`, rope will transform a comma list of imports into
88+
# multiple separate import statements when organizing
89+
# imports.
90+
prefs['split_imports'] = False
91+
92+
# If `True`, rope will sort imports alphabetically by module name
93+
# instead of alphabetically by import statement, with from imports
94+
# after normal imports.
95+
prefs['sort_imports_alphabetically'] = False
96+
97+
98+
def project_opened(project):
99+
"""This function is called after opening the project"""
100+
# Do whatever you like here!

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"files.trimTrailingWhitespace": true,
33
"files.ensureSingleFinalNewline": true,
44

5+
"python.linting.pylintEnabled": false,
6+
57
"prettier.bracketSpacing": false,
68
"prettier.singleQuote": true,
79
"prettier.printWidth": 90,

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
44
</a>
55
<br/>
6-
<h1>react-native-sentry</h1>
6+
<h1>Sentry SDK for React Native</h1>
77
</p>
88

9+
[![Travis](https://img.shields.io/travis/getsentry/react-native-sentry.svg?maxAge=2592000)](https://travis-ci.org/getsentry/react-native-sentry)
910
[![npm version](https://img.shields.io/npm/v/react-native-sentry.svg)](https://www.npmjs.com/package/react-native-sentry)
1011
[![npm dm](https://img.shields.io/npm/dm/react-native-sentry.svg)](https://www.npmjs.com/package/react-native-sentry)
1112
[![npm dt](https://img.shields.io/npm/dt/react-native-sentry.svg)](https://www.npmjs.com/package/react-native-sentry)

SentryReactNative.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Pod::Spec.new do |s|
1818
s.preserve_paths = '*.js'
1919

2020
s.dependency 'React'
21-
s.dependency 'Sentry', '~> 3.1.3'
22-
s.dependency 'Sentry/KSCrash', '~> 3.1.3'
21+
s.dependency 'Sentry', '~> 3.3.3'
22+
s.dependency 'Sentry/KSCrash', '~> 3.3.3'
2323

2424
s.source_files = 'ios/RNSentry*.{h,m}'
2525
s.public_header_files = 'ios/RNSentry.h'

android/src/main/java/io/sentry/RNSentryEventEmitter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
public class RNSentryEventEmitter extends ReactContextBaseJavaModule {
1212

1313
public static final String SENTRY_EVENT_SENT_SUCCESSFULLY = "Sentry/eventSentSuccessfully";
14+
public static final String SENTRY_EVENT_STORED = "Sentry/eventStored";
1415

1516
public RNSentryEventEmitter(ReactApplicationContext reactContext) {
1617
super(reactContext);
@@ -25,6 +26,7 @@ public String getName() {
2526
public Map<String, Object> getConstants() {
2627
final Map<String, Object> constants = new HashMap<>();
2728
constants.put("EVENT_SENT_SUCCESSFULLY", SENTRY_EVENT_SENT_SUCCESSFULLY);
29+
constants.put("EVENT_STORED", SENTRY_EVENT_STORED);
2830
return constants;
2931
}
3032

android/src/main/java/io/sentry/RNSentryModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ public void captureEvent(ReadableMap event) {
231231
}
232232

233233
Sentry.capture(buildEvent(eventBuilder));
234+
RNSentryEventEmitter.sendEvent(reactContext, RNSentryEventEmitter.SENTRY_EVENT_STORED, new WritableNativeMap());
234235
}
235236

236237
@ReactMethod

0 commit comments

Comments
 (0)