Skip to content

Commit

Permalink
Merge pull request #100 from reportportal/develop
Browse files Browse the repository at this point in the history
Release 5.0.3
  • Loading branch information
AmsterGet authored Nov 9, 2020
2 parents 43ff0ae + 04e2269 commit 601866a
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 14 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,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 @@ -145,3 +145,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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

### Added
- Environment variable

## [5.0.2] - 2020-08-27
### Fixed
- [Issue](https://github.com/reportportal/client-javascript/pull/91) with request headers
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ As system attributes, this method sends the following data (these data are not f
* RAMSize;
* nodeJS version;

We use Google Analytics for sending anonymous usage information as library's name/version and the agent's name/version when the launchStart is called. This information might help us to improve reportportal-client. Used by the ReportPortal team only and not for sharing with 3rd parties.
You can disable Google Analytics by specify the following parameter **disableGA** with the value **true**.
ReportPortal is supporting now integrations with more than 15 test frameworks simultaneously. In order to define the most popular agents and plan the team workload accordingly, we are using Google analytics.

ReportPortal collects only information about agent name and version. This information is sent to Google analytics on the launch start. Please help us to make our work effective.
If you still want to switch Off Google analytics, please change env variable.
'REPORTPORTAL_CLIENT_JS_NO_ANALYTICS=true'

### finishLaunch
finishLaunch - finish of the launch. After calling this method, you can not add items to the launch.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.2
5.0.3-SNAPSHOT
2 changes: 1 addition & 1 deletion lib/report-portal-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class RPClient {
}

triggerAnalyticsEvent() {
if (this.config.disableGA) {
if (process.env.REPORTPORTAL_CLIENT_JS_NO_ANALYTICS) {
return;
}

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

16 changes: 15 additions & 1 deletion spec/report-portal-client.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const process = require('process');
const RPClient = require('../lib/report-portal-client.js');
const RestClient = require('../lib/rest');
const helpers = require('../lib/helpers');
Expand Down Expand Up @@ -89,14 +90,25 @@ describe('ReportPortal javascript client', () => {
});

describe('triggerAnalyticsEvent', () => {
it('should not call analytics.trackEvent if disableGA is true', () => {
const OLD_ENV = process.env;

beforeEach(() => {
process.env = { ...OLD_ENV };
});

afterEach(() => {
process.env = OLD_ENV;
});

it('should not call analytics.trackEvent if REPORTPORTAL_CLIENT_JS_NO_ANALYTICS is true', () => {
const client = new RPClient({
token: 'startLaunchTest',
endpoint: 'https://rp.us/api/v1',
project: 'tst',
disableGA: true,
});
spyOn(events, 'getAgentEventLabel').and.returnValue('name|version');
process.env.REPORTPORTAL_CLIENT_JS_NO_ANALYTICS = true;
spyOn(client.analytics, 'trackEvent');

client.triggerAnalyticsEvent();
Expand All @@ -112,6 +124,7 @@ describe('ReportPortal javascript client', () => {
});
client.analytics.agentParams = { name: 'name', version: 'version' };
spyOn(events, 'getAgentEventLabel').and.returnValue('name|version');
process.env.REPORTPORTAL_CLIENT_JS_NO_ANALYTICS = false;
spyOn(client.analytics, 'trackEvent');

client.triggerAnalyticsEvent();
Expand All @@ -128,6 +141,7 @@ describe('ReportPortal javascript client', () => {
project: 'tst',
});
spyOn(client.analytics, 'trackEvent');
process.env.REPORTPORTAL_CLIENT_JS_NO_ANALYTICS = false;

client.triggerAnalyticsEvent();

Expand Down

0 comments on commit 601866a

Please sign in to comment.