google / shipshape

Program analysis platform
Apache License 2.0
269 stars 35 forks source link

"end_to_end_test.sh local" fails with "AndroidLint failed to run" #27

Closed clconway closed 9 years ago

clconway commented 9 years ago

The linter binary should be at /android-sdk-linux/tools/lint, but it's disappearing during the Docker build:

clconway commented 9 years ago

(Oops, submitted by accident somehow)

Here's the error that's causing the dir to disappear:

$ docker run -i -t e38c093793c8
root@5bf2ee09e291:/# android update sdk --no-ui --filter tools
...
Installing Archives:
  Preparing to install archives
  Downloading Android SDK Tools, revision 24.1.2
  Installing Android SDK Tools, revision 24.1.2
  Failed to rename directory /android-sdk-linux/tools to /android-sdk-linux/temp/ToolPackage.old01.
  Failed to create directory /android-sdk-linux/tools
  Done. Nothing was installed.
root@5bf2ee09e291:/# ls -l /android-sdk-linux/tools
ls -l /android-sdk-linux/tools
total 0

A relevant SO thread: http://stackoverflow.com/questions/8839255/failed-to-rename-directory-tools-to-temp-toolpackage-old01-in-c-android-sdk-win

None of the top answers helped, but just unzipping the tools ZIP myself seems to work.

clconway commented 9 years ago

Here's the issue in the Android SDK bug tracker: https://code.google.com/p/android/issues/detail?id=4410

clconway commented 9 years ago

We're now seeing similar failures on Jenkins: https://jenkins-dot-shipshapecode.appspot.com/job/shipshape_end-to-end_test/5/ This seems to require a slightly different (and incompatible) workaround...

Inside the Java dev container, we get

# docker exec android_lint_0 ls /android-sdk-linux/tools/            
tools
# docker exec android_lint_0 ls /android-sdk-linux/tools/tools/
NOTICE.txt
android
ant
apps
...

The culprit seems to be this line in the Dockerfile:

RUN unzip /android-sdk-linux/temp/tools_*-linux.zip -d /android-sdk-linux/tools

Somehow this behaves differently on the Jenkins slave than it does on Travis.

clconway commented 9 years ago

Oops, stupid me. The problem here isn't Travis, it's the local end_to_end_test.sh script.

Travis is passing with the fix: https://travis-ci.org/google/shipshape/builds/60447010

The local script fails with a different error: WARNING: Analyzer AndroidLint failed to run: The triggered category "AndroidLint" could not be found at the locations [localhost:10005 localhost:10006]

emsod commented 9 years ago

This is happening because the end-to-end test is starting a shipping container without any analyzer services (i.e. not AndroidLint container) to run the first couple of tests (JSHint etc.). Then a second run is started where shipshape is called with an analyzer service as a flag. However, now a shipping container is running (not killed at end of last run due to the default of the stay_up flag being true) and it has not been started with the analyzer service. To make the shipping container aware of a new analyzer service we need to restart it if a new service is given when shipshape is started.

emsod commented 9 years ago

There is now a check which restarts the shipping container if it does not have a link to needed analyzer containers (like AndroidLint). Closing this issue.