Integrating universal-test-runner into a test action - Amazon CodeCatalyst

Integrating universal-test-runner into a test action

Test actions integrate with the open-source command line tool universal-test-runner. This tool provides advanced testing features, such as retrying one or more test cases from a test report. universal-test-runner uses the Test Execution Protocol to run your tests for any language in a given framework. universal-test-runner supports the following frameworks:

universal-test-runner is installed only on the curated images for test actions. If you configure a test action to use a custom Docker Hub or Amazon ECR, you must manually install universal-test-runner to enable advanced testing features. To do so, install Node.js (14 or higher) on the image, then install universal-test-runner through npm using the shell command - Run: npm install -g @aws/universal-test-runner. For more information about installing Node.js in your container through shell commands, see Installing and Updating Node Version Manager.

For more information about universal-test-runner, see What is universal-test-runner?

Visual
To use universal-test-runner in the visual editor
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. In the navigation pane, choose CI/CD, and then choose Workflows.

  3. Choose the name of your workflow.

  4. Choose Edit.

  5. Choose Visual.

  6. Choose Actions.

  7. In Actions, choose Test.

  8. On the Configuration tab, complete the Shell commands field by updating the sample code with your choice of the supported frameworks. For example, to use a supported framework, you would use a Run command similar to the following.

    - Run: run-tests <framework>

    If the framework you want is not supported, consider contributing a custom adapter or runner. For a description of the Shell commands field, see Steps.

  9. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  10. Choose Commit, enter a commit message, and choose Commit again.

YAML
To use universal-test-runner in the YAML editor
  1. Open the CodeCatalyst console at https://codecatalyst.aws/.

  2. In the navigation pane, choose CI/CD, and then choose Workflows.

  3. Choose the name of your workflow.

  4. Choose Edit.

  5. Choose YAML.

  6. Choose Actions.

  7. In Actions, choose Test.

  8. Modify the YAML code according to your needs. For example, to use a supported framework, you would use a Run command similar to the following.

    Configuration: Steps: - Run: run-tests <framework>

    If the framework you want is not supported, consider contributing a custom adapter or runner. For a description of the Steps property, see Steps.

  9. (Optional) Choose Validate to validate the workflow's YAML code before committing.

  10. Choose Commit, enter a commit message, and choose Commit again.