Skip to content
Nathan Bu edited this page Jun 20, 2023 · 36 revisions

What is Hydra Lab?

Hydra Lab is a framework that can help you easily build an intelligent cloud testing platform utilizing the devices in hand.

Hydra Lab enables dev team to quickly build a self-manageable and intelligent cloud testing infrastructure. With the help of Hydra Lab, you can:

  • Either: Build a new cloud testing network with Hydra Lab released packages.
  • Or: Onboard your test device to an existing network with low-cost and small effort. Hydra Lab support automated test cases based on Appium(Java) for Android/iOS/Windows/Web(Browser), or Android Espresso.

And more specifically, with the help of this cloud testing infrastructure, the dev team can gain the ability to:

  • Check the status & manage the connected devices.
  • Upload test app binaries/packages, and then specify and deploy a test task.
  • Query test results and view visuals and videos of the test run.
  • Manage user permissions and access to test agent.

In short, any dev team can leverage this and quickly (within 1 week) set up a test automation infrastructure using a few local machines and real phones in hand and share it with another team to support the mobile (Android/iOS/Appium) testing workflow.

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.

Technical Architecture and Core Capabilities

Tech Architecture

C4 modeling Architecture

Context diagram:

c4_modeling_context

Containers and Components diagrams:

Hydra Lab Center service container:
c4_modeling_container_component_center

Hydra Lab Agent service container:
c4_modeling_container_component_agent

Code diagrams:

Test runner relation design:

classDiagram
direction RL
class TestRunner {
    <<Abstract>> 
}

class TestRunEngine {
    <<interface>>
    TestReport run(TestTask, TestRunDevice)
}
class TestRunLifecycle {
    <<interface>>
    setup(TestTask, TestRunDevice)
    execute(TestRun) throws Exception
    analyze(TestRun)
    teardown(TestRun)
    report(TestRun, TestResult)
    help(TestRun testRun, TestResult)
}

interface TestRunningCallback
TestRunner --> TestRunningCallback

TestRunner *--> DeviceManager


TestRunner --|> TestRunEngine
TestRunner --|> TestRunLifecycle

AppiumRunner --|> TestRunner
EspressoRunner --|> TestRunner
AdbMonkeyRunner --|> TestRunner
T2CRunner --|> AppiumRunner
SmartRunner --|> TestRunner
AppiumCrossRunner --|> AppiumRunner
Loading

Basics

RPC communication:

The test center service (running in the cloud) and test agent service (running on the test agent machine) communicate thru a websocket connection.

  • In agent project, com.microsoft.launcher.devices.socket.AgentWebSocketClient deals with the Client side connection, data transferring and scheme parsing. com.microsoft.launcher.devices.service.AgentWebSocketClientService deals with the business logic.
  • In center project, com.microsoft.devices.network.center.socket.CenterDeviceSocketEndpoint deal with serving the WebSocket clients, com.microsoft.devices.network.center.socket.CenterDeviceSocketEndpoint deals with session management, business logic and auth.

Known Security Issues

All known issues are tracked in HydraLab issues

About

We started the Hydra Lab project within Microsoft around mid-2021, leveraging the Microsoft Hackathon opportunity, to power the testing of Link to Windows and Microsoft Launcher projects. And after months of endeavor by the team, the project is becoming more and more full-fledged and supporting more teams' testing practices within Microsoft, making the test automation ecosystem a little better place to live. Kudos to the team!

Fun: Name Origins

Hydra is a many-headed serpent in Greek mythology, and we use this to demonstrate the multifunctional and scalability of the framework:

image

Clone this wiki locally