Skip to content

Conversation

@VladislavSumin
Copy link
Contributor

@VladislavSumin VladislavSumin commented Nov 11, 2022

Add Kaspresso plugin to implement issue #247

What changed:

  • Remove old enableFeaturePreview for features that enabled by default
  • Rename compose-support && allure-support to satisfy gradle conventions
  • Samples moved to separate projects (this need to make possible apply plugins from root kaspresso project
  • Add new plugin that automatically run Desktop server when running connected tests
  • Implement new plugin to all samples
  • Move test apks to samples/artifacts folder
  • update cirrus ci (now no running desktop server manually).

Out of scope for current pr:

  • setup plugin publish to gradle portal
  • write documentation (we write it on next pr with publish setup)

@CLAassistant
Copy link

CLAassistant commented Nov 11, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Vladislav Sumin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Nikitae57
Nikitae57 previously approved these changes Nov 15, 2022
logger.d("The created adbCommand=$adbCommand")
cmdCommandPerformer.perform(adbCommand)
val adbCommand = "${ adbServerPort?.let { "-P $adbServerPort " } ?: "" }-s $deviceName ${command.body}"
logger.d("The created adbCommand=adb $adbCommand")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be cool to print out actual adb path since it's configurable. Otherwise it may mislead someone during adb related issues debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this good idea. I'm add print adb path to log at server startup.

private var isRunning = AtomicBoolean(false)

fun startDevicesObserving() {
fun startDevicesObservingSync() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would just mention that this method is blocking in documentation as you did in AdbCommandPerformer::perform. I think blocking behavior is an expected one. Another hint is that there's startDevicesObservingAsync

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm add documentation to this methods

implementation(libs.kotlinStdlib)
implementation(libs.appcompat)
implementation(projects.adbServer.adbserverDevice)
implementation("com.kaspersky.android-components:adbserver-device")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be cool to use toml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toml require to set version, yes in this case we can set any version, but i thing current way is more clear in this situation

dependencies {
classpath(libs.kotlinPlugin)
classpath(libs.androidPlugin)
classpath("com.kaspersky.kaspresso:kaspresso-plugin")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be cool to use toml


androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.allureSupport)
androidTestImplementation("com.kaspersky.android-components:kaspresso")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be cool to use toml


androidTestImplementation(projects.kaspresso)
androidTestImplementation(projects.composeSupport)
androidTestImplementation("com.kaspersky.android-components:kaspresso")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be cool to use toml

/**
* @param adbPath - path to adb binary
*/
class AdbCommandPerformer(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class AdbCommandPerformer(
class AdbCommandExecutor(

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I found CmdCommandPerformer exists already

group = "com.kaspersky.kaspresso"
gradlePlugin {
plugins {
create("SignerPlugin") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a SignerPlugin

}

private val devices: MutableCollection<DeviceMirror> = mutableListOf()
private var isRunning = AtomicBoolean(false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it accessed from multiple threads?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants