gaugeExecuteTests¶
Installs gauge and executes specified gauge tests.
Description¶
In this step Gauge (getgauge.io) acceptance tests are executed. Using Gauge it will be possible to have a three-tier test layout:
Acceptance Criteria Test implemenation layer Application driver layer
This layout is propagated by Jez Humble and Dave Farley in their book "Continuous Delivery" as a way to create maintainable acceptance test suites (see "Continuous Delivery", p. 190ff).
Using Gauge it is possible to write test specifications in Markdown syntax and therefore allow e.g. product owners to write the relevant acceptance test specifications. At the same time it allows the developer to implement the steps described in the specification in her development environment.
You can use the sample projects of Gauge.
Usage¶
We recommend to define values of step parameters via .pipeline/config.yml file.
In this case, calling the step is essentially reduced to defining the step name.
Calling the step can be done either in an orchestrator specific way (e.g. via a Jenkins library step) or on the command line.
library('piper-lib-os')
gaugeExecuteTests script: this
piper gaugeExecuteTests
Outputs¶
Output type | Details |
---|---|
influx | measurement step_data
|
Prerequisites¶
none
Parameters¶
Overview - Step¶
Name | Mandatory | Additional information |
---|---|---|
runCommand | yes | |
script | (yes) | reference to Jenkins main pipeline script |
installCommand | no | |
languageRunner | no | |
testOptions | no | |
verbose | no | activates debug output |
Overview - Execution Environment¶
Orchestrator-specific only
These parameters are relevant for orchestrator usage and not considered when using the command line option.
Name | Mandatory | Additional information |
---|---|---|
containerCommand | no | |
containerName | no | |
containerShell | no | |
dockerEnvVars | no | |
dockerImage | no | |
dockerName | no | |
dockerOptions | no | |
dockerPullImage | no | |
dockerVolumeBind | no | |
dockerWorkspace | no | |
sidecarEnvVars | no | |
sidecarImage | no | |
sidecarName | no | |
sidecarOptions | no | |
sidecarPullImage | no | |
sidecarReadyCommand | no | |
sidecarVolumeBind | no | |
sidecarWorkspace | no | |
stashContent | no |
Details¶
containerCommand¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
containerName¶
Jenkins-specific: Used for proper environment setup.
Optional configuration in combination with containerMap to define the container where the commands should be executed in.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | gauge |
Secret | no |
Configuration scope |
|
Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerEnvVars¶
Jenkins-specific: Used for proper environment setup.
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | map[NO_PROXY:localhost,selenium,$NO_PROXY no_proxy:localhost,selenium,$no_proxy] |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerImage¶
Jenkins-specific: Used for proper environment setup.
Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | node:lts-buster |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerName¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | gauge |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerOptions¶
Jenkins-specific: Used for proper environment setup.
Docker options to be set when starting the container.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerPullImage¶
Jenkins-specific: Used for proper environment setup.
Set this to 'false' to bypass a docker image pull. Useful during development process. Allows testing of images which are available in the local registry only.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | true |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
dockerWorkspace¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | /home/node |
Secret | no |
Configuration scope |
|
Resource references | none |
installCommand¶
Defines the command for installing Gauge. Gauge should be installed using npm. Example: npm install -g @getgauge/cli@1.2.1
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | curl -SsL https://downloads.gauge.org/stable | sh -s -- --location=$HOME/bin/gauge |
Secret | no |
Configuration scope |
|
Resource references | none |
languageRunner¶
Defines the Gauge language runner to be used. Example: java
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_languageRunner (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
runCommand¶
Defines the command which is used for executing Gauge. Example: run -s -p specs/
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_runCommand (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
script¶
Jenkins-specific: Used for proper environment setup.
The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this
parameter, as in script: this
. This allows the function to access the commonPipelineEnvironment
for retrieving, e.g. configuration parameters.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarEnvVars¶
Jenkins-specific: Used for proper environment setup.
A map of environment variables to set in the sidecar container, similar to dockerEnvVars
.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarImage¶
Jenkins-specific: Used for proper environment setup.
The name of the docker image of the sidecar container. If empty, no sidecar container is started. Similar to dockerImage
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarName¶
Jenkins-specific: Used for proper environment setup.
Name of the sidecar container. Similar to dockerName
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarOptions¶
Jenkins-specific: Used for proper environment setup.
Options to be set when starting the sidecar container. Similar to dockerOptions
.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarPullImage¶
Jenkins-specific: Used for proper environment setup.
Set this to 'false' to bypass a docker image pull. Useful during development process. Allows testing of images which are available in the local registry only.
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarReadyCommand¶
Jenkins-specific: Used for proper environment setup.
Command executed inside the container which returns exit code 0 when the container is ready to be used.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the sidecar container. Similar to dockerVolumeBind
.
Scope | Details |
---|---|
Aliases | - |
Type | map[string]string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
sidecarWorkspace¶
Jenkins-specific: Used for proper environment setup.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
stashContent¶
Jenkins-specific: Used for proper environment setup.
Specific stashes that should be considered for the step execution.
Scope | Details |
---|---|
Aliases | - |
Type | []string |
Mandatory | no |
Default | - buildDescriptor - tests |
Secret | no |
Configuration scope |
|
Resource references | none |
testOptions¶
Allows to set specific options for the Gauge execution. Details can be found for example in the Gauge Maven plugin documentation
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | no |
Default | $PIPER_testOptions (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
seleniumHubCredentialsId¶
Jenkins-specific: Used for proper environment setup. See using credentials for details.
Defines the id of the user/password credentials to be used to connect to a Selenium Hub. The credentials are provided in the environment variables PIPER_SELENIUM_HUB_USER
and PIPER_SELENIUM_HUB_PASSWORD
.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Configuration scope |
|
We recommend to define values of step parameters via config.yml file.
Example¶
Pipeline step:
gaugeExecuteTests script: this, testServerUrl: 'http://test.url'