Integrating with universal-test-runner
Test actions integrate with the open-source command line tool
universal-test-runner
. 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
Open the CodeCatalyst console at https://codecatalyst.aws/.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow.
-
Choose Edit.
-
Choose Visual.
-
Choose Actions.
-
In Actions, choose Test.
-
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.
-
(Optional) Choose Validate to validate the workflow's YAML
code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.
- YAML
-
To use universal-test-runner in the YAML editor
Open the CodeCatalyst console at https://codecatalyst.aws/.
-
In the navigation pane, choose CI/CD, and then choose Workflows.
-
Choose the name of your workflow.
-
Choose Edit.
-
Choose YAML.
-
Choose Actions.
-
In Actions, choose Test.
-
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.
-
(Optional) Choose Validate to validate the workflow's YAML
code before committing.
-
Choose Commit, enter a commit message, and choose
Commit again.