Commit 320dc97f authored by FulcrandG's avatar FulcrandG
Browse files

newman

parent 5b59ca4e
Loading
Loading
Loading
Loading

jobs/newman/README.md

0 → 100644
+33 −0
Original line number Diff line number Diff line
# 🚀 Newman

## Description

Launch a Postman collection of requests to test your API using [newman](https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/)

## How to use it

1. Add a Postman collection to your project
2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting
   started](/use-the-hub)). Example:

    ```yaml
    include:
      - remote: 'https://jobs.r2devops.io/newman.yml'
    ```
3. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
4. Well done, your job is ready to work ! 😀

## Job details

* Job name: `newman`
* Docker image:
[`node:15.0.4`](https://hub.docker.com/r/_/node)
* Default stage: `dynamic_tests`
* When: `always`

### Variables

| Name | Description | Default |
| ---- | ----------- | ------- |
| `NEWMAN_COLLECTION` <img width=100/> | Name of the Postman collection <img width=175/> | `postman_collection.json` <img width=100/> |

jobs/newman/job.yml

0 → 100644
+6 −0
Original line number Diff line number Diff line
name: newman
description: A job to run a Postman collection to test your API with Newman
default_stage: dynamic_tests
icon: 🚀
maintainer: FulcrandG
license: MIT

jobs/newman/newman.yml

0 → 100644
+16 −0
Original line number Diff line number Diff line
stages:
  - dynamic_tests

newman:
  image: node:15.4.0
  stage: dynamic_tests
  variables:
    NEWMAN_COLLECTION: "postman_collection.json"
    NEWMAN_JUNIT_REPORT: "newman-report.xml"
  script:
    - npm install -g newman newman-reporter-junitfull
    - newman run ${NEWMAN_COLLECTION_PATH} -r junitfull --reporter-junitfull-export ${NEWMAN_JUNIT_REPORT} -n 2
  artifacts:
    reports:
      junit: ${NEWMAN_JUNIT_REPORT}
    expire_in: 30 days
+1 −0
Original line number Diff line number Diff line
* Initial version
 No newline at end of file