1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/resources/metadata/newmanExecute.yaml

96 lines
3.5 KiB
YAML
Raw Normal View History

feat(newmanExecute): golang implmementation for newmanExecute (#2513) * Automates first parts of newmanExecute.groovy Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds newman installation Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Removes warning Signed-off-by: Fabian Reh <fabian.reh@sap.com> * makes tests robust for later shell calls Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds version logging Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds tests for version logging Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds newman shell execution Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Prepare cloud foundry apps with secrets handling Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds further process to CF Utils Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Fixes unit test Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds error category Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Add fix to execute step locally Currently only tested on windows machine locally in powershell. Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adapt unit test to fix of runCommand Signed-off-by: Fabian Reh <fabian.reh@sap.com> * refactored golang step to newmanExecute * wip * added test config * refactored newmanExecute groovy wrapper step * exclude newmanExecute from common step test * cleaups * add credential support * fix groovy credential providing * add import * add stageName * define script * remove unused vars * add import * fix iterator ref * golang secret handling and cleanups * wip * wip * wip * update go step * implement cf credential proposal * testRepository functionality implemented * register secrets to logger * add missing dependecies * test xsuaa credential handling * wip * wip * cleanups * add import * remove mandatory params * add container definition * test runCommand * test runCommand * fix npm path * fix npm path * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * added newmanEnvironment to templating * wip * use env and globals params in runCommand when no templating * fix condition * wip * reverted config edit * updated documentation * install with shell * wip * wip * fix tests * refactor tests * wip * remove old test * wip * escape go tmpl * escape go tmpl * fix defaults * add doc comment * remove test case * refactored newman commands * add cli reporter * refactor options * mock os getenv and fix all tests * refactoring and doc update * go generate * small refactor * spelling * fix newman doc * remove MaskPasswords wrapper; fix stash bug; * docu fix Co-authored-by: Fabian Reh <fabian.reh@sap.com>
2021-03-17 09:08:33 +02:00
metadata:
name: newmanExecute
description: Installs newman and executes specified newman collections.
longDescription: |
This script executes [Postman](https://www.getpostman.com) tests from a collection via the [Newman](https://www.getpostman.com/docs/v6/postman/collection_runs/command_line_integration_with_newman) command line tool.
spec:
inputs:
resources:
- name: tests
type: stash
params:
- name: newmanCollection
description: The test collection that should be executed. This could also be a file pattern.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
default: '**/*.postman_collection.json'
- name: newmanRunCommand
description: +++ Deprecated +++ Please use list parameter `runOptions` instead.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
- name: runOptions
description: The newman command that will be executed inside the docker container.
scope:
- PARAMETERS
- STAGES
- STEPS
type: "[]string"
default:
- run
- "{{.NewmanCollection}}"
- --reporters
- cli,junit,html
- --reporter-junit-export
- target/newman/TEST-{{.CollectionDisplayName}}.xml
- --reporter-html-export
- target/newman/TEST-{{.CollectionDisplayName}}.html
- name: newmanInstallCommand
description: The shell command that will be executed inside the docker container to install Newman.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
default: npm install newman newman-reporter-html --global --quiet
- name: newmanEnvironment
description: Specify an environment file path or URL. Environments provide a set of variables that one can use within collections.
longDescription: see also [Newman docs](https://github.com/postmanlabs/newman#newman-run-collection-file-source-options)
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
- name: newmanGlobals
description: Specify the file path or URL for global variables. Global variables are similar to environment variables but have a lower precedence and can be overridden by environment variables having the same name.
longDescription: see also [Newman docs](https://github.com/postmanlabs/newman#newman-run-collection-file-source-options)
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
- name: failOnError
description: Defines the behavior, in case tests fail.
scope:
- PARAMETERS
- STAGES
- STEPS
type: bool
default: true
- name: cfAppsWithSecrets
description: List of CloudFoundry apps with secrets
longDescription: Define name array of cloud foundry apps deployed for which secrets (clientid and clientsecret) will be appended to the newman command that overrides the environment json entries (--env-var <appName_clientid>=${clientid} & --env-var <appName_clientsecret>=${clientsecret})
scope:
- PARAMETERS
- STAGES
- STEPS
type: "[]string"
outputs:
resources:
- name: influx
type: influx
params:
- name: step_data
fields:
- name: newman
type: bool
feat(newmanExecute): golang implmementation for newmanExecute (#2513) * Automates first parts of newmanExecute.groovy Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds newman installation Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Removes warning Signed-off-by: Fabian Reh <fabian.reh@sap.com> * makes tests robust for later shell calls Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds version logging Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds tests for version logging Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds newman shell execution Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Prepare cloud foundry apps with secrets handling Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds further process to CF Utils Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Fixes unit test Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adds error category Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Add fix to execute step locally Currently only tested on windows machine locally in powershell. Signed-off-by: Fabian Reh <fabian.reh@sap.com> * Adapt unit test to fix of runCommand Signed-off-by: Fabian Reh <fabian.reh@sap.com> * refactored golang step to newmanExecute * wip * added test config * refactored newmanExecute groovy wrapper step * exclude newmanExecute from common step test * cleaups * add credential support * fix groovy credential providing * add import * add stageName * define script * remove unused vars * add import * fix iterator ref * golang secret handling and cleanups * wip * wip * wip * update go step * implement cf credential proposal * testRepository functionality implemented * register secrets to logger * add missing dependecies * test xsuaa credential handling * wip * wip * cleanups * add import * remove mandatory params * add container definition * test runCommand * test runCommand * fix npm path * fix npm path * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * added newmanEnvironment to templating * wip * use env and globals params in runCommand when no templating * fix condition * wip * reverted config edit * updated documentation * install with shell * wip * wip * fix tests * refactor tests * wip * remove old test * wip * escape go tmpl * escape go tmpl * fix defaults * add doc comment * remove test case * refactored newman commands * add cli reporter * refactor options * mock os getenv and fix all tests * refactoring and doc update * go generate * small refactor * spelling * fix newman doc * remove MaskPasswords wrapper; fix stash bug; * docu fix Co-authored-by: Fabian Reh <fabian.reh@sap.com>
2021-03-17 09:08:33 +02:00
containers:
- name: newman
image: node:lts-stretch
workingDir: /home/node