-
Notifications
You must be signed in to change notification settings - Fork 37
Adds feature to filter monkey by intent category #90
Conversation
- moves monkey testing into new activity with specified intent ONLY_ME
@@ -15,12 +16,29 @@ class Monkey extends AdbTask { | |||
|
|||
@TaskAction | |||
void exec() { | |||
def arguments = ['shell', 'monkey', '-p', packageName, '-v', getEvents()] | |||
def arguments = ['shell', 'monkey', '-p', packageName] |
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 might just split the '-p' and packageName ones out onto the next line too, for consistency
e.g.
arguments += ['-p', packageName]
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.
👍 for separating the flags with their inputs
def arguments = [
'shell',
'monkey',
'-p', packageName
]
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.
👍
few small comments, agree with @jonreeve otherwise LGTM 👍 |
} | ||
|
||
@TaskAction | ||
void exec() { | ||
def arguments = ['shell', 'monkey', '-p', packageName, '-v', getEvents()] |
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.
👍
LGTM 👍 |
👍 |
Adds feature to filter monkey by intent category
@@ -5,12 +5,16 @@ import org.gradle.api.Project | |||
|
|||
public class AndroidCommandPluginExtension { | |||
|
|||
static final String CATEGORIES_DEFAULT = '' |
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.
What a default is an empty category? Would that work at all with the '-c' ?
Should be inlined imho.
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.
Yeah from the monkey docs an empty category is treated like the default categories. Right now the default is category of launcher or monkey.
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 shouldn't set the -c
when there is no category.
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.
but doing a blank -c allows the adb command to use the default categories (the same as not setting it)
deviceId ?: defaultDeviceId() | ||
} | ||
|
||
// prefer system property over direct setting to enable commandline arguments |
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 think this is still a valuable comment. Why did you remove it? Is it obvious that the ordering here is related to overriding properties on the command line?
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.
Comments should be removed only if obsolete. This is not the case, right?
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.
When changing from double elvis operator I find it quiet obvious what the if else statement does.
If we want to go back to one-line solution then yes, I think that comment is still needed.
This PR Adds feature to filter monkey by intent category.
It's done by adding
'-c' INTENT_FILTER
to the shell command.Default to the monkeys normal categories if
-c
not specifiedPaired with @blundell