Skip to content

Commit

Permalink
Merge pull request #54 from reportportal/develop
Browse files Browse the repository at this point in the history
Release 5.0.2
  • Loading branch information
AmsterGet authored Feb 9, 2021
2 parents 45f87ea + 4fc832f commit 1b9f40f
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 74 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: publish

on:
release:
types:
- published
repository_dispatch:
types: [version-released]

jobs:
build:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,9 @@ jobs:
body: ${{ needs.create-tag.outputs.versionInfo }}
draft: false
prerelease: false
- name: Trigger the publish workflow
if: success()
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_TOKEN }}
event-type: version-released
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### Added
- Debug flag, launch mode configuration properties

### Fixed
- Doesn't start a suite if test has no describe
- Vulnerable dependencies (lodash)

## [5.0.1] - 2020-06-12
### Changed
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# reportportal-agent-jest
# @reportportal/agent-js-jest

A Jest reporter that uploads the results to a [ReportPortal](http://reportportal.io/) server.

Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = {
[
"@reportportal/agent-js-jest",
{
"token": "00000000-0000-0000-0000-000000000000",
"token": "00000000-0000-0000-0000-000000000000",
"endpoint": "https://your.reportportal.server/api/v1",
"project": "YourReportPortalProjectName",
"launch": "YourLauncherName",
Expand Down Expand Up @@ -108,12 +108,30 @@ Example:
"skippedIssue": false
```
## Launch mode:
Launch mode. Allowable values *DEFAULT* (by default) or *DEBUG*.
Example:
```json
"mode": "DEBUG"
```
## Debug flag:
This flag allows seeing the logs of the client-javascript. Useful for debugging an agent.
Example:
```json
"debug": true
```
# Copyright Notice
Licensed under the [Apache License v2.0](LICENSE)
# Contribution
This code was based on the [jest-junit](https://github.com/jest-community/jest-junit)
and adapted by team members of [Ontoforce](https://www.ontoforce.com) for the
and adapted by team members of [Ontoforce](https://www.ontoforce.com) for the
ReportPortal upload. Ontoforce contributed this effort as Open Source to the
ReportPortal project team.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.1
5.0.2-SNAPSHOT
4 changes: 4 additions & 0 deletions __tests__/objectUtils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@ describe('Object Utils script', () => {
{ key: null, value: 'attributesOne' },
{ key: 'attributesTwoKey', value: 'attributesTwoValue' },
],
mode: 'DEBUG',
debug: true,
};
const options = {
endpoint: 'endpoint',
rerun: true,
rerunOf: '00000000-0000-0000-0000-000000000000',
description: 'description',
mode: 'DEBUG',
debug: true,
};

const clientInitObject = getClientInitObject(options);
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ class JestReportPortal {
}

_startSuite(suiteName, path) {
if (!suiteName) return;

const codeRef = getCodeRef(path, suiteName);
const { tempId, promise } = this.client.startTestItem(getSuiteStartObject(suiteName, codeRef),
this.tempLaunchId);
Expand Down Expand Up @@ -166,6 +168,8 @@ class JestReportPortal {
}

_finishSuite() {
if (!this.tempSuiteId) return;

const { promise } = this.client.finishTestItem(this.tempSuiteId, {});

promiseErrorHandler(promise);
Expand Down
85 changes: 19 additions & 66 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dependencies": {
"@jest/reporters": "25.1.0",
"jest-cli": "^25.1.0",
"@reportportal/client-javascript": "^5.0.0"
"@reportportal/client-javascript": "^5.0.2"
},
"devDependencies": {
"@types/jest": "^24.9.0",
Expand Down
3 changes: 3 additions & 0 deletions utils/objectUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const getStartLaunchObject = (options = {}) => {
attributes: options.attributes ? options.attributes.concat(systemAttr) : systemAttr,
rerun: options.rerun,
rerunOf: options.rerunOf,
mode: options.mode,
skippedIssue: options.skippedIssue,
startTime: new Date().valueOf(),
};
Expand Down Expand Up @@ -73,6 +74,8 @@ const getClientInitObject = (options = {}) => {
skippedIssue: options.skippedIssue,
description: options.description,
attributes: env_attributes || options.attributes,
mode: options.mode,
debug: options.debug,
};
};

Expand Down

0 comments on commit 1b9f40f

Please sign in to comment.