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

Before running the Android Unit Tests step, you must complete certain prerequisites, as detailed 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.
Screenshot
danger

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

Screenshot

Input Variables

This step contains some input variable(s). It needs these variable(s) to work. The table below gives explanation for this variable(s).

image2
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 output(s) resulting from the operation of this component are 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