Skip to content

junit

junit/mvntest@v1

Run a JUnit test class or test case.

mvntest actions have a mandatory test input. It may contain a properties input too.

The POM file is assumed to be in the current directory. If this not the case, use working-directory to specify in which directory the action is to be performed.

This action will attach all *.txt and *.xml files found in the target/surefire-reports directory.

Examples

In this first example, the POM file is in the current directory:

- uses: junit/mvntest@v1
  with:
    test: class#method
    properties:
      foo: value1
      bar: value2

In this second example, the POM file is in the cloned repository:

- uses: actions/checkout@v2
  with:
    repository: https://gitlab.com/myaccount/MyProject.git
- uses: junit/mvntest@v1
  with:
    test: class#method
    properties:
      foo: value1
      bar: value2
  working-directory: MyProject

Inputs

  • test (required)

    the datasource to use

  • properties (optional)

    the additional properties to use

junit/execute@v1

An execute action for use by generators.

execute actions have a mandatory test input:

- uses: junit/execute@v1
  with:
    test: path/to/test/root/qualified.testsuite.ClassName#testName

The path to test root is a relative path from the step’s working directory. If not specified, this is the job’s working directory, in which case it must include the repository name.

Inputs

  • test (required)

    the datasource to use

junit/params@v1

A params action for use by generators.

params actions have mandatory data and format inputs.

Example

- uses: junit/params@v1
  with:
    data:
      global:
        key1: value1
        key2: value2
      test:
        key1: value3
        key3: value4
    format: format
format must so far be SQUASHTM_FORMAT (tm.squashtest.org/params@v1).

data can have two keys:

  • global for defining global parameters
  • test for defining test parameters

Inputs

  • data (required)

    The data to use for the automated test

  • format (required)

    The format to use for the automated test data