Skip to content

meihaoyidian/HydraLab

 
 

Repository files navigation

Hydra Lab

Build your own cloud testing infrastructure

What is Hydra Lab?

Hydra Lab is a framework that can help you easily build a cloud testing platform utilizing the test devices/machines in hand. It enables dev team to quickly build a self-manageable and intelligent cloud testing infrastructure. With the help of Hydra Lab, you can:

  • Either: Create a new cloud testing network.
  • Or: Onboard your test device to an existing network with a minimized effort.

Capabilities of Hydra Lab include:

  • Scalable test device management under the center-agent distributed design; Test task management and test result visualization.
  • Powering Android Espresso Test.
  • Appium(Java) test on different platforms: Windows/iOS/Android/Browser/Cross-platform.
  • Case-free test automation: Monkey test, Smart exploratory test.

For more details, see Introduction: What is Hydra Lab?

Get Started

Please visit our GitHub Project Wiki to understand the dev environment setup procedure: Contribution Guideline

Supported environments for Hydra Lab agent: Windows, Mac OSX, and Linux (Docker).

Supported platforms and frameworks:

Appium(Java) Espresso
Android
iOS x
Windows x
Web (Browser) x

Quick guide on out-of-box Uber docker image

Hydra Lab uses Azure Blob Storage as cloud file storage solution to persist log files, video, app package, etc. Please go to your Azure portal, open an Azure blob storage account, get the connection string, and place it in the environment variable with the name of BLOB_CONNECTION_STR.

Hydra Lab offers an out-of-box experience of docker image called Uber. By providing the env variable BLOB_CONNECTION_STR simply, you can follow the below steps and start your docker container with a center instance and an agent instance built in:

Step 1. pull Docker image from container registry

docker pull ghcr.io/microsoft/hydra-lab-uber:latest

Step 2. run on your machine with BLOB_CONNECTION_STR

You may write the content BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR} in an env file (e.g. env.txt), and pass the path of the file to docker container:

docker run [-p 9886:9886] [--name=hydra-lab] --env-file ${YOUR_ENV_FILE_PATH} ghcr.io/microsoft/hydra-lab-uber:latest

Or simply run with the env parameter -e:

docker run [-p 9886:9886] [--name=hydra-lab] -e BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR} ghcr.io/microsoft/hydra-lab-uber:latest

Step 3. visit front-end page and view your connected devices

Url: http://localhost:9886/portal/index.html#/ (or your custom port).

Enjoy starting your journey of exploration!

Note: Uber now only provides the Espresso test feature for Android, please refer to this section for more features: For Hydra Lab User

Quick guide on build and run

You can also run the center java Spring Boot service (a runnable Jar) separately with the following commands:

The build and run process will require JDK11 | NPM | Android SDK platform-tools in position.

Step 1. build and run Hydra Lab center service.

# In project root, switch to react folder to build the Web front.
cd react
npm ci
npm run pub
# Get back to the project root, and build the center runnable Jar. 
cd ..
# For the gradlew command, if you are on Windows please replace it with `./gradlew` or `./gradlew.bat`
gradlew :center:bootJar
# Run it, and then visit http://localhost:9886/portal/index.html#/
java -jar center/build/libs/center.jar
# Then visit http://localhost:9886/portal/index.html#/auth to generate a new agent ID and agent secret.

If you encounter the error: Error: error:0308010C:digital envelope routines::unsupported, set the System Variable NODE_OPTIONS as --openssl-legacy-provider and then restart the terminal.

Step 2. build and run Hydra Lab agent service.

# In project root, copy the sample config file and update the:
# YOUR_AGENT_NAME, YOUR_REGISTERED_AGENT_ID and YOUR_REGISTERED_AGENT_SECRET.
cp agent/application-sample.yml application.yml
# Then build agent jar and run it
gradlew :agent:bootJar
java -jar agent/build/libs/agent.jar

Step 3. visit http://localhost:9886/portal/index.html#/ and view your connected devices

Technical design overview:

Tech Architecture

For Hydra Lab User:

Note: 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.

For Contributor:

Who are using Hydra Lab?

It's already powering the UI test automation of the following Microsoft products:

  • Microsoft Phone Link (Windows UWP app) and Link to Windows (Android app)
  • Microsoft Launcher (Android)
  • Microsoft Outlook/Edge (Android/iOS)
  • Microsoft Fluent UI Android/Yammer Android

Contribute

Your contribution to Hydra Lab will make a difference for the entire test automation ecosystem. Please refer to CONTRIBUTING.md for contribution instructions.

Contributor Hero Wall:

Contact Us

Feel free to dive in! If you have questions about Hydra Lab, or you would like to reach out to us about an issue you're having, you can reach us as follows:

Links

Microsoft Give Sponsors

Thank you for your contribution to Microsoft employee giving program in the name of Hydra Lab:

@Germey(崔庆才), @SpongeOnline(王创), @ellie-mac(陈佳佩), @Yawn(刘俊钦), @White(刘子凡), @597(姜志鹏)

Microsoft Give

License & Trademarks

The entire codebase is under MIT license.

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

About

Intelligent cloud testing made easy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 65.5%
  • JavaScript 17.9%
  • HTML 9.6%
  • PowerShell 2.4%
  • TypeScript 1.9%
  • CSS 1.3%
  • Other 1.4%