-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Find devices for 'android.attached' based on 'adbName' pattern #2169
Conversation
@d4vidi, let's look together into this. |
Preliminary speaking, looks good to me, except maybe for 1-2 very minor things. I'll give it a try locally. |
nice one - hope to have a look soon! |
I noticed that when enabling artifacts (logs, videos), Detox fails to save them when running in parallel mode.
From the output I can see that it doesn't pass |
@DmytroKost I've revisited this now and I feel there are 2 things to consider.
|
@d4vidi, I'm about to review this today or maximum — tomorrow. As for your question 2 — well, I was considering also RegExp-based solution. This way we can elegantly solve many cases:
What do you think? |
@d4vidi Yes, I can do that. Any insight into why artifacts don't work properly with multi-attached devices? #2169 (comment) |
Cannot deliver my promise to review it the PR yesterday, obviously, have to repromise that for tomorrow. |
cbaee76
to
5f5d220
Compare
@d4vidi @noomorph I've made the following changes:
|
Pull Request Test Coverage Report for Build 2499
💛 - Coveralls |
@DmytroKost , if you don't mind, could you remerge master again into your branch, please? |
bdd2ff5
to
aeb47da
Compare
Done. |
@DmytroKost, I think it makes sense to add:
At the very least, let's add some |
6cfca86
to
41ef564
Compare
@noomorph Updated the docs and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fairly good to me. I think I'll have today time to go through all the pull request. @d4vidi, don't forget to look too, if possible - and if not, I hope you don't mind if I approve it soon.
@DmytroKost , see my suggestions in DmytroKost#1 |
Sorry, 'been overly booked in the last couple of days. I'll try my best to review asap. |
'Promise to review this this week, probably within a day or 2! |
@@ -51,6 +51,14 @@ module.exports = { | |||
"device": { | |||
"avdName": "Pixel_API_28" | |||
} | |||
}, | |||
"android.att.release": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps change to android.genymotion.release
? a bit confusing to see both attached
and the emulator-.*
regexp in the same config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked @DmytroKost first of all to add it for the testing purposes. I am sure that Genymotion emulators do not follow emulator-<port>
naming (!). But we can add some Genymotionish configuration as well, separately.
@d4vidi, probably, you are right in a sense that it could be better if we rename it to, let's say, android.any.release
(att -> any), and use .*
instead of emulator-.*
. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We connect to Genymotion via SSH tunnel, the names of devices will be localhost:5555
, localhost:5556
, .etc.
I can make an example for android.genymotion.release
to demonstrate that, and one for android.any.release
with a .*
mark to demonstrate connection to any attached device/emulator. I thought detox.config.js
for also for demo purposes. But since it's for testing, I'm not sure I should make any changes to it.
I also mentioned the example with a remote device in https://github.com/DmytroKost/Detox/blob/uic/adb-name-array/docs/APIRef.Configuration.md#device-configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d4vidi, your call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d4vidi , @DmytroKost , let's change it to ".*" and rename to any
instead of att
. It is just for local testing at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any progress here? @d4vidi, is the .*
suggestion okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why .*
? does it really make sense to match all-the-things? How about we negate emulator-
? (?!(emulator))
, I believe...
Anyways on 2nd thought no point in adding an extra genymotion config here - I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or iso negating, assert that it's a remotely connected device with this pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DmytroKost , I think @d4vidi suggests to copy I hope I've managed to convey the message. |
detox/src/devices/drivers/android/attached/AttachedAndroidDriver.js
Outdated
Show resolved
Hide resolved
@DmytroKost please rebase your branch over Detox' latest master. I believe this should solve CI issues. |
@d4vidi I merged
|
For running parallel tests on attached devices
Ignore emulators and devices that aren't on the list
Artifact manager needs deviceId
… on 'adbName' pattern" - src/devices/drivers - DeviceDriverBase.js - android - AndroidDriver.js - attached - AttachedAndroidDriver.js - FreeAdbDeviceFinder.js - emulator - EmulatorDriver.js - FreeEmulatorFinder.js DriverRegistry resolves: - 'android.emulator': EmulatorDriver - EmulatorDriver.acquireFreeDevice - AndroidDriver.allocateDevice - ABSTRACT AndroidDriver.doAllocateDevice -> IMPL EmulatorDriver.doAllocateDevice - FreeEmulatorFinder.findFreeDevice -> SUPER FreeDeviceFinderBase.findFreeDevice - ABSTRACT FreeDeviceFinderBase.isDeviceMatching -> IMPL FreeEmulatorFinder.isDeviceMatching - 'android.attached': AttachedAndroidDriver - AttachedAndroidDriver.acquireFreeDevice - AndroidDriver.allocateDevice - ABSTRACT AndroidDriver.doAllocateDevice -> IMPL AttachedAndroidDriver.doAllocateDevice - FreeAdbDeviceFinder.findFreeDevice -> SUPER FreeDeviceFinderBase.findFreeDevice - ABSTRACT FreeDeviceFinderBase.isDeviceMatching -> IMPL FreeAdbDeviceFinder.isDeviceMatching
- Renamed FreeDeviceFinderBase to FreeDeviceFinder - Removed FreeAdbDeviceFinder - FreeDeviceFinder._isDeviceMatching tests candidate's adbName against a regex by default (copied the implementation from FreeAdbDeviceFinder._isDeviceMatching) - FreeEmulatorFinder extends FreeDeviceFinder and overrides _isDeviceMatching - Moved the unit test from FreeAdbDeviceFinder.test.js to FreeDeviceFinder.test.js and removed FreeAdbDeviceFinder.test.js - FreeEmulatorFinder.test.js tests only the _isDeviceMatching override through the public method findFreeDevice
a452c6e
to
ecc785d
Compare
@d4vidi Rebased on master |
Hopefully fix CI stability by "creating" emulator devices from within device-registry's user allocation func
Green at last!!! I will continue going over this tomorrow, and - hopefully, merge, as well. |
For running parallel tests on attached devices
Description:
I want to be able to run parallel tests on multiple attached Android devices (e.g. Genymotion). Currently, the
android.attached
configuration type accepts only oneadbName
.