github.com/jaylevin/jenkins-library@v1.230.4/resources/metadata/batsExecuteTests.yaml (about)

     1  metadata:
     2    name: batsExecuteTests
     3    description: This step executes tests using the [Bash Automated Testing System - bats-core](https://github.com/bats-core/bats-core).
     4    longDescription: |
     5      Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write behave as expected. A Bats test file is a Bash script with special syntax for defining test cases. Under the hood, each test case is just a function with a description.
     6  spec:
     7    inputs:
     8      resources:
     9        - name: tests
    10          type: stash
    11      params:
    12        - name: outputFormat
    13          type: string
    14          description: Defines the format of the test result output. junit would be the standard for automated build environments but you could use also the option tap.
    15          possibleValues: [tap, junit]
    16          scope:
    17            - STEPS
    18            - STAGES
    19            - PARAMETERS
    20          default: "junit"
    21        - name: repository
    22          type: string
    23          description: Defines the version of bats-core to be used. By default we use the version from the master branch.
    24          scope:
    25            - STEPS
    26            - STAGES
    27            - PARAMETERS
    28          default: "https://github.com/bats-core/bats-core.git"
    29        - name: testPackage
    30          type: string
    31          description: For the transformation of the test result to xUnit format the node module tap-xunit is used. This parameter defines the name of the test package used in the xUnit result file.
    32          scope:
    33            - STEPS
    34            - STAGES
    35            - PARAMETERS
    36          default: "piper-bats"
    37        - name: testPath
    38          type: string
    39          description: Defines either the directory which contains the test files (*.bats) or a single file. You can find further details in the Bats-core documentation.
    40          scope:
    41            - STEPS
    42            - STAGES
    43            - PARAMETERS
    44          default: "src/test"
    45        - name: envVars
    46          type: "[]string"
    47          description: "Injects environment variables to step execution. Format of value must be ['<KEY1>=<VALUE1>','<KEY2>=<VALUE2>']. Example: ['CONTAINER_NAME=piper-jenskins','IMAGE_NAME=my-image']"
    48          scope:
    49            - STEPS
    50            - STAGES
    51            - PARAMETERS
    52    outputs:
    53      resources:
    54        - name: influx
    55          type: influx
    56          params:
    57            - name: step_data
    58              fields:
    59                - name: bats
    60                  type: bool
    61    containers:
    62      - name: bats
    63        image: node:lts-stretch
    64        workingDir: /home/node
    65        conditions:
    66          - conditionRef: strings-equal
    67            params:
    68              - name: outputFormat
    69                value: junit