Closed Bug 970994 Opened 11 years ago Closed 10 years ago

Unable to enable NSPR logs on Android 4.0 Opt mochitest: MOZ_UPLOAD_DIR not defined

Categories

(Testing :: General, defect)

x86_64
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=34460209&tree=Try&full=1#error1 19:00:25 INFO - Mochi-Remote ERROR | Automation Error: Exception caught while running tests 19:00:25 INFO - Traceback (most recent call last): 19:00:25 INFO - File "/builds/panda-0097/test/build/tests/mochitest/runtestsremote.py", line 731, in main 19:00:25 INFO - retVal = mochitest.runTests(options) 19:00:25 INFO - File "/builds/panda-0097/test/build/tests/mochitest/runtests.py", line 1069, in runTests 19:00:25 INFO - with zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED) as logzip: 19:00:25 INFO - KeyError: 'MOZ_UPLOAD_DIR'
Blocks: 968200
Assignee: nobody → gbrown
Summary: Unable to enable NSPR logs on Android 4.0 Opt: MOZ_UPLOAD_DIR not defined → Unable to enable NSPR logs on Android 4.0 Opt mochitest: MOZ_UPLOAD_DIR not defined
MOZ_UPLOAD_DIR is defined in the runtestsremote.py environment: 18:54:59 INFO - ENV: MOZ_UPLOAD_DIR is now /builds/panda-0097/test/build/blobber_upload_dir but for remote tests, browserEnv does not inherit the runtestsremote.py environment.
I had a few problems getting NSPR logs in bug 968200. Setting MOZ_UPLOAD_DIR correctly is one issue, but there is also no remote support -- no existing support for pulling the logs from the device. One solution here would be to pull the remote files and dump them in MOZ_UPLOAD_DIR; a simpler approach would be to define NSPR_LOG_MODULES but not define NSPR_LOG_FILE (probably on Android only), which should dump the requested logging info to stdout / logcat ... which is being saved to blobber now anyway.
To get NSPR logs for Android, this patch sets NSPR_LOG_FILE to a file in a new remote directory, <test-root>/nspr. For mochitests, the log file is named "nspr.log"; for robocop, since there will be a new log for each test, the log file is named "nspr-<testname>.log". At the end of the test run, the nspr directory contents are pulled to the MOZ_UPLOAD_DIR and blobber takes care of the rest. This is what it ends up looking like: https://tbpl.mozilla.org/?tree=Try&rev=d5dec9b651fd
Attachment #8472445 - Flags: review?(dminor)
Comment on attachment 8472445 [details] [diff] [review] Add NSPR log support for Android mochitests Review of attachment 8472445 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me.
Attachment #8472445 - Flags: review?(dminor) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Depends on: 1059293
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: