GitHub Release Build Status License

Overview

With the synthetics-test-automation-bitrise-step-upload-application step, you can upload a new version of your application to Datadog to run Synthetic tests against during your Bitrise CI, ensuring that all your teams using Bitrise can benefit from Synthetic tests at every stage of the software lifecycle. This step uses the Datadog CI Synthetics command, and requires that your application already exists.

Setup

This step is not available on the official Bitrise Step Library. To get started:

  1. Add the following git URL to your workflow. See the official Bitrise documentation on how to do that though the Bitrise app. You can also configure it locally by referencing the git URL in your bitrise.yml file.
- git::https://github.com/DataDog/synthetics-test-automation-bitrise-step-upload-application.git@1.6.0:
  1. Add your API and application keys to your secrets in Bitrise.
  2. Configure your step inputs. You can also configure them in your bitrise.yml file. The only required inputs are the two secrets you configured earlier. For a comprehensive list of inputs, see the Inputs section.

How to use this step locally

You can run this step directly using the Bitrise CLI.

To run this step locally:

  1. Open your terminal or command line.
  2. git clone the Bitrise repository.
  3. cd into the directory of the step (the one you just git cloned).
  4. Create a .bitrise.secrets.yml file in the same directory of bitrise.yml. The .bitrise.secrets.yml file is a Git-ignored file, so you can store your secrets in it.
  5. Check the bitrise.yml file for any secret you should set in .bitrise.secrets.yml.
  6. Once you have the required secret parameters in your .bitrise.secrets.yml file, run this step with the Bitrise CLI with bitrise run test.

An example .bitrise.secrets.yml file:

envs:
- A_SECRET_PARAM_ONE: the value for secret one
- A_SECRET_PARAM_TWO: the value for secret two

Usage

Example task using a global configuration override with configPath

This task overrides the path to the global datadog-ci.config.json file.

- git::https://github.com/DataDog/synthetics-test-automation-bitrise-step-upload-application.git@1.6.0:
   inputs:
   - api_key: <DATADOG_API_KEY>
   - app_key: <DATADOG_APP_KEY>
   - config_path: './synthetics-config.json'

For an example configuration file, see the global.config.json file.

Example including all possible configurations

For reference, this is an example of a complete configuration:

- git::https://github.com/DataDog/synthetics-test-automation-bitrise-step-upload-application.git@1.6.0:
   inputs:
   - api_key: <DATADOG_API_KEY>
   - app_key: <DATADOG_APP_KEY>
   - config_path: './global.config.json'
   - latest: true
   - mobile_application_version_id: '123-123-123'
   - mobile_application_version_file_path: 'path/to/application.apk'
   - site: 'datadoghq.com'
   - version_name: 'example 1.0'

Inputs

NameRequirementDescription
apiKeyrequiredYour Datadog API key. This key is created by your Datadog organization and will be accessed as an environment variable.
appKeyrequiredYour Datadog application key. This key is created by your Datadog organization and will be accessed as an environment variable.
configPathoptionalThe global JSON configuration is used when launching tests. See the example configuration for more details.
latestoptionalMarks the application as latest. Any tests that run on the latest version will use this version on their next run.
mobileApplicationVersionIdrequiredID of the application you want to upload the new version to.
mobileApplicationVersionFilePathrequiredOverride the application version for Synthetic mobile application tests.
siteoptionalThe Datadog site to send data to. Your Datadog site is . . If the DD_SITE environment variable is set, it takes precedence.
versionNamerequiredName of the new version. It has to be unique.

Outputs

NameDescription
DATADOG_UPLOADED_APPLICATION_VERSION_IDThe version ID of the application that was just uploaded. Pass it to the datadog-mobile-app-run-tests step with the mobile_application_version input to test this version of the application.

Further reading

Additional helpful documentation, links, and articles:

PREVIEWING: rtrieu/product-analytics-ui-changes