-
Notifications
You must be signed in to change notification settings - Fork 102
Performance test customization in the Hydra Lab
Ran Tao edited this page May 31, 2023
·
6 revisions
Name | Desc |
---|---|
TEST_SCHEDULE | Inspect the performance data every fixed time |
TEST_LIFECYCLE | Inspect the performance data at the life cycle of the test run (Such as test run start , test run finish ...) |
The performance inspector type defines what performance data is going to be inspected.
Name | Desc |
---|---|
INSPECTOR_ANDROID_MEMORY_INFO | Inspect the memory usage for target Android app |
INSPECTOR_ANDROID_BATTERY_INFO | Inspect the battery usage for target Android app |
INSPECTOR_WIN_MEMORY | Inspect the memory usage for target Windows app |
INSPECTOR_WIN_BATTERY | Inspect the battery usage for target Windows app |
INSPECTOR_IOS_ENERGY | Inspect the energy usage for target iOS app |
INSPECTOR_IOS_MEMORY | Inspect the memory usage for target iOS app |
For how to trigger a test task run from ADO pipeline, please refer to Trigger a test task from ADO pipeline
- Create a new YAML file based on testSpec.yml and add the performance configuration to the file.
For example:
testSpec:
inspectionStrategies:
# Inspect the battery usage of the Android app every 5 seconds
- strategyType: TEST_SCHEDULE
interval: 5000
intervalUnit: MILLISECONDS
inspection:
inspectorType: INSPECTOR_ANDROID_BATTERY_INFO
# App package name to be tested
appId: com.contoso.exampleapp
description: "Inspect battery on Android"
# Inspect the memory usage of the Android app at test started, test failed, test success, test run started and test run finished
- strategyType: TEST_LIFECYCLE
when:
- TEST_STARTED
- TEST_FAILURE
- TEST_SUCCESS
- TEST_RUN_STARTED
- TEST_RUN_FINISHED
inspection:
inspectorType: INSPECTOR_ANDROID_MEMORY_INFO
appId: com.contoso.exampleapp
description: "Inspect memory on Android"
# Inspect the memory usage of the Windows app
- strategyType: TEST_SCHEDULE
interval: 5000
intervalUnit: MILLISECONDS
inspection:
inspectorType: INSPECTOR_WIN_MEMORY
appId: com.contoso.exampleapp
description: "Inspect memory on Windows"
- Run Gradle task requestHydraLabTest implemented in the Gradle plugin with performance test configurations
- task: Gradle@2
displayName: Trigger Hydra Lab UI test
inputs:
gradleWrapperFile: 'UIAutomation/gradlew'
workingDirectory: 'UIAutomation'
# Performance configurations can be found in testSpec.yml
tasks: 'requestHydraLabTest -PymlConfigFile=testSpec.yml -PappPath=$(build.artifactstagingdirectory) -PtestAppPath=$(build.artifactstagingdirectory)\testApk -PtestSuiteName=$(testSuiteName) -PqueueTimeOutSeconds=$(testQueueTimeOut) -PrunTimeOutSeconds=$(testRunTimeOut) -PdeviceIdentifier=$(Android.Device.Identifier) -PgroupTestType=$(groupTestType) -PextraArgs="type=$(Build.Reason),buildId=$(Build.BuildId)" -PauthToken=$(authToken) -PpkgName=$(pkgName) -PtestPkgName=$(testPkgName)'
publishJUnitResults: false
The raw result files can be download via the artificats of the ADO pipeline
Q: How to resolve error "Out-File: Could not find a part of the path 'xxx'" with no performance results files generated?
A: This error occurs when the length of the perforamce file path exceeds MAX_PATH, which is defined as 260 characters in Windows API. To resolve this, please follow the Maximum Path Length Limitation to enable the long paths in Windows
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: