Skip to content
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

Add Kaspresso plugin #417

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

VladislavSumin
Copy link
Collaborator

@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
All committers have signed the CLA.

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
Collaborator 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.


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
Collaborator 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

@@ -11,6 +11,6 @@ android {
dependencies {
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
Collaborator 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

@@ -21,8 +22,8 @@ dependencies {
implementation(libs.constraint)
implementation(libs.multidex)

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

@@ -52,14 +53,14 @@ dependencies {
implementation(libs.lifecycleViewModelComposeKtx)
implementation(libs.composeRuntimeLiveData)

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.

None yet

5 participants