Skip to content

Commit

Permalink
refactor src/newman-parallel.js, add github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Valiantsin2021 committed Feb 8, 2024
1 parent 61f54ac commit 3d24ec1
Show file tree
Hide file tree
Showing 15 changed files with 1,164 additions and 58 deletions.
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "\U0001F41E Report a problem"
description: "Report a problem with newman-parallel"
title: "Bug: (fill in)"
labels:
- bug
- "repro:needed"
body:
- type: textarea
attributes:
label: Environment
description: |
Please provide the following information:
value: |
Node version:
npm version:
Operating System:
validations:
required: true
- type: textarea
attributes:
label: What did you do?
validations:
required: true
- type: textarea
attributes:
label: What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: What actually happened?
validations:
required: true
- type: input
attributes:
label: Link to Minimal Reproducible Example
description: "Link to a GitHub repo with a minimal reproduction of the problem. **A minimal reproduction is required** so that others can help debug your issue. If a report is vague (e.g. just a generic error message) and has no reproduction, it may be auto-closed."
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this issue.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else you'd like to mention?
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "\U0001F680 Request a change"
description: "Request a new feature or change to an existing feature"
title: "Change Request: (fill in)"
labels:
- enhancement
body:
- type: textarea
attributes:
label: What problem do you want to solve?
description: |
Please explain your use case in as much detail as possible without referring to a specific solution.
placeholder: |
newman-parallel currently...
validations:
required: true
- type: textarea
attributes:
label: What do you think is the correct solution?
description: |
Please explain how you'd like to change newman-parallel to address the problem.
placeholder: |
I'd like newman-parallel to...
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this change.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else you'd like to mention?
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 🗣 Ask a Question, Discuss
url: https://medium.com/@lutchenkovalentin/run-multiple-postman-api-collections-with-newman-in-parallel-with-automated-html-report-generation-435aa92a1985
about: Get help using newman-parallel
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "\U0001F4DD Docs"
description: "Request an improvement to documentation"
title: "Docs: (fill in)"
labels:
- documentation
body:
- type: textarea
attributes:
label: Docs page(s)
description: |
What page(s) are you suggesting be changed or created?
validations:
required: true
- type: textarea
attributes:
label: What documentation issue do you want to solve?
description: |
Please explain your issue in as much detail as possible.
validations:
required: true
- type: textarea
attributes:
label: What do you think is the correct solution?
description: |
Please explain how you'd like to change the ESLint docs to address the problem.
validations:
required: true
- type: checkboxes
attributes:
label: Participation
options:
- label: I am willing to submit a pull request for this change.
required: false
- type: textarea
attributes:
label: Additional comments
description: Is there anything else you'd like to mention?
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
STOP!!! Before submitting a pull request that changes any source code, please open an issue explaining what you'd like to change first. Code changes are NOT accepted without an open issue.
If you are only making documentation changes, you are welcome to continue without an issue.
-->

## What is the purpose of this pull request?

## What changes did you make? (Give an overview)

<!--
The following is required for all code-related changes:
- updated documentation
- updated tests
-->

## What issue(s) does this PR address?

<!--
Example:
fixes #1234
refs #567
-->

## Is there anything you'd like reviewers to focus on?
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: npm install, and test
run: |
npm install
npm test
env:
CI: true
- uses: actions/upload-artifact@v3
if: always()
with:
name: allure-report
path: allure-report
retention-days: 30
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: allure-report
17 changes: 17 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: read
jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: patch
use_github_release_notes: true
24 changes: 24 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Package to npmjs
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
release:
types: [published]
jobs:
build:
name: Publish to NPM registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The package has integrated Newman, Allure (allure-results generated automaticall

HTMLextra and Junit reports will e generated in report folder. Allure report will be generated to allure-report folder after all the collections have ran.

For Allure report the command "npx allure generate --clean && npx allure-patch ./allure-report && rm -rf ./allure-report" will ran automatically after all the collections have ran. It will generate the Allure html report patch it as a single page app to be sent via email, webhook or published as a static webpage.
For Allure report the command "npx allure generate --clean && npx allure-patch ./allure-report && rm -rf ./allure-report" will run automatically after all the collections run finished. It will generate the Allure html report, patch it as a single page app to be sent via email, webhook or published as a static webpage.

Allure report with history will be generated only if you use GitBash/Bash. If you run the tests in Powershell the history will not be generated automatically.
#### Allure report with history will be generated only if you use GitBash/Bash. If you run the tests with Powershell - the history will not be generated automatically.

## Installation

Expand Down
9 changes: 2 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/usr/bin/env node

const NewmanRunner = require('./src/newman-parallel.js')

if (process.argv.length <= 2) {
console.log("\x1b[31mPlease provide path to the collections and environment folders\nEx: './collections ./environments'\x1b[0m")
} else {
var args = process.argv.slice(2)
NewmanRunner.runCollections(args)
}
const args = process.argv.slice(2)
NewmanRunner.runCollections(args)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "newman-parallel",
"version": "1.0.8",
"version": "1.0.9",
"description": "A framework to execute multiple Postman collections in parallel run with Newman.Includes Allure, HTML-extra and Junit reporters integrations",
"main": "index.js",
"scripts": {
"test": "node index.js collections environments C=gorest E=accep",
"test": "node index.js test/col test/env ALL E=MyEnvironment",
"lint": "npx eslint ./src/*.js --fix",
"format": "prettier --write ./src/*.js"
},
Expand Down

0 comments on commit 3d24ec1

Please sign in to comment.