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

#835 Added option to print available devices and OS version to test against #882

Closed
wants to merge 4 commits into from

Conversation

piotradamczyk5
Copy link
Contributor

@piotradamczyk5 piotradamczyk5 commented Jul 9, 2020

Fixes #835

Test Plan

How do we know the code works?

Use on of 3 new CLI option to test this PR:

  • flank firebase test android|ios models list or flank android|ios models list - print Android/iOS available devices to test against
  • flank firebase test android|ios versions list or flank android|ios versions list - print Android/iOS available os software versions to test against
  • flank firebase test android|ios test-environment or flank android|ios test-environment - print both available devices and os software versions to test against
Sample Android output:

┌────────────────────┬────────────────────┬─────────────────────────────────────────┬──────────┬─────────────┬────────────────────────────┬───────────────┐
│      MODEL_ID      │        MAKE        │               MODEL_NAME                │   FORM   │ RESOLUTION  │       OS_VERSION_IDS       │     TAGS      │
├────────────────────┼────────────────────┼─────────────────────────────────────────┼──────────┼─────────────┼────────────────────────────┼───────────────┤
│       602SO        │        Sony        │                Sony XZs                 │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       A0001        │      OnePlus       │               OnePlus One               │ PHYSICAL │ 1920 x 1080 │             22             │               │
│     A1N_sprout     │     HMD Global     │             Nokia 8 Sirocco             │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    ASUS_X00T_3     │        Asus        │         Asus ZenFone Max Pro M1         │ PHYSICAL │ 2160 x 1080 │             28             │               │
│    ASUS_Z01H_1     │        Asus        │           Asus Zenfone 3 ZOOM           │ PHYSICAL │ 1920 x 1080 │                            │               │
│    ASUS_Z01KDA     │        Asus        │             Asus ZenFone 4              │ PHYSICAL │ 1920 x 1080 │             28             │               │
│       D6503        │        Sony        │                Xperia Z2                │ PHYSICAL │ 1920 x 1080 │                            │               │
│       D6603        │        Sony        │                Xperia Z3                │ PHYSICAL │ 1920 x 1080 │                            │               │
│     DRG_sprout     │     HMD Global     │             Nokia 6.1 Plus              │ PHYSICAL │ 2280 x 1080 │             28             │               │
│       E5803        │        Sony        │            Xperia Z5 Compact            │ PHYSICAL │ 1280 x 720  │                            │               │
│       F5121        │        Sony        │              Sony Xperia X              │ PHYSICAL │ 1920 x 1080 │                            │               │
│       F8331        │        Sony        │          Sony Xperia XZ F8331           │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       F8332        │        Sony        │             Sony Xperia XZ              │ PHYSICAL │ 1920 x 1080 │             26             │               │
│        FRT         │     HMD Global     │          Nokia 1 (Android GO)           │ PHYSICAL │  854 x 480  │             27             │               │
│       G8142        │        Sony        │         Sony XPERIA XZ Premium          │ PHYSICAL │ 1920 x 1080 │           25, 26           │               │
│       G8232        │        Sony        │               Xperia XZs                │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       G8342        │        Sony        │               Xperia XZ1                │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       G8441        │        Sony        │           Xperia XZ1 Compact            │ PHYSICAL │ 1280 x 720  │             26             │               │
│       H8216        │        Sony        │                Sony XZ2                 │ PHYSICAL │ 2160 x 1080 │             28             │               │
│       H8266        │        Sony        │            Sony XZ2 Dual Sim            │ PHYSICAL │ 2160 x 1080 │             28             │               │
│       H8296        │        Sony        │               Xperia XZ2                │ PHYSICAL │ 2160 x 1080 │             28             │               │
│       H8314        │        Sony        │      Sony Xperia XZ2 Compact H8314      │ PHYSICAL │ 2160 x 1080 │             26             │               │
│       H8324        │        Sony        │           Xperia XZ2 Compact            │ PHYSICAL │ 2160 x 1080 │             26             │               │
│       H8416        │        Sony        │                Sony XZ3                 │ PHYSICAL │ 2880 x 1440 │             28             │               │
│        HUR         │       SHARP        │            Sharp SHX39 KDDI             │ PHYSICAL │ 2560 x 1440 │             28             │               │
│       HWCOR        │       Huawei       │            Huawei Honor Play            │ PHYSICAL │ 2340 x 1080 │             27             │               │
│       HWMHA        │       Huawei       │              Huawei Mate 9              │ PHYSICAL │ 1920 x 1080 │             24             │               │
│       HWNEO        │       Huawei       │             Huawei Mate RS              │ PHYSICAL │ 2880 x 1440 │             28             │               │
│      Nexus10       │      Samsung       │                Nexus 10                 │ VIRTUAL  │ 2560 x 1600 │         19, 21, 22         │               │
│       Nexus4       │         LG         │                 Nexus 4                 │ VIRTUAL  │ 1280 x 768  │         19, 21, 22         │               │
│       Nexus5       │         LG         │                 Nexus 5                 │ VIRTUAL  │ 1920 x 1080 │       19, 21, 22, 23       │               │
│      Nexus5X       │         LG         │                Nexus 5X                 │ VIRTUAL  │ 1920 x 1080 │       23, 24, 25, 26       │               │
│       Nexus6       │      Motorola      │                 Nexus 6                 │ VIRTUAL  │ 2560 x 1440 │     21, 22, 23, 24, 25     │               │
│      Nexus6P       │       Google       │                Nexus 6P                 │ VIRTUAL  │ 2560 x 1440 │     23, 24, 25, 26, 27     │               │
│       Nexus7       │        Asus        │             Nexus 7 (2012)              │ VIRTUAL  │ 1280 x 800  │         19, 21, 22         │               │
│ Nexus7_clone_16_9  │      Generic       │   Nexus7 clone, DVD 16:9 aspect ratio   │ VIRTUAL  │ 1280 x 720  │       23, 24, 25, 26       │     beta      │
│       Nexus9       │        HTC         │                 Nexus 9                 │ VIRTUAL  │ 2048 x 1536 │     21, 22, 23, 24, 25     │               │
│    NexusLowRes     │      Generic       │        Low-resolution MDPI phone        │ VIRTUAL  │  640 x 360  │ 23, 24, 25, 26, 27, 28, 29 │               │
│   NexusLowRes_Q    │      Generic       │ Low-resolution MDPI phone for Android Q │ VIRTUAL  │  640 x 360  │                            │               │
│ NexusTabletLowRes2 │      Generic       │     Generic 600x800 Android tablet      │ VIRTUAL  │  800 x 600  │                            │               │
│ NexusTabletLowRes3 │      Generic       │     Generic 600x720 Android tablet      │ VIRTUAL  │  720 x 600  │                            │               │
│     OnePlus3T      │      OnePlus       │               OnePlus 3T                │ PHYSICAL │ 1920 x 1080 │             26             │               │
│      OnePlus5      │      OnePlus       │                OnePlus 5                │ PHYSICAL │ 1920 x 1080 │             26             │ deprecated=26 │
│     OnePlus5T      │      OnePlus       │               OnePlus 5T                │ PHYSICAL │ 2160 x 1080 │             28             │               │
│     OnePlus6T      │      OnePlus       │                OnePlus6T                │ PHYSICAL │ 2340 x 1080 │             28             │               │
│       Pixel2       │       Google       │                 Pixel 2                 │ VIRTUAL  │ 1920 x 1080 │       26, 27, 28, 29       │               │
│      Pixel2_Q      │       Google       │          Pixel 2 for Android Q          │ VIRTUAL  │ 1920 x 1080 │                            │               │
│       SC-02K       │      Samsung       │           Samsung S9, SC-02K            │ PHYSICAL │ 2960 x 1440 │             28             │               │
│       SC-03K       │      Samsung       │           Samsung S9+, SC-03K           │ PHYSICAL │ 2960 x 1440 │             28             │               │
│       SH-04H       │       SHARP        │                 SH-04H                  │ PHYSICAL │ 1920 x 1080 │                            │               │
│       SO-01J       │        Sony        │          Sony Xperia XZ SO-01J          │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       SO-03J       │        Sony        │       Xperia XZ (Docomo, SO-03J)        │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       SOV33        │        Sony        │     Xperia X Performance SOV33 (JP)     │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       SOV34        │        Sony        │          Xperia XZ SOV34 (JP)           │ PHYSICAL │ 1920 x 1080 │             26             │               │
│      a5y17lte      │      Samsung       │             Galaxy A5 2017              │ PHYSICAL │ 1920 x 1080 │             24             │               │
│     a9y18qlte      │      Samsung       │                 A9 2018                 │ PHYSICAL │ 2220 x 1080 │             26             │               │
│    a9y18qltechn    │      Samsung       │            Samsung SM-A9200             │ PHYSICAL │ 2220 x 1080 │             26             │               │
│      addison       │      Motorola      │      Moto Z Play Verizon XT1635-01      │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       albus        │      Motorola      │             Moto Z2 XT1710              │ PHYSICAL │ 1920 x 1080 │             26             │               │
│     aljeter_n      │      Motorola      │             moto g(6) play              │ PHYSICAL │ 1440 x 720  │             26             │               │
│    astarqltechn    │      Samsung       │             Galaxy A8 Star              │ PHYSICAL │ 2220 x 1080 │             26             │               │
│    astarqlteskt    │      Samsung       │             Samsung A8 Star             │ PHYSICAL │ 2220 x 1080 │             26             │               │
│       athene       │      Motorola      │              Moto G4 Plus               │ PHYSICAL │ 1920 x 1080 │             23             │               │
│      athene_f      │      Motorola      │                 Moto G4                 │ PHYSICAL │ 1920 x 1080 │             23             │               │
│        aura        │       Razer        │              Razer Phone 2              │ PHYSICAL │ 2560 x 1440 │             27             │               │
│      beyond1       │      Samsung       │           Galaxy S10 SM-G973F           │ PHYSICAL │ 3040 x 1440 │             28             │               │
│      blueline      │       Google       │                 Pixel 3                 │ PHYSICAL │ 2160 x 1080 │           28, 29           │               │
│    c5proltechn     │      Samsung       │             Samsung C5 Pro              │ PHYSICAL │ 1920 x 1080 │             26             │               │
│     capricorn      │       Xiaomi       │              Xiaomi MI 5s               │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       cheryl       │       Razer        │               Razer Phone               │ PHYSICAL │ 2560 x 1440 │             25             │               │
│    condor_umts     │      Motorola      │                 Moto E                  │ PHYSICAL │  960 x 540  │                            │               │
│      crownlte      │      Samsung       │             Samsung Note 9              │ PHYSICAL │ 2960 x 1440 │             28             │               │
│     crownlteks     │      Samsung       │         Samsung Note 9 SM-N960N         │ PHYSICAL │ 2960 x 1440 │             28             │               │
│    crownqlteue     │      Samsung       │            Galaxy Note 9 USA            │ PHYSICAL │ 2960 x 1440 │             27             │               │
│   cruiserlteatt    │      Samsung       │        Samsung Galaxy S8 Active         │ PHYSICAL │ 2220 x 1080 │             26             │               │
│    cruiserltesq    │      Samsung       │            Samsung S8 Active            │ PHYSICAL │ 2220 x 1080 │             26             │               │
│    deen_sprout     │      Motorola      │          Motorola One XT1941-4          │ PHYSICAL │ 1520 x 720  │             28             │               │
│       dipper       │       Xiaomi       │               Xiaomi MI 8               │ PHYSICAL │ 2248 x 1080 │             28             │               │
│     dream2lte      │      Samsung       │          Samsung S8+ SM-G955F           │ PHYSICAL │ 2960 x 1440 │             26             │               │
│    dream2lteks     │      Samsung       │           Galaxy S8+ SM-G955N           │ PHYSICAL │ 2960 x 1440 │             26             │               │
│    dream2qltesq    │      Samsung       │           Samsung S8+ Verizon           │ PHYSICAL │ 2960 x 1440 │             26             │               │
│    dream2qlteue    │      Samsung       │          Samsung S8+ SM-G955U1          │ PHYSICAL │ 2220 x 1080 │             26             │               │
│    dreamqlteue     │      Samsung       │                Galaxy S8                │ PHYSICAL │ 2960 x 1440 │             26             │               │
│      equuleus      │       Xiaomi       │             Xiaomi MI 8 Pro             │ PHYSICAL │ 2248 x 1080 │             28             │               │
│    falcon_umts     │      Motorola      │            Moto G (1st Gen)             │ PHYSICAL │ 1280 x 720  │                            │               │
│       flame        │       Google       │                 Pixel 4                 │ PHYSICAL │ 2280 x 1080 │             29             │               │
│        flo         │        Asus        │             Nexus 7 (2013)              │ PHYSICAL │ 1920 x 1200 │           19, 21           │               │
│         g3         │         LG         │                  LG G3                  │ PHYSICAL │ 2560 x 1440 │             19             │               │
│     grandpplte     │      Samsung       │        Galaxy J2 Prime SM-G532M         │ PHYSICAL │  960 x 540  │             23             │               │
│      greatlte      │      Samsung       │    Samsung Galaxy Note 8 (SM-N950F)     │ PHYSICAL │ 2960 x 1440 │             28             │               │
│     greatlteks     │      Samsung       │       Galaxy Note8 (N950N Korea)        │ PHYSICAL │ 2960 x 1440 │             28             │               │
│     greatqlte      │      Samsung       │             Samsung Note 8              │ PHYSICAL │ 2220 x 1080 │             26             │               │
│      griffin       │      Motorola      │              Moto Z XT1650              │ PHYSICAL │ 2560 x 1440 │             24             │               │
│    gts3lltevzw     │      Samsung       │     Samsung Tab S3 Verizon SM-T827V     │ PHYSICAL │ 2048 x 1536 │             28             │               │
│    gts4lltevzw     │      Samsung       │            Samsung SM-T837V             │ PHYSICAL │ 2560 x 1600 │             28             │               │
│         h1         │         LG         │              LG G5 LG-H831              │ PHYSICAL │ 2560 x 1440 │             26             │               │
│     hammerhead     │         LG         │                 Nexus 5                 │ PHYSICAL │ 1920 x 1080 │           21, 23           │               │
│       harpia       │      Motorola      │      Moto G Play (4th Gen) XT1607       │ PHYSICAL │ 1280 x 720  │             23             │               │
│      hero2lte      │      Samsung       │             Galaxy S7 edge              │ PHYSICAL │ 1440 x 2560 │             23             │               │
│    hero2qlteatt    │      Samsung       │       Samsung Galaxy S7 edge ATT        │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    hero2qltechn    │      Samsung       │           Galaxy S7 SM-G9350            │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    hero2qltespr    │      Samsung       │         Samsung S7 Edge Sprint          │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    hero2qltetmo    │      Samsung       │     Samsung Galaxy S7 edge T-Mobile     │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    hero2qlteusc    │      Samsung       │        Galaxy S7 Edge SM-G935R4         │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    hero2qltevzw    │      Samsung       │  Samsung Galaxy S7 edge Verizon G935V   │ PHYSICAL │ 2560 x 1440 │             26             │               │
│      herolte       │      Samsung       │                Galaxy S7                │ PHYSICAL │ 1440 x 2560 │                            │               │
│    heroqlteaio     │      Samsung       │    Samsung S7 SM-G930AZ for Cricket     │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    heroqlteatt     │      Samsung       │             Samsung S7 ATT              │ PHYSICAL │ 1920 x 1080 │             26             │               │
│    heroqltemtr     │      Samsung       │          Samsung S7 SM-G930T1           │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    heroqltespr     │      Samsung       │            Samsung S7 Sprint            │ PHYSICAL │ 2560 x 1440 │             26             │               │
│   heroqltetfnvzw   │      Samsung       │   Galaxy S7 (Straight Talk) SM-G930VL   │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    heroqltetmo     │      Samsung       │      Samsung S7 SM-G930T T-Mobile       │ PHYSICAL │ 2560 x 1440 │             26             │               │
│     heroqlteue     │      Samsung       │           Samsung S7 SM-G930U           │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    heroqlteusc     │      Samsung       │          Samsung S7 SM-G930R4           │ PHYSICAL │ 2560 x 1440 │             26             │               │
│    heroqltevzw     │      Samsung       │           Samsung S7 Verizon            │ PHYSICAL │ 2560 x 1440 │             26             │               │
│        hlte        │      Samsung       │           Galaxy Note 3 Duos            │ PHYSICAL │ 1920 x 1080 │             19             │               │
│       htc_m8       │        HTC         │              HTC One (M8)               │ PHYSICAL │ 1920 x 1080 │             19             │               │
│    htc_ocedugl     │        HTC         │          HTC U Ultra Dual Sim           │ PHYSICAL │ 2720 x 1440 │             26             │               │
│    htc_ocmdugl     │        HTC         │              HTC U11 plus               │ PHYSICAL │ 2880 x 1440 │             26             │               │
│    htc_ocndugl     │        HTC         │                 HTC U11                 │ PHYSICAL │ 2560 x 1440 │             26             │               │
│     htc_pmeuhl     │        HTC         │                 HTC 10                  │ PHYSICAL │ 2560 x 1440 │             26             │               │
│      hwALE-H       │       Huawei       │             Huawei P8 lite              │ PHYSICAL │ 1280 x 720  │             21             │               │
│     j1acevelte     │      Samsung       │         Galaxy J1 ace SM-J111M          │ PHYSICAL │  800 x 480  │             22             │               │
│       j5lte        │      Samsung       │                Galaxy J5                │ PHYSICAL │ 1280 x 720  │                            │               │
│      j7xelte       │      Samsung       │          Galaxy J7 (SM-J710MN)          │ PHYSICAL │ 1280 x 720  │             23             │               │
│       james        │      Motorola      │          Moto E5 Play XT1921-2          │ PHYSICAL │ 1280 x 720  │             26             │               │
│       jeter        │      Motorola      │          Moto G6 Play XT1922-2          │ PHYSICAL │ 1440 x 720  │             26             │               │
│        joan        │         LG         │             LG V30 LG-H932              │ PHYSICAL │ 2880 x 1440 │             26             │               │
│  k61v1_basic_ref   │        Alps        │                TECNO KB8                │ PHYSICAL │ 1500 x 720  │             29             │               │
│       lake_n       │      Motorola      │          Moto G7 Plus XT1965-2          │ PHYSICAL │ 2270 x 1080 │             28             │               │
│      lithium       │       Xiaomi       │               Xiaomi MIX                │ PHYSICAL │ 2040 x 1080 │             26             │               │
│      lt02wifi      │      Samsung       │              Galaxy Tab 3               │ PHYSICAL │ 600 x 1024  │             19             │               │
│       lucye        │         LG         │              LG G6 LGUS997              │ PHYSICAL │ 2880 x 1440 │             24             │               │
│        lv0         │         LG         │                  LG K3                  │ PHYSICAL │  854 x 480  │             23             │               │
│         m0         │      Samsung       │            Samsung Galaxy S3            │ PHYSICAL │ 1280 x 720  │             18             │               │
│        mako        │         LG         │                 Nexus 4                 │ PHYSICAL │ 1280 x 768  │                            │               │
│        mata        │ Essential Products │             Essential PH-1              │ PHYSICAL │ 2560 x 1312 │             25             │               │
│        mlv1        │         LG         │             LG K4 (LG-X230)             │ PHYSICAL │  854 x 480  │             23             │               │
│      natrium       │       Xiaomi       │            Xiaomi Mi 5s Plus            │ PHYSICAL │ 1920 x 1080 │             26             │               │
│      nitrogen      │       Xiaomi       │             Xiaomi Mi Max 3             │ PHYSICAL │ 2160 x 1080 │             28             │               │
│    osprey_umts     │      Motorola      │            Moto G (3rd Gen)             │ PHYSICAL │ 1280 x 720  │                            │               │
│         p1         │         LG         │                  LG G4                  │ PHYSICAL │ 1440 x 2560 │                            │               │
│      platina       │       Xiaomi       │            Xiaomi Mi 8 Lite             │ PHYSICAL │ 2280 x 1080 │             28             │               │
│   poseidonlteatt   │      Samsung       │          Samsung S7 Active ATT          │ PHYSICAL │ 1920 x 1080 │             26             │               │
│       potter       │      Motorola      │             Moto G (5) Plus             │ PHYSICAL │ 1920 x 1080 │             24             │               │
│      sailfish      │       Google       │                  Pixel                  │ PHYSICAL │ 1080 x 1920 │       25, 26, 27, 28       │               │
│      sawfish       │       Huawei       │             Huawei Watch 2              │ PHYSICAL │  390 x 390  │             26             │     beta      │
│       seoul        │       Lenovo       │                Lenovo S5                │ PHYSICAL │ 2160 x 1080 │             26             │               │
│     serranolte     │      Samsung       │             Galaxy S4 mini              │ PHYSICAL │  960 x 540  │                            │               │
│       shamu        │      Motorola      │                 Nexus 6                 │ PHYSICAL │ 2560 x 1440 │         21, 22, 23         │               │
│      star2lte      │      Samsung       │          Samsung S9+ SM-G965F           │ PHYSICAL │ 2960 x 1440 │             28             │               │
│     star2lteks     │      Samsung       │          Samsung S9+ SM-G965N           │ PHYSICAL │ 2220 x 1080 │             28             │               │
│    star2qlteue     │      Samsung       │         Samsung Galaxy S9+ (US)         │ PHYSICAL │ 2220 x 1080 │             26             │               │
│      starlte       │      Samsung       │       Samsung Galaxy S9 SM-G960F        │ PHYSICAL │ 2960 x 1440 │             26             │               │
│     starlteks      │      Samsung       │            Galaxy S9 (Korea)            │ PHYSICAL │ 2220 x 1080 │             28             │               │
│    starqltechn     │      Samsung       │       Samsung Galaxy S9 SM-G9600        │ PHYSICAL │ 2960 x 1440 │             26             │               │
│     starqlteue     │      Samsung       │         Samsung Galaxy S9 (US)          │ PHYSICAL │ 2220 x 1080 │             26             │               │
│        t03g        │      Samsung       │              Galaxy Note 2              │ PHYSICAL │ 1280 x 720  │                            │               │
│       taimen       │       Google       │               Pixel 2 XL                │ PHYSICAL │ 2880 x 1440 │           26, 27           │               │
│   tissot_sprout    │       Xiaomi       │              Xiaomi Mi A1               │ PHYSICAL │ 1920 x 1080 │             28             │               │
│     titan_umts     │      Motorola      │            Moto G (2nd Gen)             │ PHYSICAL │ 1280 x 720  │                            │               │
│       trelte       │      Samsung       │              Galaxy Note 4              │ PHYSICAL │ 1920 x 1080 │                            │               │
│      victara       │      Motorola      │                 Moto X                  │ PHYSICAL │ 1920 x 1080 │             19             │               │
│      walleye       │       Google       │                 Pixel 2                 │ PHYSICAL │ 1920 x 1080 │         26, 27, 28         │    default    │
│      zeroflte      │      Samsung       │                Galaxy S6                │ PHYSICAL │ 2560 x 1440 │             23             │               │
│      zerolte       │      Samsung       │             Galaxy S6 Edge              │ PHYSICAL │ 2560 x 1440 │                            │               │
└────────────────────┴────────────────────┴─────────────────────────────────────────┴──────────┴─────────────┴────────────────────────────┴───────────────┘
┌───────────────┬─────────┬─────────────┬───────────┬──────────────┬─────────┐
│ OS_VERSION_ID │ VERSION │  CODE_NAME  │ API_LEVEL │ RELEASE_DATE │  TAGS   │
├───────────────┼─────────┼─────────────┼───────────┼──────────────┼─────────┤
│      18       │  4.3.x  │ Jelly Bean  │    18     │  2013-10-03  │         │
│      19       │  4.4.x  │   KitKat    │    19     │  2014-06-02  │         │
│      21       │  5.0.x  │  Lollipop   │    21     │  2014-12-19  │         │
│      22       │  5.1.x  │  Lollipop   │    22     │  2015-04-21  │         │
│      23       │  6.0.x  │ Marshmallow │    23     │  2015-10-05  │         │
│      24       │  7.0.x  │   Nougat    │    24     │  2016-08-22  │         │
│      25       │  7.1.x  │   Nougat    │    25     │  2016-10-19  │         │
│      26       │  8.0.x  │    Oreo     │    26     │  2017-08-21  │ default │
│      27       │  8.1.x  │  Oreo MR1   │    27     │  2017-12-04  │         │
│      28       │   9.x   │     Pie     │    28     │  2018-08-06  │         │
│      29       │  10.x   │      Q      │    29     │  2019-09-03  │         │
│      30       │   11    │      R      │    30     │  2020-09-03  │         │
└───────────────┴─────────┴─────────────┴───────────┴──────────────┴─────────┘
Sample iOS output:

┌─────────────┬───────────────────────┬─────────────┬────────────────────────┬──────────────────────────────────┐
│  MODEL_ID   │      MODEL_NAME       │ RESOLUTION  │     OS_VERSION_IDS     │               TAGS               │
├─────────────┼───────────────────────┼─────────────┼────────────────────────┼──────────────────────────────────┤
│    ipad5    │ iPad (5th generation) │ 2048 x 1536 │       11.2, 12.0       │         deprecated=11.2          │
│  ipadmini4  │      iPad mini 4      │ 2048 x 1536 │       11.2, 12.0       │         deprecated=11.2          │
│ ipadpro_105 │ iPad Pro (10.5-inch)  │ 2224 x 1668 │          11.2          │         deprecated=11.2          │
│  iphone11   │       iPhone 11       │ 1792 x 828  │          13.3          │                                  │
│ iphone11pro │     iPhone 11 Pro     │ 2436 x 1125 │          13.3          │                                  │
│   iphone6   │       iPhone 6        │ 1334 x 750  │          11.4          │         deprecated=11.4          │
│  iphone6s   │       iPhone 6s       │ 1334 x 750  │ 10.3, 11.2, 11.4, 12.0 │ deprecated=10.3, deprecated=11.2 │
│   iphone7   │       iPhone 7        │ 1334 x 750  │ 11.2, 11.4, 12.0, 12.3 │         deprecated=11.2          │
│ iphone7plus │     iPhone 7 Plus     │ 1920 x 1080 │    11.2, 11.4, 12.0    │         deprecated=11.2          │
│   iphone8   │       iPhone 8        │ 1334 x 750  │    11.2, 11.4, 12.0    │     deprecated=11.2, default     │
│ iphone8plus │     iPhone 8 Plus     │ 1920 x 1080 │ 11.2, 11.4, 12.0, 12.3 │         deprecated=11.2          │
│  iphonese   │       iPhone SE       │ 1136 x 640  │ 11.2, 11.4, 12.0, 12.3 │         deprecated=11.2          │
│   iphonex   │       iPhone X        │ 2436 x 1125 │ 11.2, 11.4, 12.0, 12.3 │         deprecated=11.2          │
│  iphonexr   │       iPhone XR       │ 1792 x 828  │          13.2          │                                  │
│  iphonexs   │       iPhone XS       │ 2436 x 1125 │    12.0, 12.1, 12.3    │                                  │
│ iphonexsmax │     iPhone XS Max     │ 2688 x 1242 │    12.0, 12.1, 12.3    │                                  │
└─────────────┴───────────────────────┴─────────────┴────────────────────────┴──────────────────────────────────┘
┌───────────────┬───────────────┬───────────────┬─────────┬──────────────────────────────────────────┐
│ OS_VERSION_ID │ MAJOR_VERSION │ MINOR_VERSION │  TAGS   │       SUPPORTED_XCODE_VERSION_IDS        │
├───────────────┼───────────────┼───────────────┼─────────┼──────────────────────────────────────────┤
│     10.3      │      10       │       3       │         │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     11.2      │      11       │       2       │ default │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     11.4      │      11       │       4       │         │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     12.0      │      12       │               │         │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     12.1      │      12       │       1       │         │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     12.2      │      12       │       2       │         │ 10.2.1, 10.3, 11.0, 11.1, 11.2.1, 11.3.1 │
│     12.3      │      12       │       3       │         │     10.3, 11.0, 11.1, 11.2.1, 11.3.1     │
│     13.2      │      13       │       2       │         │              11.2.1, 11.3.1              │
│     13.3      │      13       │       3       │         │                  11.3.1                  │
└───────────────┴───────────────┴───────────────┴─────────┴──────────────────────────────────────────┘

More listing options of the test environment will be added in the next tasks after research.
The new options should be printed together when using --available-environment option

Checklist

  • printing Android devices list
  • printing iOS devices list
  • printing Android software revisions
  • printing iOS software revisions
  • Documented
  • Unit tested
  • release_notes.md updated

@piotradamczyk5 piotradamczyk5 changed the title #835 added printing ios and android devices #835 Added printing ios and android devices and software revisions Jul 9, 2020
@piotradamczyk5 piotradamczyk5 self-assigned this Jul 9, 2020
@piotradamczyk5 piotradamczyk5 changed the title #835 Added printing ios and android devices and software revisions #835 Added option to print available devices and OS version to test against Jul 10, 2020
Copy link
Contributor

@bootstraponline bootstraponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is to copy the gcloud layout so we can easily track upstream changes when new features are added.
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/

The available devices command would then be something like:
gcloud alpha firebase test android models list
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/models/list

because there is no --available-devices flag for android run.
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/run

Ideally each new command would be an individual ticket/pull request to keep the overall pull request size small. Small PRs are easier to review.

@piotradamczyk5
Copy link
Contributor Author

piotradamczyk5 commented Jul 13, 2020

My preference is to copy the gcloud layout so we can easily track upstream changes when new features are added.
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/

The available devices command would then be something like:
gcloud alpha firebase test android models list
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/models/list

because there is no --available-devices flag for android run.
https://cloud.google.com/sdk/gcloud/reference/alpha/firebase/test/android/run

Ideally each new command would be an individual ticket/pull request to keep the overall pull request size small. Small PRs are easier to review.

Changed as requested
Also added extra command flank firebase test android|ios test-environment which prints all information.
It is hard to split current PR to smaller ones, but the next commands will be in separate PRs.
@team I am sorry that this PR is so big

@bootstraponline
Copy link
Contributor

bootstraponline commented Jul 13, 2020

It is hard to split current PR to smaller ones, but the next commands will be in separate PRs.

I think we should split the PR, even if it's more work. It'll be good to build the habit of following engineering best practices.

@@ -322,7 +321,7 @@ class IosRunCommandTest {

@Test
fun `obfuscate parse`() {
val cmd = AndroidRunCommand()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

private fun List<AndroidModel>.createTestEnvironmentInfo() =
fold(mutableMapOf<String, MutableList<String>>()) { devicesInfo, androidDevice ->
devicesInfo.apply {
getOrCreateList(MODEL_ID).add(androidDevice.codename)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codename, manufacturer, name, from etc ... generally properties of androidDevice all are nullable values (java ... ). Sometimes there is no big harm but in other cases it may end up with NPE.
I am wondering if we could protect logic from nulls and make flank more robust. I am aware it should not happen but I am also sure, sooner or later this will blow.
Above is applicable to ListAndroidSofwareVersions.kt, ListIOsDevices.kt, ListIOsSofwareVersions.kt as well. (I just don't want to duplicate comment :) )

Let me know what do you think

private fun StringBuilder.newLine() {
append(System.lineSeparator())
}
fun TableColumn.applyColorsUsing(mapper: (String) -> SystemOutColor) = copy(dataColor = data.map(mapper))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this inline?

@piotradamczyk5
Copy link
Contributor Author

It is hard to split current PR to smaller ones, but the next commands will be in separate PRs.

I think we should split the PR, even if it's more work. It'll be good to build the habit of following engineering best practices.

@bootstraponline @Pasterzp this PR is split into smaller parts as suggested by @bootstraponline.
First of it is in #888

@bootstraponline bootstraponline deleted the #835-added-printing-test-environments branch November 12, 2021 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show available devices
3 participants