-
Notifications
You must be signed in to change notification settings - Fork 101
Trigger a test task run in the Hydra Lab test service
OliverShen edited this page Feb 22, 2024
·
7 revisions
- Apply the Gradle plugin to your project.
- see Gradle plugin README for usage detail of Gradle plugin.
- see Release Notes for brief release notes and version numbers of the latest versions.
-
Known issue: Gradle plugin leverages GSON for serialization/deserialization between JSON and Java objects. For Gradle with JVM >= 17, there may be some issue like the following on some Java built-in modules:
Caused by: com.google.gson.JsonIOException: Failed making field 'java.io.File#path' accessible; either change its visibility or write a custom TypeAdapter for its declaring type.
- Workaround: run Gradle plugin command with the following param: "-Dorg.gradle.jvmargs=--add-opens=java.base/java.io=ALL-UNNAMED", substitute the module name to the one you may encounter with.
- Run Gradle task requestHydraLabTest implemented in the Gradle plugin for running test.
- task: Gradle@2 displayName: Trigger Hydra Lab UI test inputs: gradleWrapperFile: 'UIAutomation/gradlew' workingDirectory: 'UIAutomation' tasks: 'requestHydraLabTest -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)" -PreportAudience=TestLabOwner -PauthToken=$(authToken) -PpkgName=$(pkgName) -PtestPkgName=$(testPkgName)' publishJUnitResults: false
If you would like to enable check for test failure within the task, set publishJUnitResults to true, and the task will fail if there's any test failure.
By default the
runTimeOutSeconds
is set to 45*60 (45min) if not provided. So if you expect to have a longer test run please update the value of it.
- PublishTestResults task for publishing test result to tests tab in pipeline result page.
The "authToken" in the parameter list of pipeline can be found on the HydraLab Portal:
- task: PublishTestResults@2 displayName: 'Publish Test Results $(build.sourcesdirectory)/${PATH_TO_YOUR_SUBMODULE_ROOT_WITH_PLUGIN}/build/testResult/**/hydra_result_*.xml' inputs: testResultsFiles: '$(build.sourcesdirectory)/${PATH_TO_YOUR_SUBMODULE_ROOT_WITH_PLUGIN}/build/testResult/**/hydra_result_*.xml' testRunTitle: 'Test-Result' failTaskOnFailedTests: true
- Test result can be found in Tests tab of pipeline running result page:
- Click on error items on above image to see detailed stack traces:
- The link of related testing video will also show in pipeline log.
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: