Fix future gmsaas incompatibility
What happened?
According to the gmsaas 1.10.0 documentation:
Marked
gmsaas auth whoamicommand as deprecated.
Since it is used regularly by Detox, it will break in future versions.
cc @igorgn @lilinor
What was the expected behaviour?
N/A
Was it tested on latest Detox?
- [X] I have tested this issue on the latest Detox release and it still reproduces.
Did your test throw out a timeout?
- [ ] I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much.
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: React Native version: Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: Device model: Android version: Test-runner (select one): jest / other
Detox logs
N/A
Device logs
N/A
More data, please!
No response
Thanks for mentioning @d4vidi ! We released the authentication with API tokens and it introduced the deprecation of this command. For which reason do you need to use this command in the integration?
@lilinor we have this logic:
async function _validateGmsaasAuth() {
if (!await this._authService.getLoginEmail()) {
throw new DetoxRuntimeError({
message: `Cannot run tests using 'android.genycloud' type devices, because Genymotion was not logged-in to!`,
hint: `Log-in to Genymotion-cloud by running this command (and following instructions):\n${environment.getGmsaasPath()} auth login --help`,
});
}
}
Perhaps we could also check for GENYMOTION_API_TOKEN as well, but would that be enough? I'm not sure I understand what gmsaas auth token ... does.
Yep that's the code. Thanks @noomorph. @lilinor we pre-validate that gmsaas is properly installed and set up, that's all. Would also appreciate an advice regarding what we might be able to do equivalently.
gmsaas auth whoami is deprecated but rest assured that it won’t be removed unless we have your approval so it won’t break current gmsaas installations with username/pwd authentication. But we have just discovered that detox tests will break if users authenticate with api token as we return the error message : Error: command not supported when using API Token We can do a quick fix where gmsaas auth whomai will return exit code 0 if an API token is set.
We plan in the future versions of gmsaas to add a gmsaas doctor command to verify the whole gmsaas environment which will work with credentials & API token authentication :
-
Android SDK
-
Authentication with a real API call as
gmsaas auth whoamionly returns the email stored in the config file, there isn’t real check, password could have changed and running the other gmsaas commands likegmsaas list instances, startwould fail
Does this sound ok for you?
@lilinor IMO, a new command like gmsaas auth status may also work.
The idea with exit code = 0/1 sounds good to me.
As for hotfixing the gmsaas auth whoami command, I think it won't be semantic enough for tokens, as it cannot respond conceptually correctly to the question "Who am I?" just because tokens don't work the same.
The idea with gmsaas doctor sounds good as well.
As you said, using gmsaas auth whoami for API token doesn’t make any sense conceptually. As all our detox users haven’t switched to API tokens, we could also leave it like this and tell them to stick to username/password waiting for gmsaas doctor to come out if they encounter the issue. We could aim to release this command within the month.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
Hi @d4vidi & @noomorph !
Just letting you know that we released gmsaas doctor command in our last 1.11.0 version of gmsaas :)
Hi @d4vidi & @noomorph ! Just letting you know that we released
gmsaas doctorcommand in our last 1.11.0 version of gmsaas :)
Hey Thanks! We have a backlogged issue for that: https://github.com/wix/Detox/issues/4417 Hopefully, we'll get around to it soon enough.