Home > Net >  Run Android preset in TestLab though gcloud CLI
Run Android preset in TestLab though gcloud CLI

Time:02-02

I'm having TestLab preset for our testing device matrix and I would like to target run this preset through the gcloud CLI (https://firebase.google.com/docs/test-lab/android/command-line) Am I blind or is there no way to do that?

CodePudding user response:

You'd have to convert the preset to option --device items:

gcloud firebase test android run \
  --type instrumentation \

  --app app-debug-unaligned.apk \
  --test app-debug-test-unaligned.apk \

  --device model=Nexus6,version=21,locale=en,orientation=portrait \
  --device model=Nexus7,version=19,locale=fr,orientation=landscape \
  --device ...

CodePudding user response:

Martin's answer is correct, but leaves out an alternative way to create and store your preset group(s) in a yaml-formatted argument file. E.g. create a presets.yaml file with:

device-preset-1:
  device:
    - {model: Nexus6, version: 21, locale: en, orientation: portrait}
    - {model: Nexus6, version: 21, locale: de, orientation: landscape}
    - {model: Nexus7, version: 19, locale: fr}

device-preset-2:
  device:
    - {model: Pixel2, version: 28}
    - {model: Pixel2, version: 29, orientation: landscape}
    - {model: Pixel3, version: 30, locale: es}

and invoke your test with:

gcloud firebase test android run \
  --type instrumentation \
  --app app-debug-unaligned.apk \
  --test app-debug-test-unaligned.apk
  presets.yaml:device-preset-2
  •  Tags:  
  • Related