-
Notifications
You must be signed in to change notification settings - Fork 102
Deploy a test agent service
If you are a Microsoft FTE and want to onboard to the internal Hydra Lab testing service, please visit our SharePoint site to learn more about the internal service instance.
You can try the installer-Android.ps1 script to set up a new Windows agent for Android if the PC is brand new or its environment is clean enough. installer.zip
- Install iTunes on Microsoft store (The iOS devices need to connected to iTunes and set as a trusted device).
- Install tidevice: pip3 install -U "tidevice[openssl]"
- We also provide a script named as installer-iOS.ps1 for iOS-Windows agent. installer.zip
- Install: You can run the installer.sh script in this zip Hydra - ios Mac agent installer.zip to setup the environment.
- Restart: Install: You can run the restartAgent.sh script in zip of first step.
- Install Java sdk link (at least jdk 11)
- Install Python 3.7+ link
- Install Android sdk link
- Install Node.js link
- Install Appium execute
npm install -g appium
- Install WinAppdriver 1.2.1
- Install FFmpeg: Download ffmpeg-release-essentials.7z from link, unzip and add bin folder into PATH
- Config Environment Variables - System variables (take this as a reference)
Type | Variable Name | Value |
---|---|---|
Java | JAVA_HOME | C:\Program Files\Java\jdk-11.0.14 |
Java | CLASSPATH | .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; |
Java | Path | %JAVA_HOME%\bin |
Java | Path | %JAVA_HOME%\jre\bin |
Python | Path | C:\Python38| |
Python | Path | C:\Python38\Scripts| |
Android | ANDROID_HOME | C:\Users\demo\AppData\Local\Android\Sdk |
Android | ANDROID_PLATFORM_TOOLS | C:\Users\demo\AppData\Local\Android\Sdk\platform-tools |
Android | Path | %ANDROID_HOME% |
Android | Path | %ANDROID_PLATFORM_TOOLS% |
Node | NODE_PATH | C:\Users\demo\AppData\Roaming\npm\node_modules |
Node | Path | C:\Users\demo\AppData\Roaming\npm;C:\Program Files\nodejs |
Appium | APPIUM_BINARY_PATH | C:\Users\demo\AppData\Roaming\npm\node_modules\appium\build\lib\main.js |
FFmpeg | Path | C:\Program Files\ffmpeg-4.4.1-essentials_build\bin |
- Register an agent in Hydra Lab Center WebSite. (Please contact hydra_lab_support@microsoft.com if you are Microsoft FTE and want to use the MS internal network)
- Create a new folder in you PC.
- Build the agent project as agent.jar and copy the file to the folder. To build the agent, run the following command in the project root dir:
gradlew :agent:bootJar
- Unzip Agent Install.zip to the folder, the folder shows like this picture.
-
Modify application.yml or config/application.yml (a sample configuration is available here: sample YAML config)
- app.registry.server
- The hostname + port of the center server. For instance, if it's running on a machine with the hostname of testagent.hydralab.com and servicing on port 9886, then this value should be "testagent.hydralab.com:9886".
- app.registry.id
- app.registry.secret
- app.registry.name
- app.registry.agent-type (An int value to indicate the type of test devices for Testing)
- Value 1 represents WINDOWS PC + n * ANDROID devices -> For Android test agent.
- Value 2 represents WINDOWS PC + 1 * ANDROID device, support running Appium Test case on Windows -> For Windows-Android cross-platform agent.
- Value 3 represents WINDOWS/MAC PC + n * iOS devices -> For iOS test agent.
- management.metrics.export.prometheus.pushgateway.enabled (Optional; If true, will send metrics to our stability monitor. When an exception happens, we will receive emails.)
- app.registry.server
- Install it as a Windows Service: open cmd/powershell, execute command : .\AgentInstaller.exe install
- Open Windows Services and find a service named Hydra Lab Agent Service.
- You can start/stop the service.
- if it starts successfully, the agent will show up in HydraLab center portal. BTW, only the agent connected with devices will be displayed on the page.
To ensure your Android Test Phone can be stably connected to the agent/center service, please turn on the Android Debug mode on your phone and connect the phone to the PC with cable or ADB wireless mode (Another guideline for wireless setup).
After a successful test run, you will find that a new app is installed on the phone called "HydraLab Client", which chiefly helps record test run videos on the phone. You can add it to the battery save mode whitelist to secure the recording service running consistently. We have pragmatically enabled it with this relevant code and this, but on some phones with customized rom you may need to configure it manually in the Setting, e.g.: Settings > Battery > Battery Optimization.
TBD
Introduction:
User manual:
- Deploy Center Docker Container
- Deploy Agent Docker Container
- Test agent setup
- One-Line-Installer Agent Setup
- [DEPRECATED]Deploy a test agent service
- Trigger a test task run in the Hydra Lab test service
- Create an Appium UI Test Automation Project
- Create test build and run XCTest
- Test Task Customization
- FAQ
Developer guideline:
- Start Services with Default Configuration
- Dev Environment Setup
- Technical Design
- Integrate Hydra Lab test center with Microsoft AAD authentication service
- Upgrade the test agent service from center service
News: