Skip to main content

Android Unit Tests

The Android Unit Tests workflow step executes the unit tests within your project, ensuring comprehensive test coverage. The results of these tests will be included in the artifact archive for further analysis and review.

Please check out this document for more information: Running Android Unit Tests

Prerequisites

The workflow steps that need to be executed before running the Android Unit Tests workflow step, along with their respective reasons, are listed in the table below.

Prerequisite Workflow StepDescription
Git CloneTo initiate the Android Unit Tests process, the repository that needs to be built must be fetched from the branch. This is achieved as follows: Upon completion of the Git Clone step, it generates the AC_REPOSITORY_DIR variable, which is then used as the input for the Android Unit Tests step.
warning

If you wish to view the test results on Appcircle's Test Reports page, it is essential to use the Test Reports step after the Android Unit Tests. Please check out this document for more information: Generating Test Report

Input Variables

For each component, specific input variables are required for its operation on your system. The input variables necessary for the Android Unit Tests are as follows:

Variable NameDescriptionStatus
$AC_REPOSITORY_DIRThis variable represents the path of the cloned Git repository. If this step runs after the Git Clone step, the variable will be automatically populated.Required
$AC_MODULEThis variable specifies the project module to be built. This variable can also be set via the build Configuration. In Android Studio, you can locate the available modules for your project. For more information, please refer to this Android document.Required
$AC_VARIANTSThis variable specifies the project variant to be built. This variable can also be set via the build Configuration. In Android Studio, you can find the available variants for your project. For more information, please refer to this Android document.Required
$AC_PROJECT_PATHSpecifies the project path. If your project that needs to be built is not located in the root directory where it was cloned from Git, you should provide the subpath as a relative path. The default value is: ./Optional

Output Variables

The outputs that can result from the operation of this component are listed as follows:

Variable NameDescription
$AC_TEST_RESULT_PATHSpecifies the directory where your JUnit XML report is stored.

To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-android-unit-test-component