Skip to content

issue #868 dismiss registered field#1102

Merged
DenBond7 merged 4 commits intomasterfrom
ip-868-ignore-registered
Mar 22, 2021
Merged

issue #868 dismiss registered field#1102
DenBond7 merged 4 commits intomasterfrom
ip-868-ignore-registered

Conversation

@IvanPizhenko
Copy link
Contributor

@IvanPizhenko IvanPizhenko commented Mar 20, 2021

Not sure if this is completely correct. See my comment in the #868. Now just want to see if semaphore passes.

@IvanPizhenko IvanPizhenko requested a review from DenBond7 March 20, 2021 21:14
@IvanPizhenko
Copy link
Contributor Author

Converting from draft to regular PR - let's anyway review it in this state.

@IvanPizhenko IvanPizhenko marked this pull request as ready for review March 20, 2021 23:00
@IvanPizhenko IvanPizhenko requested a review from seisvelas as a code owner March 20, 2021 23:00
@DenBond7
Copy link
Collaborator

@IvanPizhenko

Now just want to see if semaphore passes.

It was compilation issues. To prevent such an issue you can use 2 ways (for both way you have to have at least 1 connected device - an emulator or a real device):

  1. Use Android Studio to just print tests names(Print all tests)
    image

If that task passes there are no compilation issues

  1. Use the following command ./gradlew clean :FlowCrypt:connectedDevTestDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.log=true. If the task fails you will see compilation errors like this
    image

@DenBond7 DenBond7 self-assigned this Mar 22, 2021
@DenBond7 DenBond7 merged commit ca6b706 into master Mar 22, 2021
@DenBond7 DenBond7 deleted the ip-868-ignore-registered branch March 22, 2021 10:15
@IvanPizhenko
Copy link
Contributor Author

@DenBond7 thanks! I just didn't know how to run all the tests in the Android project. Sure, I will do this next times.

@DenBond7
Copy link
Collaborator

@IvanPizhenko

@DenBond7 thanks! I just didn't know how to run all the tests in the Android project. Sure, I will do this next times.

Just want to clarify. My examples just print tests and don't run them. But it'll be enough to catch compilation errors

@IvanPizhenko
Copy link
Contributor Author

ok, so you were meaning that this will not necessarily run test (due to various reasons like missing running AVD), but will try to compile everything and thus will catch compilation errors, right?

@DenBond7
Copy link
Collaborator

Almost. Unfortunately, any of my examples will not complete if you don't have at least one connected device. For example, Android Studio will not start that task if you don't have at least one connected device. Gradle will start a task but will fail if the compilation will pass but you don't have at least one connected device.

I'm thinking about that. Need to check all Gradle tasks. Maybe I'll find just a compilation task.

@IvanPizhenko
Copy link
Contributor Author

IvanPizhenko commented Mar 23, 2021

assemble is the standard Gradle task for compilation only.
Seems to work.

@IvanPizhenko
Copy link
Contributor Author

@DenBond7 No, it eventually fails:

$ ./gradlew clean assemble

.....

> Task :FlowCrypt:compileConsumerReleaseKotlin FAILED
e: /home/ivan/pro/flowcrypt/flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/FlowCryptApplication.kt: (27, 8): Unresolved reference: leakcanary
e: /home/ivan/pro/flowcrypt/flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/FlowCryptApplication.kt: (123, 7): Unresolved reference: LeakCanary
e: /home/ivan/pro/flowcrypt/flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/FlowCryptApplication.kt: (123, 18): Variable expected
e: /home/ivan/pro/flowcrypt/flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/FlowCryptApplication.kt: (123, 27): Unresolved reference: LeakCanary
e: /home/ivan/pro/flowcrypt/flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/FlowCryptApplication.kt: (124, 7): Unresolved reference: LeakCanary

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':FlowCrypt:compileConsumerReleaseKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 4s
67 actionable tasks: 30 executed, 37 from cache

@DenBond7
Copy link
Collaborator

@IvanPizhenko

Maybe I'll find just a compilation task.

I've found. You can use this one. It doesn't require a device.

./gradlew clean :FlowCrypt:assembleDevTestDebugAndroidTest

@DenBond7
Copy link
Collaborator

@IvanPizhenko
Actually, it'll be better to use the following command. It covers Android and JUnit tests compilation.

./gradlew clean :FlowCrypt:assembleDevTestDebugAndroidTest :FlowCrypt:testDevTestDebugUnitTest

@IvanPizhenko
Copy link
Contributor Author

@DenBond7 thanks! Just one note about "clean": it cleans the whole build output and rebuilds it again. If you are sure you are not messed up something, which is typical case, clean often can be omitted. However, if something constantly goes wrong, and looks like you have old code working instead of new, clean is the right thing to do. Otherwise incremental compilation of the only changed stuff is faster.

@IvanPizhenko
Copy link
Contributor Author

@DenBond7 what is the difference between targets :FlowCrypt:testDevTestDebugUnitTest and :FlowCrypt:connectedDevTestDebugAndroidTest ? Just from the name I can assume that the former doesn't require emulator running while the latter requires. But that's just an assumption.

@IvanPizhenko
Copy link
Contributor Author

Just now found out from ./gradlew tasks --all:

FlowCrypt:connectedDevTestDebugAndroidTest - Installs and runs the tests for devTestDebug on connected devices.
FlowCrypt:testDevTestDebugUnitTest - Run unit tests for the devTestDebug build.

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.

3 participants