Categorygithub.com/bitrise-steplib/bitrise-step-android-unit-test
repositorypackage
0.0.0-20250930134332-41045b1268ad
Repository: https://github.com/bitrise-steplib/bitrise-step-android-unit-test.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Android Unit Test

Step changelog

This step runs your Android project's unit tests.

Description

This step runs your Android project's unit tests.

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

⚙️ Configuration

Inputs
KeyDescriptionFlagsDefault
project_locationThe root directory of your android project, for example, where your root build gradle file exists (also gradlew, settings.gradle, etc...)required$BITRISE_SOURCE_DIR
moduleSet the module that you want to test. To see your available modules, please open your project in Android Studio, go to Project Structure and see the list on the left. Leave this input blank to test all modules.
variantSet the variant that you want to test. To see your available variants, please open your project in Android Studio, go to Project Structure, then to the variants section. Leave this input blank to test all variants.
argumentsExtra arguments passed to the gradle task
report_path_patternThe step will use this pattern to export Local unit test HTML results. The whole HTML results directory will be zipped and moved to the $BITRISE_DEPLOY_DIR. You need to override this input if you have custom output dir set for Local unit test HTML results. The pattern needs to be relative to the selected module's directory. Example 1: app module and debug variant is selected and the HTML report is generated at: - <path_to_your_project>/app/build/reports/tests/testDebugUnitTest this case use: *build/reports/tests/testDebugUnitTest pattern. Example 2: app module and NO variant is selected and the HTML reports are generated at: - <path_to_your_project>/app/build/reports/tests/testDebugUnitTest - <path_to_your_project>/app/build/reports/tests/testReleaseUnitTest to export every variant's reports use: *build/reports/tests pattern.required*build/reports/tests
result_path_patternThe step will use this pattern to export Local unit test XML results. The whole XML results directory will be zipped and moved to the $BITRISE_DEPLOY_DIR and the result files will be deployed to the Ship Addon. You need to override this input if you have custom output dir set for Local unit test XML results. The pattern needs to be relative to the selected module's directory. Example 1: app module and debug variant is selected and the XML report is generated at: - <path_to_your_project>/app/build/test-results/testDebugUnitTest this case use: *build/test-results/testDebugUnitTest pattern. Example 2: app module and NO variant is selected and the XML reports are generated at: - <path_to_your_project>/app/build/test-results/testDebugUnitTest - <path_to_your_project>/app/build/test-results/testReleaseUnitTest to export every variant's reports use: *build/test-results pattern.required*build/test-results
is_debugThe step will print more verbose logs if enabled.requiredfalse
quarantined_testsJSON list of tests added to quarantine on Bitrise.io, quarantined tests are excluded from test runs.$BITRISE_QUARANTINED_TESTS_JSON
Outputs
Environment VariableDescription
BITRISE_FLAKY_TEST_CASESA test case is considered flaky if it has failed at least once, but passed at least once as well. The list contains the test cases in the following format: - TestSuit_1.TestClass_1.TestName_1 - TestSuit_1.TestClass_1.TestName_2 - TestSuit_1.TestClass_2.TestName_1 - TestSuit_2.TestClass_1.TestName_1 ...

🙋 Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Learn more about developing steps: