ãã㯠Mercari Advent Calendar 2018 10æ¥ç®ã®è¨äºã§ãã
ããã«ã¡ã¯ãã¡ã«ã«ãªã®èªååï¼å質ä¿è¨¼ã°ã«ã¼ãï¼Automation & QA Groupï¼é称AQA) ã® æ ¹æ¬ å¾ ã§ãã
ç§ã¯æ®æ®µããã¹ãèªååã»CI / CD æ¹åã»ãã®ä»ç¤¾å ã®çç£æ§ãä¸ããããã®èªååãè¡ã£ã¦ãã¾ãã
ä»åã¯ãAndroidã»Appium ã®èªåãã¹ãã 20~30å°ã®ã¨ãã¥ã¬ã¼ã¿ã§ä¸¦åå®è¡ã§ãã ç°å¢ãä½æããã®ã§ããã®è©¦è¡é¯èª¤ã«ã¤ãã¦ã話ãããã¨æãã¾ãã
-
ããã¾ã§ã® Android èªåãã¹ãç°å¢ã¨ãã®èª²é¡ - Docker-Android
- ã¯ã©ã¦ãã§ã©ãå®è¡ãããã
- Docker-Android ã«ããæ©æµ
- 課é¡
- ãããã«
ããã¾ã§ã® Android èªåãã¹ãç°å¢ã¨ãã®èª²é¡
AQA ã°ã«ã¼ãã§ã¯ç¾å¨ãAppium ã使ã£ã¦ Android ã®èªåãã¹ããå®è£ ã»å®è¡ããã¦ãã¾ãã
詳細ã«é¢ãã¾ãã¦ã¯ãã¡ãã®è¨äºãã覧ãã ããã
å½æ㯠Android ãªãªã¼ã¹ãããåã«ããªã°ã¬ãã·ã§ã³ãã¹ãã¨ãã¦å®è¡ãã¦ãã¾ããã
ãã¹ãå®è¡ç°å¢ã¨ãã¦ã¯ãç°¡åã«è¨ãã¨ä¸è¨ã®ããã«ãªã£ã¦ãã¾ããã
Jenkins (master) -> 社å ã® mac -> æ°å°ã® Android å®æ©ç«¯æ«
ãã¹ãèªååãã¯ãããå½æã¨ãã¦ã¯ãå¿ è¦ååã ã£ããã¨æãã¾ãã
ç¾å¨ã§ã¯ãèªåãã¹ãã®æ°ã»å®è£ ãã人ã»å®è¡ããæ©ä¼ã大åå¢ãã¾ããã
ãããªãã¨ãæ§ã ãªèª²é¡ã«ééãã¾ãã
- ãã¹ãå®è¡æéã®å¢å
- å®æ©ç«¯æ«ã®ã¡ã³ããã³ã¹
- å®æ©ç«¯æ«ã®ä¸è¯(ãããã¯ã¼ã¯ãªã©)ã«ãããã¹ãã®å¤±æ
- Appiumã»Ruby ãªã©ã®å®è¡ç°å¢ã®ã¡ã³ããã³ã¹
iOS ã®èªåãã¹ãã¯ãæ¢ã«ã¯ã©ã¦ãã§å®å®çã«å®è¡ããã¦ãããããåãããã«ã§ããªããèãã¾ããã
æè¿ã 㨠Firebase Test Lab ã«ãã Android å®æ©ãã¹ãã話é¡ã«ãªã£ã¦ãã¾ãã
ããããFirebase Test Lab ã¯ãç¾ç¶ Appium ã«å¯¾å¿ãã¦ããªããããä»åç´¹ä»ãã Docker-Android ã試ãã¾ããã
Docker-Android
ä»åã®ãã¹ãå®è¡ç°å¢ä½æã§å©ç¨ããã®ã¯ Docker-Android ã¨å¼ã°ãã Docker ã¤ã¡ã¼ã¸ã§ãã
ä»å¹´ãã³ãã³ã§éå¬ããã AppiumConf2018 ã§ããã® Docker-Android ã«ã¤ãã¦ç´¹ä»ããã¦ãã¾ããã
ãã® Docker ã¤ã¡ã¼ã¸ã§ã¯ä»¥ä¸ã®ãããªç¹å¾´ãããã¾ãã
- ARM ã¨ãã¥ã¬ã¼ã¿ããé«éã«åã x86 ã¨ãã¥ã¬ã¼ã¿ãèµ·åã§ãã
- ç°å¢å¤æ°
APPIUM=true
ã§ã³ã³ããå 㧠Appium ãèµ·åã§ãã - Selenium Grid ã«ç°¡åã«æ¥ç¶ãã§ãã
- noVNC ã«ãã£ã¦ã³ã³ããå é¨ã§ã¨ãã¥ã¬ã¼ã¿ã®æ§åã確èªã§ãã
- ãããªã¬ã³ã¼ãã£ã³ã°ãã§ãã
以ä¸ã®ãã㪠docker-compose.yml
ãæ¸ãã$ docker-compose up -d
ãããã¨ã§
Selenium Grid Hub â Node (Android ã¨ãã¥ã¬ã¼ã¿ + Appium)
ãç°¡åã«ç«ã¡ä¸ãããã¨ãã§ãã¾ãã
# docker-compose.yml version: "2.2" services: selenium_hub: image: selenium/hub ports: - 4444:4444 nexus_5_8.0: image: butomo1989/docker-android-x86-8.0 privileged: true depends_on: - selenium_hub environment: - DEVICE=Nexus 5 - CONNECT_TO_GRID=true - APPIUM=true - SELENIUM_HOST=selenium_hub
ã¾ããåã Node ã§ããã°ãªãã·ã§ã³ã§ --scale nexus_5_8.0=XX
ãããã¨ã§ããã®æ°ãç°¡åã«å¢ãããã¨ãã§ãã¾ãã
ã¯ã©ã¦ãã§ã©ãå®è¡ãããã
åè¿°ã®éããä»åã¯å®å®æ§ãã¡ã³ããã³ã¹ã®ãã¨ãèããã¯ã©ã¦ãä¸ã§å®è¡ãããã¨ããæããããã¾ããã
Docker ã¤ã¡ã¼ã¸ã¨ãã¦æä¾ããã¦ããã°ãDocker à Selenium Grid ã®ããã«ç°¡åã«ã¯ã©ã¦ãã§å±éãããã¨ãã§ãããã§ãã
ãããããã® Docker-Android ãã¯ã©ã¦ãã§å©ç¨ããã«ã¯å¶éãããã¾ãã
Docker-Android ã§ã¯ x86 ã¨ãã¥ã¬ã¼ã¿ãå©ç¨ãã¦ããé½åä¸ããã¼ãã¦ã§ã¢ä»®æ³åæ©è½ãå¿ è¦ã«ãªãã¾ãã
ä¸è¬çãªã¯ã©ã¦ãã¤ã³ã¹ã¿ã³ã¹ã¯ãããèªä½ããã¼ãã¦ã§ã¢ä»®æ³åã®ä¸ã§åä½ãã¦ãããããã®æ©è½ãå©ç¨ãããã¨ãã§ãã¾ããã
ãã®ããã以ä¸ã®ããããç°å¢ä¸ã§ Docker-Android ãç«ã¡ä¸ããå¿ è¦ãããã¾ãã
ä»®æ³ãã·ã³ã®å ¥ãå(Nested Virtualization) ãæå¹ã«ãã
ä»®æ³ãã·ã³ã®ä¸ã§ããã«ãã¼ãã¦ã§ã¢ä»®æ³åæ©è½ã使ããã¨ãã§ãã¾ãã
ç¾å¨ Google Cloud 㨠Microsoft Azure ã§ãã®æ©è½ãå©ç¨ãããã¨ãã§ãã¾ãã
Google Compute Engine、仮想マシンの入れ子(Nested Virtualization)を可能に。KVM対応 - Publickey
クラウドの仮想マシンの上に仮想マシンを作れる、Nested Virtualizationに対応した新型VMをMicrosoft Azureがリリース - Publickey
ãã¢ã¡ã¿ã«ã¤ã³ã¹ã¿ã³ã¹ãå©ç¨ãã
ç©çãµã¼ãã¼ããã®ã¾ã¾å©ç¨ãããã¨ãã§ãã¾ãã
AWS ã§ã¯ç¾å¨ããã¢ã¡ã¿ã«ã¤ã³ã¹ã¿ã³ã¹(i3.metal)ãå©ç¨ãããã¨ãã§ãã¾ãã
AWS、ベアメタルサーバ「i3.metal」を正式サービスとして提供開始 - Publickey
ç¾å¨ã§ã¯ Docker-Android ãå種ã¯ã©ã¦ããµã¼ãã¹ã§ä½¿ãããã®ããã¥ã¡ã³ãããµã³ãã«ã³ã¼ããããã¾ãã
docker-android/README_CLOUD.md at master · budtmo/docker-android · GitHub
ä»åã¯ãã¡ãã®è¨äºãåèã«ãAWSã®ãã¢ã¡ã¿ã«ã¤ã³ã¹ã¿ã³ã¹(i3.metal)ãå©ç¨ãããã¨ã«ãã¾ããã
i3.metal ã¯ããªãé«æ§è½ã®ãããä»åã®ãã㪠Android ã¨ãã¥ã¬ã¼ã¿ãè¤æ°ç«ã¡ä¸ãã¦ãåé¡ã®ãªããã¹ãç°å¢ãä½ããã¨ãã§ãã¾ããã
Docker-Android ã«ããæ©æµ
ãããã«ãã£ã¦ãAndroidã»Appium ã®èªåãã¹ããã¨ãã¥ã¬ã¼ã¿ã§ä¸¦åå®è¡ã§ããç°å¢ãä½ããã¨ãã§ãã¾ããã
ãã®ä¸¦åå®è¡ã«ãã£ã¦ãããã¾ã§ããããã¹ãå®è¡æéãçããããã¨ãæå¾ ã§ãã¾ãã
å®è¡æéãçããªããã¨ã«ãã£ã¦ããã¹ãã®å®è¡æ©ä¼ãç¾ç¶ããå¢ãããã¨ãã§ãããã§ãã
ã¾ããã¯ã©ã¦ãåã»ã³ã³ããåã»ã¨ãã¥ã¬ã¼ã¿åã«ãã£ã¦ãã¡ã³ããã³ã¹ããªãã¨ãããªãé¨åãæ¸ãããã¨ãã§ããã¨æå¾ ãã¦ãã¾ãã
課é¡
以ä¸ã®ãããªæ©æµãããã®ã§ãããåæã«ããããåãçµã¾ãªãã¨ãããªã課é¡ãããã¾ãã
å®æ©ã¨ã¨ãã¥ã¬ã¼ã¿ã®å½¹å²åæ
ä»åã®ãã¹ãå®è¡ç°å¢ã§ã¯ Android ã¨ãã¥ã¬ã¼ã¿ãå©ç¨ãã¦ãã¾ãã
ããããã«ã¡ã©ãªã©è¤æ°ã®å®æ©ã§å®è¡ãã¹ããã¹ãããããããå ¨ã¦ã®ãã¹ããã¨ãã¥ã¬ã¼ã¿ã§æ ä¿ããã®ã¯é£ããã¨èãã¦ãã¾ãã
ä»å¾ã¯ã©ããå®æ©ã§è¡ãã¹ãã§ãã©ããã¨ãã¥ã¬ã¼ã¿æ ä¿ã§ãè¯ãã®ãå½¹å²åæ ããã¦ããå¿ è¦ãããã¾ãã
æ¤è¨¼ç°å¢ã¸ã®è² è·
ç¾ç¶ããã®ç°å¢ã¨æ¤è¨¼ç°å¢ã¯åé¢ããã¦ãã¾ãã
ãã®ããããã¹ãã®ä¸¦ååãé²ãã¨ããæ¤è¨¼ç°å¢ã¸ã®è² è·ãé«ããªã£ã¦ãã¾ãã¾ãã
æ¤è¨¼ç°å¢ãåæã«ã¹ã±ã¼ã«ããããã¢ãã¯åããããããªã©ã®å¯¾å¿ãå¿ è¦ã«ãªã£ã¦ãããã¨æãã¾ãã
ãã¹ãã®åæ£ã¨ãã¹ãã¬ãã¼ã
ç¾ç¶ã ã¨ã¬ãã¼ããªã©ã®é¢ä¿ä¸ãJenkinsã®Pipelineãã¡ã¤ã«ã§ãããããã¹ããå²ãæ¯ã£ã¦ãã¾ãã
ããããã¢ãã¤ã«UIãã¹ãã®ãããªãã¹ãå®è¡æéãé·ããªããã¡ãªãã®ã®å ´åãããããã®ã¨ãã¥ã¬ã¼ã¿ã«ã©ããã¹ããåæ£ãããã®ãã課é¡ã«ãªã£ã¦ãã¾ãã
ä»å¾ã¯ Knapsack ãªã©ã®ãã¼ã«ã試ããªããããã¹ããåæ£ã»æé©åããã¦ããããã®åãçµã¿ããã¦ããããã¨æãã¾ãã
ã¾ããåæ£ããããã¹ãã«åããã¦ãã¹ãã¬ãã¼ããå¤ãã¦ããå¿ è¦ãããã¾ãã
SeleniumConf Chicagoã§ãåæ£åããã Selenium ã®ãã¹ãã¬ãã¼ãã« Allure ãå©ç¨ãã¦ããäºä¾ãç´¹ä»ããã¦ããã®ã§ãä»å¾è©¦ãã¦ããããã¨æãã¾ãã
Allure | Test report and framework for writing self-documented tests
ãããã«
ä¸è¨ã®ããã«ã¾ã ã¾ã 課é¡ã¯ããã¾ãããUIãã¹ãã§ã©ãã¾ã§æ ä¿ãã¦ãããã¯å¼ãç¶ã QAã»ã¨ã³ã¸ã㢠ã¨èãã¦ãããªãã¦ã¯ããã¾ããã
ããããèªåãã¹ãã«ããã¦éãã¯æ£ç¾©ã ã¨èãã¦ãã¾ãããå®è¡æéã®ç縮ã«ãã£ã¦å®è¡æ©ä¼ãå¢ããã®ã«ã¯æªæ¥ãããã¨èãã¦ãã¾ãã
å¼ãç¶ãããè¯ãèªåãã¹ãç°å¢ã追ãæ±ãã¦ããããã¨æãã¾ãã
ææ¥ã®å·çæ å½ã¯ @satomi ã§ããå¼ãç¶ãã楽ãã¿ãã ããï¼