Open Bug 1482008 Opened 6 years ago Updated 2 years ago

Enable all tests in adb_test.js on Windows

Categories

(DevTools :: about:debugging, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: hiro, Unassigned, NeedInfo)

References

Details

Attachments

(4 files)

We will skip three test cases in test_adb.js on Windows in bug 1469054. This bug is for the purpose of enabling them.
I had totally forgotten that Windows doesn't have fork(). We should add another python module (adb-server.py?) and use spawn with P_DETACH instead. [1] https://docs.python.org/2.6/library/os.html#os.P_DETACH
Another problem I noticed is that it seems that 'adb.exe' should be a binary on Windows, in the test cases we use a python script 'adb.py' as 'adb.exe', it can't be launched. I'd want to avoid modifying implementation only for the test cases, so I did start writing a simple program in C++ that the program uses nsIProcess.run, but it needs to link libxul.so and I haven't succeeded to do that. This morning, I came up with another idea that is to write the program in Rust! It should work.
While writing the rust program on Windows, I noticed on Windows we need to run adb-server.py with 'Python.exe' because I guess shebang doesn't work on Windows either. So we can probably write the program in Python rather than Rust.
'adb.py' which is pretending 'adb.exe' doesn't work on Windows because Windows thinks the 'adb.exe' is a 16-bit apllication so that it cannot be launched on Windows 64. Instead the Rust program works fine there. A rest of issues is how to build the Rust program in our tree.
Depends on: 1483730
(In reply to Hiroyuki Ikezoe (:hiro) (PTO on Aug 20) from comment #5) > But it failed to build on MacOSX. > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=fedfd032d93c759f2032501ae2086c3df476f982&selectedJob=1 > 94222595 The error is; error: failed to run dsymutil: No such file or directory (os error 2) And it seems to be the same as bug 951758. And from a comment by Ted in bug 951758 comment 3; > Comments in the clang source indicate that it runs dsymutil when you compile and link in one command line (like `clang -o foo foo.cpp`) because otherwise the debug info would be lost in the temp object file: So I guess, if we build the adb fake binary as an opt build even if it's on debug build, we can avoid the error.
Depends on: 1485164
I did split the single source file (adb.rb) into two files, but it still failed [1]. https://treeherder.mozilla.org/#/jobs?repo=try&author=hikezoe@mozilla.com&selectedJob=195004452
Depends on: 1417646
Cross-compiling the adb binary for MacOSX works fine with a patch for bug 1417646, but there is another failure in repackage job; https://treeherder.mozilla.org/#/jobs?repo=try&revision=ad80893bf1e76de1cfc24b02350d7ecb48e69de0&selectedJob=195436341
Finally I found a workaround to avoid the "KeyError: u'RUST_TARGET" on L10n or Rpk jobs in bug 1341041 comment 3. It's `CONFIG['COMPILE_ENVIRONMENT']` check. https://treeherder.mozilla.org/#/jobs?repo=try&revision=273a9c930ce95753cd5940ab639447b3881050fb
The fake adb binary just spawns adb-server.py which is a mock of adb for automation tests. Originally the python script was supposed to be spawned as 'adb.exe' from JS on Windows but it didn't work for some reasons (exe file should have specific header, I guess). So here we introduce a Rust program behaves just like what 'adb start-server' does.
Also rename adb.py to adb-server.py since now it just behaves as an adb server. Depends on D5487
Comment on attachment 9007945 [details] Bug 1482008 - Use readInputStream instead of readInputStreamString to support binary files. r=jdescottes Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007945 - Flags: review+
Comment on attachment 9007946 [details] Bug 1482008 - Use the fake adb binary in tests. r=jdescottes Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007946 - Flags: review+
Comment on attachment 9007947 [details] Bug 1482008 - Enable testStartAndStop and testTrackDevices on Windows. r=jdescottes Julian Descottes [:jdescottes][:julian] has approved the revision.
Attachment #9007947 - Flags: review+
Comment on attachment 9007944 [details] Bug 1482008 - Build a fake adb binary written in Rust. r=glandium Mike Hommey [:glandium] has approved the revision.
Attachment #9007944 - Flags: review+
Priority: -- → P3

This bug has not been updated in the last 3 months. Resetting the assignee field.
Please, feel free to pick it up again and add a comment outlining your plans for it if you do still intend to work on it.
This is just trying to clean our backlog of bugs and make bugs available for people.

Assignee: hikezoe → nobody
Status: ASSIGNED → NEW

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:hiro, could you have a look please?

Flags: needinfo?(hikezoe)

Huh, I don't recall what the blocker was for landing... Will check later.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: