Skip to content

Commit 53d6d53

Browse files
authored
Merge pull request #95 from reportportal/develop
Release 5.0.3
2 parents 8022d60 + d718218 commit 53d6d53

21 files changed

Lines changed: 4707 additions & 4746 deletions

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"no-invalid-this": 0,
2828
"prefer-object-spread": 0,
2929
"no-console": 0,
30-
"func-names": 0
30+
"func-names": 0,
31+
"default-param-last": 0
3132
},
3233
"overrides": [{
3334
"files": ["*.spec.js"],

.github/workflows/CI-pipeline.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929
- name: Set up Node.js
30-
uses: actions/setup-node@v1
30+
uses: actions/setup-node@v3
3131
with:
32-
node-version: 12.x
33-
- name: Clean install of node dependencies
34-
run: npm ci
32+
node-version: 18
33+
- name: Install of node dependencies
34+
run: npm install
3535
- name: Run lint
3636
run: npm run lint
37-
- name: Run tests
38-
run: npm test
39-
- name: Check coverage
37+
- name: Run tests and check coverage
4038
run: npm run test:coverage

.github/workflows/publish.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,31 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626
- name: Set up Node.js
27-
uses: actions/setup-node@v1
27+
uses: actions/setup-node@v3
2828
with:
29-
node-version: 12.x
30-
- name: Clean install of node dependencies
31-
run: npm ci
29+
node-version: 18
30+
- name: Install of node dependencies
31+
run: npm install
3232
- name: Run lint
3333
run: npm run lint
34-
- name: Run tests
35-
run: npm test
36-
- name: Check coverage
34+
- name: Run tests and check coverage
3735
run: npm run test:coverage
3836

3937
publish-to-npm-and-gpr:
4038
needs: build
4139
runs-on: ubuntu-latest
4240
steps:
4341
- name: Checkout repository
44-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4543
- name: Set up Node.js
46-
uses: actions/setup-node@v1
44+
uses: actions/setup-node@v3
4745
with:
48-
node-version: 12.x
46+
node-version: 18
4947
registry-url: 'https://registry.npmjs.org'
50-
- name: Clean install of node dependencies
51-
run: npm ci
48+
- name: Install of node dependencies
49+
run: npm install
5250
- name: Publish to NPM
5351
run: |
5452
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
@@ -57,9 +55,9 @@ jobs:
5755
env:
5856
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
5957
- name: Set up Node.js
60-
uses: actions/setup-node@v1
58+
uses: actions/setup-node@v3
6159
with:
62-
node-version: 12.x
60+
node-version: 18
6361
registry-url: 'https://npm.pkg.github.com'
6462
scope: '@reportportal'
6563
- name: Publish to GPR

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### Changed
2+
- `token` configuration option was renamed to `apiKey` to maintain common convention.
3+
- `@reportportal/client-javascript` bumped to version `5.0.12`.
14

25
## [5.0.2] - 2022-12-12
36
### Fixed

README.md

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# Mocha reporter for EPAM report portal
2-
This is mocha runtime reporter for the [Report Portal](https://github.com/reportportal/reportportal).
1+
# @reportportal/agent-js-mocha
2+
3+
Agent to integrate Mocha with ReportPortal.
4+
* More about [Mocha](https://mochajs.org/)
5+
* More about [ReportPortal](http://reportportal.io/)
36

47
It was designed to work with mocha programmatically, in order to be able to parametrize each test run.
58

6-
## Installation steps:
9+
## Installation
710

811
```cmd
9-
npm install @reportportal/agent-js-mocha
12+
npm install --save-dev @reportportal/agent-js-mocha
1013
```
1114

1215
## How to use:
1316
Fill reporterOptions in Mocha configuration.
1417
```javascript
1518
const Mocha = require("mocha");
16-
let mochaMain = new Mocha({
19+
const mochaMain = new Mocha({
1720
reporter: '@reportportal/agent-js-mocha',
1821
reporterOptions: {
19-
"token": "00000000-0000-0000-0000-000000000000",
22+
"apiKey": "reportportalApiKey",
2023
"endpoint": "https://your.reportportal.server/api/v1",
2124
"project": "YourReportPortalProjectName",
2225
"launch": "YourLauncherName",
@@ -40,7 +43,7 @@ module.exports = {
4043
reporter: '@reportportal/agent-js-mocha',
4144
'reporter-option':[
4245
'endpoint=https://your.reportportal.server/api/v1',
43-
'token=00000000-0000-0000-0000-000000000000',
46+
'apiKey=reportportalApiKey',
4447
'launch=YourLauncherName',
4548
'project=YourReportPortalProjectName',
4649
'attributes=YourKey:YourValue;YourValue',
@@ -56,31 +59,36 @@ module.exports = {
5659

5760
### Options
5861

59-
Runs support following options:
60-
61-
| Parameter | Description |
62-
| --------------------- | ----------------------------------------------------------------------------------------------------------------- |
63-
| token | User's Report Portal token from which you want to send requests. It can be found on the profile page of this user.|
64-
| endpoint | URL of your server. For example 'https://server:8080/api/v1'. |
65-
| launch | Name of launch at creation. |
66-
| project | The name of the project in which the launches will be created.
67-
| mode | *Default: "default".* Results will be submitting to Launches tab<br> *"debug"* - Results will be submitting to Debug tab. |
68-
| rerun | *Default: false.* Enable [rerun](https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/rerun.md)|
69-
| rerunOf | UUID of launch you want to rerun. If not specified, report portal will update the latest launch with the same name|
70-
| reportHooks | *Default: false.* Determines report before and after hooks or not. |
71-
| skippedIssue | *Default: true.* ReportPortal provides feature to mark skipped tests as not 'To Investigate' items on WS side.<br> Parameter could be equal boolean values:<br> *TRUE* - skipped tests considered as issues and will be marked as 'To Investigate' on Report Portal.<br> *FALSE* - skipped tests will not be marked as 'To Investigate' on application.|
62+
The full list of available options presented below.
63+
64+
| Option | Necessity | Default | Description |
65+
|------------------|------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
66+
| apiKey | Required | | User's reportportal token from which you want to send requests. It can be found on the profile page of this user. |
67+
| endpoint | Required | | URL of your server. For example 'https://server:8080/api/v1'. |
68+
| launch | Required | | Name of launch at creation. |
69+
| project | Required | | The name of the project in which the launches will be created. |
70+
| attributes | Optional | [] | Launch attributes. |
71+
| description | Optional | '' | Launch description. |
72+
| rerun | Optional | false | Enable [rerun](https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/rerun.md) |
73+
| rerunOf | Optional | Not set | UUID of launch you want to rerun. If not specified, reportportal will update the latest launch with the same name |
74+
| mode | Optional | 'DEFAULT' | Results will be submitted to Launches page <br/> *'DEBUG'* - Results will be submitted to Debug page (values must be upper case). |
75+
| skippedIssue | Optional | true | reportportal provides feature to mark skipped tests as not 'To Investigate'. <br/> Option could be equal boolean values: <br/> *true* - skipped tests considered as issues and will be marked as 'To Investigate' on reportportal. <br/> *false* - skipped tests will not be marked as 'To Investigate' on application. |
76+
| debug | Optional | false | This flag allows seeing the logs of the client-javascript. Useful for debugging. |
77+
| reportHooks | Optional | false | Determines report before and after hooks or not. |
78+
| restClientConfig | Optional | Not set | The object with `agent` property for configure [http(s)](https://nodejs.org/api/https.html#https_https_request_url_options_callback) client, may contain other client options eg. [`timeout`](https://github.com/reportportal/client-javascript#timeout-30000ms-on-axios-requests). <br/> Visit [client-javascript](https://github.com/reportportal/client-javascript) for more details. |
79+
| token | Deprecated | Not set | Use `apiKey` instead. |
7280

7381
### Additional reporting functionality
7482

7583
The agent provides an API to extend the functionality of Mocha.
7684

77-
Import the PublicReportingAPI as shown below to use additional reporting features.
85+
Import the `PublicReportingAPI` as shown below to use additional reporting features.
7886

7987
```javascript
8088
const PublicReportingAPI = require('@reportportal/agent-js-mocha/lib/publicReportingAPI');
8189
```
8290
#### Report logs and attachments
83-
PublicReportingAPI provides the following methods for reporting logs into the current test/step.
91+
`PublicReportingAPI` provides the following methods for reporting logs into the current test/step.
8492

8593
* log(*level*, *message* , *file*). Reports *message* and optional *file* with specified log *level* as a log of the current test. If called outside of the test, reports message as a log of the current suite.<br/>
8694
*level* shoud be equal to one the following values: *TRACE*, *DEBUG*, *INFO*, *WARN*, *ERROR*, *FATAL*.<br/>

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.2
1+
5.0.3-SNAPSHOT

lib/mochaReporter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class ReportportalAgent extends Mocha.reporters.Base {
168168
const attributes = parseAttributes(this.options.reporterOptions.attributes);
169169
const launchAttributes = (attributes || []).concat(systemAttributes);
170170
const { tempId, promise } = this.rpClient.startLaunch({
171-
token: this.options.reporterOptions.token,
172171
name: this.options.reporterOptions.launch,
173172
startTime: this.rpClient.helpers.now(),
174173
description: this.options.reporterOptions.description,

0 commit comments

Comments
 (0)