You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update readme or add script to check for compilation issues #1106
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):
Use Android Studio to just print tests names(Print all tests)
If that task passes there are no compilation issues
Use the following command ./gradlew clean :FlowCrypt:connectedDevTestDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.log=true. If the task fails you will see compilation errors like this
I'm pulling this out into an issue - maybe can add ./script/compile.sh or something similar. Either that, or update the readme - this is useful to know.
There's a trouble with running tests inside the cloud Linux VM according to Den's instructions:
> Task :FlowCrypt:connectedDevTestDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':FlowCrypt:connectedDevTestDebugAndroidTest'.
> com.android.builder.testing.api.DeviceException: No connected devices!
I just can't run native x86 Android emulator.
Unfortunately, your computer does not support hardware accelerated virtualization.
Here are some of your options:
1) Use a physical device for testing
2) Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX
3) Develop on a Linux computer that supports VT-x or SVM
4) Use an Android Virtual Device based on an ARM system image
(This is 10x slower than hardware accelerated virtualization)
Will try ARM one - looks like the only option.
The other option is to purchase dedicated physical box for Linux -$500 min for something reasonable (Core i5 Mobile, 16GB, SSD) - did not plan to do that.
To run in 'log only' mode -e log true This option will load and iterate through all test classes and methods, but will bypass actual test execution. Useful for quickly obtaining info on the tests to be executed by an instrumentation command.
Maybe just update that script and add this extra option?
I am talking about enabling nested virtualization in the VM settings. At the moment VM itself does not support it. Android studio has already installed emulator but it cannot be used because no any virtualization available in the my Linux VM.
@IvanPizhenko are you in fact on Windows, and running a linux box in a VM itself? Is it VMWare or something else?
That would indeed explain why you cannot easily virtualize. Our CI most likely runs Ubuntu in a VM on top of Ubuntu, that may be a different situation than what you are doing, since they may be using different software to virtualize their host Ubuntu system.
I am currently using GCloud instance. I'd like to use VirtualBox locally, but things like IntellIJ are just very slow in it (the host system is laptop with 2nd generation Core i7 and 16GB memory purchased back in the 2011, I'd like to upgrade, but that can't be done immediately). So I think it is now faster to just recreate instance with nested virtualization enabled than solve #1076. Another problem with Windows is that tests use Docker. Docker on Windows requires WSL2, and WSL2 works bad with VirtualBox, which I have to use for some other stuff. So in sense of running tests Windows unfortunately is not a variant for me.
Just recreated VM with nested virtualization, started AVD via AVD Manger and it just works. Just if someone else needs to do the same - one extra step is to add your Linux user into the group kvm.
Activity
tomholub commentedon Mar 22, 2021
I'm pulling this out into an issue - maybe can add
./script/compile.shor something similar. Either that, or update the readme - this is useful to know.IvanPizhenko commentedon Mar 23, 2021
I'd say test.sh
IvanPizhenko commentedon Mar 23, 2021
There's a trouble with running tests inside the cloud Linux VM according to Den's instructions:
I just can't run native x86 Android emulator.
Will try ARM one - looks like the only option.
The other option is to purchase dedicated physical box for Linux -$500 min for something reasonable (Core i5 Mobile, 16GB, SSD) - did not plan to do that.
IvanPizhenko commentedon Mar 23, 2021
But tests run in the CI. How is that possible? Does CI use physical machines?
DenBond7 commentedon Mar 23, 2021
CI supports virtualization. We can run x86 emulators
DenBond7 commentedon Mar 23, 2021
Actually, you just print all tests. I think it'll be better to call it print-all-tests.sh.
IvanPizhenko commentedon Mar 23, 2021
@DenBond7 I've found that there's already a script named
run-all-test.shwith a following content:Isn't this the same?
You've added
-Pandroid.testInstrumentationRunnerArguments.log=true. What does it mean?Maybe just update that script and add this extra option?
IvanPizhenko commentedon Mar 23, 2021
Found something about "nested virtualization" - will try to enable it on the VM. But meanwhile trying the ARM image.
IvanPizhenko commentedon Mar 23, 2021
Hmm... no luck with ARM either...
seems like need to try that "nested virtualization"
DenBond7 commentedon Mar 23, 2021
@IvanPizhenko
Almost the same.
run-all-test.shruns all tests.print-all-tests.shshould be just print all tests.From here
To run in 'log only' mode -e log true This option will load and iterate through all test classes and methods, but will bypass actual test execution. Useful for quickly obtaining info on the tests to be executed by an instrumentation command.Yes, we can do that.
DenBond7 commentedon Mar 23, 2021
@IvanPizhenko Please look at this line
flowcrypt-android/script/ci-install-android-sdk.sh
Line 15 in 63b6748
That's how we enable virtualization.
IvanPizhenko commentedon Mar 23, 2021
I am talking about enabling nested virtualization in the VM settings. At the moment VM itself does not support it. Android studio has already installed emulator but it cannot be used because no any virtualization available in the my Linux VM.
IvanPizhenko commentedon Mar 23, 2021
I'd rather need to do something like this
https://stackoverflow.com/questions/53931366/how-to-enable-nested-virtualization-on-an-existing-google-cloud-vm-instance/53934114
tomholub commentedon Mar 23, 2021
@IvanPizhenko are you in fact on Windows, and running a linux box in a VM itself? Is it VMWare or something else?
That would indeed explain why you cannot easily virtualize. Our CI most likely runs Ubuntu in a VM on top of Ubuntu, that may be a different situation than what you are doing, since they may be using different software to virtualize their host Ubuntu system.
tomholub commentedon Mar 23, 2021
I'm thinking, if you are on Windows it may be more worthwhile to focus on #1076 which would allow you to skip these nested virtualization issues.
IvanPizhenko commentedon Mar 23, 2021
I am currently using GCloud instance. I'd like to use VirtualBox locally, but things like IntellIJ are just very slow in it (the host system is laptop with 2nd generation Core i7 and 16GB memory purchased back in the 2011, I'd like to upgrade, but that can't be done immediately). So I think it is now faster to just recreate instance with nested virtualization enabled than solve #1076. Another problem with Windows is that tests use Docker. Docker on Windows requires WSL2, and WSL2 works bad with VirtualBox, which I have to use for some other stuff. So in sense of running tests Windows unfortunately is not a variant for me.
tomholub commentedon Mar 23, 2021
In that case, you may be able to follow the
semaphore.ymlfile more or less step by step to get tests working there.IvanPizhenko commentedon Mar 23, 2021
Just recreated VM with nested virtualization, started AVD via AVD Manger and it just works. Just if someone else needs to do the same - one extra step is to add your Linux user into the group kvm.