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

Fix CI tests #85

Merged
merged 10 commits into from
Sep 17, 2017
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 21 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
language: android
dist: trusty

android:
components:
- tools # Tools
- platform-tools # Platform tools
- build-tools-26.0.1 # Build tools version
- android-26 # Target SDK version
- extra-android-m2repository # Support repo
- sys-img-x86-android-18 # Emulator
# Update tools and then platform-tools explicitly so lint gets an updated database. Can be removed once 3.0 is out.
- tools
- platform-tools

jdk:
- oraclejdk8

# Disabled, see https://github.com/uber/AutoDispose/issues/81
#before_script:
# # Create and start an emulator for instrumentation tests.
# - echo no | avdmanager create avd -f -n test -k "system-images;android-18;google_apis;x86"
# - emulator -avd test -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82
before_install:
# Install SDK license so Android Gradle plugin can install deps.
- mkdir "$ANDROID_HOME/licenses" || true
- echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should move this sha to the travis ci env variables in the job setup

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Install the rest of tools (e.g., avdmanager)
- sdkmanager tools
# Install the system image
- sdkmanager "system-images;android-18;default;armeabi-v7a"
# Create and start emulator for the script. Meant to race the install task.
- echo no | avdmanager create avd --force -n test -k "system-images;android-18;default;armeabi-v7a"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window > /dev/null 2>&1 &

install: ./gradlew clean assemble assembleAndroidTest --stacktrace

before_script:
- android-wait-for-emulator
- adb shell input keyevent 82

script:
- ./gradlew build
# - ./gradlew :autodispose-android:connectedAndroidTest -PdisablePreDex --continue --stacktrace
# - ./gradlew :autodispose-android-archcomponents:connectedAndroidTest -PdisablePreDex --continue --stacktrace
- ./gradlew check connectedCheck --stacktrace

#after_success:
# - .buildscript/deploy_snapshot.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.view.View;
import android.widget.FrameLayout;

@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/19
public final class AutoDisposeTestActivity extends Activity {
FrameLayout parent;
View child;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

import static com.google.common.truth.Truth.assertThat;

@RunWith(AndroidJUnit4.class) public final class ViewScopeProviderTest {
@RunWith(AndroidJUnit4.class)
@SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/18
public final class ViewScopeProviderTest {

private static final RecordingObserver.Logger LOGGER = new RecordingObserver.Logger() {
@Override public void log(String message) {
Expand Down