Skip to content

Commit 268d1e5

Browse files
committed
Revert "Merge branch 'llm' into zhoule/analysisSmartTestResult"
This reverts commit b09890f, reversing changes made to af3ce99.
1 parent b09890f commit 268d1e5

File tree

157 files changed

+609
-40125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+609
-40125
lines changed

.vscode/settings.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 109 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,30 @@
88
![Spring Boot](https://img.shields.io/badge/Spring%20Boot-v2.2.5-blue)
99
![Appium](https://img.shields.io/badge/Appium-v8.0.0-yellow)
1010
![License](https://img.shields.io/badge/license-MIT-green)
11+
![visitors](https://visitor-badge.glitch.me/badge?page_id=microsoft.hydralab&left_color=gray&right_color=red)
1112

1213
---
1314

1415
https://github.com/microsoft/HydraLab/assets/8344245/cefefe24-4e11-4cc7-a3af-70cb44974735
1516

16-
[What is Hydra Lab?](#what-is) | [Get Started](#get-started) | [Contribute](#contribute) | [Contact Us](#contact) | [Wiki](https://github.com/microsoft/HydraLab/wiki)
17+
[What is Hydra Lab?](#what-is) | [Get Started](#get-started) | [Who are using Hydra Lab?](#who-use-it) | [Contribute](#contribute) | [Contact Us](#contact) | [Links](#links) | [Wiki](https://github.com/microsoft/HydraLab/wiki)
1718
</div>
1819

20+
21+
1922
<span id="what-is"></span>
2023
## What is Hydra Lab?
2124

22-
As mentioned in the above video, Hydra Lab is a framework that can help you easily build a cloud-testing platform utilizing the test devices/machines in hand.
25+
Hydra Lab is a framework that can help you easily build a cloud testing platform utilizing the test devices/machines in hand.
26+
It enables dev team to quickly build a self-manageable and intelligent cloud testing infrastructure. With the help of Hydra Lab, you can:
27+
28+
- Either: Create a new cloud testing network.
29+
- Or: Onboard your test device to an existing network with a minimized effort.
2330

2431
Capabilities of Hydra Lab include:
2532
- Scalable test device management under the center-agent distributed design; Test task management and test result visualization.
26-
- Powering [Android Espresso Test](https://developer.android.com/training/testing/espresso), and Appium(Java) test on different platforms: Windows/iOS/Android/Browser/Cross-platform.
33+
- Powering [Android Espresso Test](https://developer.android.com/training/testing/espresso).
34+
- Appium(Java) test on different platforms: Windows/iOS/Android/Browser/Cross-platform.
2735
- Case-free test automation: Monkey test, Smart exploratory test.
2836

2937
For more details, see [Introduction: What is Hydra Lab?](https://github.com/microsoft/HydraLab/wiki)
@@ -37,59 +45,104 @@ Please visit our **[GitHub Project Wiki](https://github.com/microsoft/HydraLab/w
3745

3846
**Supported platforms and frameworks matrix**:
3947

40-
| | Appium(Java) | Espresso | XCTest | Maestro |
41-
| ---- |--------------|---- | ---- | ---- |
42-
|Android| &#10004; | &#10004; | x | &#10004; |
43-
|iOS| &#10004; | x | &#10004; | &#10004; |
44-
|Windows| &#10004; | x | x | x |
45-
|Web (Browser)| &#10004; | x | x | x |
48+
| | Appium(Java) | Espresso |
49+
| ---- |--------------|---- |
50+
|Android| &#10004; | &#10004; |
51+
|iOS| &#10004; | x | x |
52+
|Windows| &#10004; | x |
53+
|Web (Browser)| &#10004; | x |
4654

4755
<span id="quick-start"></span>
4856
### Quick guide on out-of-box Uber docker image
4957

50-
Hydra Lab offers an out-of-box experience of the Docker image, and we call it `Uber`. You can follow the below steps and start your docker container with both a center instance and an agent instance:
58+
Hydra Lab offers an out-of-box experience of docker image called Uber. You can follow the below steps and start your docker container with a center instance and an agent instance built in:
59+
60+
**Step 1. download and install Docker from https://www.docker.com**
5161

52-
**Step 1. Download and install [Docker](https://www.docker.com)**
62+
**Step 2. run on your machine**
5363

54-
**Step 2. Run on your machine**
64+
Simply choose one of the following commands to start your experience on Hydra Lab:
5565

56-
By Default, Hydra Lab will use the local file system as a storage solution, and you may type the following in your terminal to run it:
66+
**1. use local storage service**
67+
68+
Hydra Lab Uber image uses local file system as default storage, no extra environment variable is needed:
5769

5870
```bash
5971
docker run -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest
6072
```
6173

62-
> We strongly recommend using [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs/) service as the file storage solution, and Hydra Lab has native, consistent, and validated support for it.
74+
**2. use third-party storage service**
75+
76+
Hydra Lab currently supports [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs/) as cloud file storage solution to persist various file types such as log files, video, app package, etc.
77+
Any contribution to integrating other third-party storage services is welcome. (Here's the UML class diagram for this module as a reference: [storage service structure](https://github.com/microsoft/HydraLab/blob/main/docs/images/UML/storage_system_design.png).)
78+
79+
Some extra environment variables need to be specified in the command according to the storage service type.
80+
81+
If you want to use Azure Blob storage, please go to your Azure portal, open an Azure Blob storage account, and get the [connection string](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string).
82+
Brief steps: [Login Azure](https://azure.microsoft.com/) -> [Portal](https://portal.azure.com/#home) -> [Storage Accounts](https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Storage%2FStorageAccounts) -> Create new storage account (you may disable the public access for the container) -> In the created storage account, find `Access Keys` tab -> copy `Connection string`.
83+
![image](https://user-images.githubusercontent.com/8344245/216729523-387dc162-54d8-41dd-b136-f2e3c780b10a.png)
84+
85+
You may write the following content in an env file (e.g. env.properties):
86+
```
87+
STORAGE_TYPE=AZURE
88+
BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR}
89+
```
90+
91+
Then pass the path of the file to docker container
92+
93+
```bash
94+
docker run --env-file env.properties -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest
95+
```
6396

64-
**Step 3. Visit the web page and view your connected devices**
97+
Or simply run with the env parameter -e:
98+
99+
```bash
100+
docker run -e STORAGE_TYPE=AZURE -e BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR} -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest
101+
```
102+
103+
**Step 3. visit front-end page and view your connected devices**
65104

66105
> Url: http://localhost:9886/portal/index.html#/ (or your custom port).
67106
68107
Enjoy starting your journey of exploration!
69108

70109
**Step 4. Perform the test procedure with a minimal setup**
71110

72-
Note: For Android, Uber image only supports **Espresso/Instrumentation** test. See the "User Manual" section on this page for more features: [Hydra Lab Wikis](https://github.com/microsoft/HydraLab/wiki).
111+
Note: For Android, Uber image only supports **Espresso/Instrumentation** test. See "User manual" section on this page for more features: [Hydra Lab Wikis](https://github.com/microsoft/HydraLab/wiki).
73112

74-
**To run a test with Uber image and local storage:**
75-
- On the front-end page, go to the `Runner` tab and select `HydraLab Client`.
113+
**1. To run a test with Uber image and local storage:**
114+
- On the front-end page, go to `Runner` tab and select `HydraLab Client`.
76115
- Click `Run` and change "Espresso test scope" to `Test app`, click `Next`.
77116
- Pick an available device, click `Next` again, and click `Run` to start the test.
78117
- When the test is finished, you can view the test result in the `Task` tab on the left navigator of the front-end page.
79118

80119
![Test trigger steps](docs/images/test-trigger-steps.png)
81120

121+
**2. To run a test with Uber image and any third-party storage service, additional steps are required before the same steps in `1.`:**
122+
- Download [record_release.apk](https://github.com/microsoft/HydraLab/tree/main/common/src/main/resources/record_release.apk) and [record_androidTest.apk](https://github.com/microsoft/HydraLab/tree/main/common/src/main/resources/record_androidTest.apk) from GitHub.
123+
- On the front-end page, go to `Runner` tab and click `Upload`.
124+
- Select the downloaded app `record_release.apk` for `APK/IPA FILE` and test app `record_androidTest.apk` for `TEST APK/JAR/JSON FILE`.
125+
- Click `Upload` and wait for it to finish.
126+
- Follow the steps of 1. to run the test.
127+
128+
Notice:
129+
- The package record shown on the page is preloaded for LOCAL storage only. If you try to run it with a different storage type, you will get an error.
130+
- You need to upload the package again if you want to use your own storage service instead of LOCAL storage.
131+
- You can never use more than one storage type in the official service. The above specific situation only occurs in Uber image where the context and database are set up with LOCAL storage as the default option for new users.
132+
133+
![Package upload steps](docs/images/package-upload-steps.png)
134+
82135

83-
### Build and run Hydra Lab from the source
136+
### Quick guide on build and run
84137

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

87140
> The build and run process will require JDK11 | NPM | Android SDK platform-tools in position.
88141
89-
**Step 1. Run Hydra Lab center service**
142+
**Step 1. build and run Hydra Lab center service.**
90143

91144
```bash
92-
# In the project root, switch to react folder to build the Web front.
145+
# In project root, switch to react folder to build the Web front.
93146
cd react
94147
npm ci
95148
npm run pub
@@ -104,37 +157,52 @@ java -jar center/build/libs/center.jar
104157

105158
> 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.
106159
107-
**Step 2. Run Hydra Lab agent service**
160+
**Step 2. build and run Hydra Lab agent service.**
108161

109162
```bash
110-
# In the project root
163+
# In project root
111164
cd android_client
112165
# Build the Android client apk
113166
./gradlew assembleDebug
114167
cp app/build/outputs/apk/debug/app-debug.apk ../common/src/main/resources/record_release.apk
115168
# If you don't have the SDK for Android ,you can download the prebuilt APK in https://github.com/microsoft/HydraLab/releases
116-
# Back to the project root
169+
# Back to project root
117170
cd ..
118-
# In the project root, copy the sample config file and update the:
171+
# In project root, copy the sample config file and update the:
119172
# YOUR_AGENT_NAME, YOUR_REGISTERED_AGENT_ID and YOUR_REGISTERED_AGENT_SECRET.
120173
cp agent/application-sample.yml application.yml
121-
# Then build an agent jar and run it
174+
# Then build agent jar and run it
122175
gradlew :agent:bootJar
123176
java -jar agent/build/libs/agent.jar
124177
```
125178

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

181+
**Technical design overview:**
182+
183+
![Tech Architecture](docs/images/technical_architecture.png)
184+
128185
### More integration guidelines:
129186

130-
- [Test agent setup](https://github.com/microsoft/HydraLab/wiki/Test-agent-setup)
131187
- [Trigger a test task run in the Hydra Lab test service](https://github.com/microsoft/HydraLab/wiki/Trigger-a-test-task-run-in-the-Hydra-Lab-test-service)
132-
- [Deploy Center Docker Container](https://github.com/microsoft/HydraLab/wiki/Deploy-Center-Docker-Container)
188+
- [Deploy a test agent service](https://github.com/microsoft/HydraLab/wiki/Deploy-a-test-agent-service)
189+
- [Create an Appium UI Test Automation Project](https://github.com/microsoft/HydraLab/wiki/Create-an-Appium-UI-Test-Automation-Project)
190+
191+
> Note: If you are a Microsoft FTE and want to onboard to the internal Hydra Lab testing service, please visit [our SharePoint site](https://microsoftapc.sharepoint.com/teams/MMXDocument/SitePages/Hydra-Lab-test-automation-service-onboarding-guideline.aspx) to learn more about the internal service instance.
192+
193+
<span id="who-use-it"></span>
194+
## Who are using Hydra Lab?
195+
196+
It's already powering the UI test automation of the following Microsoft products:
197+
- Microsoft Phone Link (Windows UWP app) and Link to Windows (Android app)
198+
- Microsoft Launcher (Android)
199+
- Microsoft Outlook/Edge (Android/iOS)
200+
- Microsoft Fluent UI Android/Yammer Android
133201

134202
<span id="contribute"></span>
135203
## Contribute
136204

137-
Your contribution to Hydra Lab will make a difference for the entire test automation ecosystem. Please refer to **[CONTRIBUTING.md](CONTRIBUTING.md)** for instructions.
205+
Your contribution to Hydra Lab will make a difference for the entire test automation ecosystem. Please refer to **[CONTRIBUTING.md](CONTRIBUTING.md)** for contribution instructions.
138206

139207
### Contributor Hero Wall:
140208

@@ -145,8 +213,17 @@ Your contribution to Hydra Lab will make a difference for the entire test automa
145213
<span id="contact"></span>
146214
## Contact Us
147215

148-
You can reach us by [opening an issue](https://github.com/microsoft/HydraLab/issues/new) or [sending us mails](mailto:[email protected]).
216+
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:
217+
- [Open an issue](https://github.com/microsoft/HydraLab/issues/new) or submit PRs.
218+
- Email us: [[email protected]](mailto:[email protected]).
219+
220+
<span id="links"></span>
221+
## Links
149222

223+
- [Hydra Lab: the next generation cross-platform software testing infrastructure open-sourced by Microsoft](https://medium.com/@nathanbu/we-open-sourced-a-new-test-framework-on-github-in-microsoft-fd31f8861d1e)
224+
- [Release Notes](https://github.com/microsoft/HydraLab/releases), [Hydra Lab on Up For Grabs](https://up-for-grabs.net/#/filters?names=438)
225+
- [Appium: Cross-platform automation framework for all kinds of your apps built on top of W3C WebDriver protocol.](https://github.com/appium/appium)
226+
- [Google Android Tools Ddmlib: A ddmlib jar that provides APIs for talking with Dalvik VM.](https://android.googlesource.com/platform/tools/base/+/master/ddmlib/)
150227

151228
<span id="ms-give"></span>
152229
## Microsoft Give Sponsors
@@ -155,6 +232,8 @@ Thank you for your contribution to [Microsoft employee giving program](https://a
155232

156233
[@Germey(崔庆才)](https://github.com/Germey), [@SpongeOnline(王创)](https://github.com/SpongeOnline), [@ellie-mac(陈佳佩)](https://github.com/ellie-mac), [@Yawn(刘俊钦)](https://github.com/Aqinqin48), [@White(刘子凡)](https://github.com/jkfhklh), [@597(姜志鹏)](https://github.com/JZP1996), [@HCG(尹照宇)](https://github.com/mahoshojoHCG)
157234

235+
![Microsoft Give](docs/images/Give_WebBanner.png)
236+
158237
<span id="license-trademarks"></span>
159238
## License & Trademarks
160239

agent/agent_installer/Windows/restartAgent.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set newfile=%1
1717
::stop hydra lab agent service
1818
net stop "Hydra Lab Agent Service"
1919
::kill hydra lab agent java process
20-
Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
20+
::Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
2121
if "%newfile%"=="" ( echo "No need to update" ) else (
2222
if not exist "%newfile%" ( echo "%newfile% not exist" ) else (
2323
echo "Updating"

agent/agent_installer/Windows/restartAgent_WindowsService.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set newfile=%1
1717
::stop hydra lab agent service
1818
net stop "Hydra Lab Agent Service"
1919
::kill hydra lab agent java process
20-
Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
20+
::Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
2121
if "%newfile%"=="" ( echo "No need to update" ) else (
2222
if not exist "%newfile%" ( echo "%newfile% not exist" ) else (
2323
echo "Updating"

agent/agent_installer/Windows/restartAgent_WindowsTaskScheduler.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ echo newfile = %1
1616
set newfile=%1
1717
::stop hydra lab agent service
1818
::net stop "Hydra Lab Agent Service"
19-
::kill hydra lab agent java process
20-
Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
19+
kill hydra lab agent java process
20+
::Powershell -Command "& {Get-WmiObject Win32_Process -Filter \"name like '%%java%%' and CommandLine like '%%agent%%'\" | Select-Object ProcessId -OutVariable pids;if(-not $pids -eq '' ) {stop-process -id $pids.ProcessId}}"
2121
if "%newfile%"=="" ( echo "No need to update" ) else (
2222
if not exist "%newfile%" ( echo "%newfile% not exist" ) else (
2323
echo "Updating"

agent/doc/UML/hydra_lab_exception_monitor_design.puml

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)