Skip to content

Commit 7ca8e0e

Browse files
bestanderFacebook Github Bot 0
authored andcommitted
Stabilized TestIdTestApp integration test
Summary: - TestIdTestModule instrumentation tests is responsible for too many occasional crashes, e.g. https://circleci.com/gh/facebook/react-native/7054. This should fix the problem (will monitor over next week) - Made file naming more consistent - 5 retries don't make e2e tests more stable, reduced back to 3 but I need to investigate how to make it more reliable Closes react#7784 Differential Revision: D3354444 fbshipit-source-id: d058362edbec09522a4828998e01988a82a74487
1 parent a96fcc7 commit 7ca8e0e

6 files changed

Lines changed: 15 additions & 7 deletions

File tree

ReactAndroid/src/androidTest/java/com/facebook/react/tests/TestIdTestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ protected String getReactApplicationKeyUnderTest() {
4646
"Toolbar",
4747
"TextInput",
4848
"View",
49-
"WebView",
50-
"ScrollView Item (same id used for all items)");
49+
// "WebView", TODO t11449130
50+
"ScrollView Item (same id used for all items)"
51+
);
5152

5253
public void testPropertyIsSetForViews() {
5354
for (String tag : viewTags) {

ReactAndroid/src/androidTest/js/TestIdTestModule.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ var TestIdTestApp = React.createClass({
111111

112112
<View testID="View" />
113113

114-
<WebView
114+
{/*
115+
Webview gets tests crashing or stalling occasionally
116+
e.g. https://circleci.com/gh/facebook/react-native/7054
117+
TODO t11449130
118+
<WebView
115119
testID="WebView"
116120
url={'http://newsroom.fb.com'}
117121
renderError={() => <View /> }
118122
style={styles.base}
119-
/>
123+
/>*/}
120124

121125
</View>
122126
);

circle.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test:
4747
- source scripts/circle-ci-android-setup.sh && waitForAVD
4848

4949
override:
50+
# TODO flow is disabled see t11343811 and 0.25.1
5051
# eslint bot
5152
# - cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
5253
# JS tests for dependencies installed with npm3
@@ -69,14 +70,14 @@ test:
6970
# build test APK
7071
- buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1
7172
# run installed apk with tests
72-
- node ./scripts/run-ci-android-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
73+
- node ./scripts/run-android-ci-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
7374

7475
- ./gradlew :ReactAndroid:testDebugUnitTest
7576
# Deprecated: these tests are executed using Buck above, while we support Gradle we just make sure the test code compiles
7677
- ./gradlew :ReactAndroid:assembleDebugAndroidTest
7778

7879
# Android e2e test
79-
- node ./scripts/run-ci-e2e-tests.js --android --js --retries 5
80+
- node ./scripts/run-ci-e2e-tests.js --android --js --retries 3
8081

8182
# testing docs generation is not broken
8283
- cd website && node ./server/generate.js

scripts/run-ci-android-instrumentation-tests.js renamed to scripts/run-android-ci-instrumentation-tests.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ let exitCode = 0;
4242
testClasses.forEach((testClass) => {
4343
if (tryExecNTimes(
4444
() => {
45+
echo(`Starting ${testClass}`);
46+
// any faster means Circle CI crashes
4547
exec('sleep 10s');
46-
return exec(`./scripts/run-android-instrumentation-tests.sh ${argv.package} ${testClass}`).code;
48+
return exec(`./scripts/run-instrumentation-tests-via-adb-shell.sh ${argv.package} ${testClass}`).code;
4749
},
4850
numberOfRetries)) {
4951
echo(`${testClass} failed ${numberOfRetries} times`);
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)