@wdio/sumologic-reporter 10.0.0-alpha.149 → 10.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -3
- package/package.json +7 -7
- package/AGENTS.md +0 -15
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAiCzC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY;IACvD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAC,CAAgB;IAClC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,kBAAkB,CAAC,CAAiB;IAE5C,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAiCzC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,YAAY;IACvD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAC,CAAgB;IAClC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,kBAAkB,CAAC,CAAiB;IAE5C,OAAO,CAAC,SAAS,CAAe;IAChC,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,YAAY,CAAI;gBAEZ,OAAO,EAAE,OAAO;IAoB5B,IAAI,cAAc,YAEjB;IAED,aAAa,CAAC,MAAM,EAAE,WAAW;IAYjC,YAAY,CAAC,KAAK,EAAE,UAAU;IAY9B,WAAW,CAAC,IAAI,EAAE,SAAS;IAY3B,UAAU,CAAC,IAAI,EAAE,SAAS;IAY1B,UAAU,CAAC,IAAI,EAAE,SAAS;IAY1B,UAAU,CAAC,IAAI,EAAE,SAAS;IAY1B,SAAS,CAAC,IAAI,EAAE,SAAS;IAYzB,UAAU,CAAC,KAAK,EAAE,UAAU;IAY5B,WAAW,CAAC,MAAM,EAAE,WAAW;IAkBzB,IAAI;IA0FV,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,MAAM;IAkBd,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,aAAa;CAUxB;AAED,cAAc,YAAY,CAAA;AAE1B,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,cAAe,SAAQ,OAAO;SAAG;KAC9C;CACJ"}
|
package/build/index.js
CHANGED
|
@@ -29,7 +29,6 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
29
29
|
_interval;
|
|
30
30
|
_shutdownTimer;
|
|
31
31
|
_requestController;
|
|
32
|
-
_sourceAddress = "";
|
|
33
32
|
_unsynced = [];
|
|
34
33
|
_isSynchronising = false;
|
|
35
34
|
_isDisabled = false;
|
|
@@ -51,7 +50,6 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
51
50
|
this._disable('Sumo Logic reporter disabled: a non-empty "sourceAddress" is required');
|
|
52
51
|
return;
|
|
53
52
|
}
|
|
54
|
-
this._sourceAddress = this._options.sourceAddress;
|
|
55
53
|
this._interval = global.setInterval(this.sync.bind(this), this._options.syncInterval);
|
|
56
54
|
}
|
|
57
55
|
// @ts-ignore
|
|
@@ -165,6 +163,11 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
165
163
|
if (this._isSynchronising || this._unsynced.length === 0 || Date.now() < this._nextRetryAt) {
|
|
166
164
|
return;
|
|
167
165
|
}
|
|
166
|
+
const sourceAddress = this._options.sourceAddress;
|
|
167
|
+
if (typeof sourceAddress !== "string" || sourceAddress.trim() === "") {
|
|
168
|
+
this._disable('Sumo Logic reporter disabled: a non-empty "sourceAddress" is required');
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
168
171
|
const logLines = this._unsynced.slice(0, MAX_LINES).join("\n");
|
|
169
172
|
this._isSynchronising = true;
|
|
170
173
|
log.debug("start synchronization");
|
|
@@ -172,7 +175,7 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
172
175
|
this._requestController = controller;
|
|
173
176
|
const requestTimer = setTimeout(() => controller.abort(), this._getRequestTimeout());
|
|
174
177
|
try {
|
|
175
|
-
const resp = await fetch(
|
|
178
|
+
const resp = await fetch(sourceAddress, {
|
|
176
179
|
method: "POST",
|
|
177
180
|
body: JSON.stringify(logLines),
|
|
178
181
|
signal: controller.signal
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/sumologic-reporter",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.18+dbf0f4971",
|
|
4
4
|
"description": "A WebdriverIO reporter that sends test results to Sumologic for data analyses",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-sumologic-reporter",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=18.20.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"import": "./build/index.js"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
"typeScriptVersion": "
|
|
33
|
+
"typeScriptVersion": "3.8.3",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@wdio/logger": "10.0.0-alpha.
|
|
36
|
-
"@wdio/reporter": "10.0.0-alpha.
|
|
37
|
-
"@wdio/types": "10.0.0-alpha.
|
|
35
|
+
"@wdio/logger": "10.0.0-alpha.18+dbf0f4971",
|
|
36
|
+
"@wdio/reporter": "10.0.0-alpha.18+dbf0f4971",
|
|
37
|
+
"@wdio/types": "10.0.0-alpha.18+dbf0f4971",
|
|
38
38
|
"json-stringify-safe": "^5.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "dbf0f497130676040ce4212d9cf6459adfe16c42"
|
|
47
47
|
}
|
package/AGENTS.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# @wdio/sumologic-reporter
|
|
2
|
-
|
|
3
|
-
Sends runner events to a Sumo Logic HTTP collector. Extends `@wdio/reporter`.
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
pnpm run test:package wdio-sumologic-reporter
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Test ownership
|
|
10
|
-
|
|
11
|
-
Unit coverage lives in `tests/reporter.test.ts`.
|
|
12
|
-
|
|
13
|
-
- The constructor owns a missing or blank `sourceAddress`. `sync()` does not re-check it. The collector URL is fixed once the reporter is enabled. Do not assign `reporter['_options']` to reach a branch production never takes.
|
|
14
|
-
- The runner polls `isSynchronised` and does not call `sync()`. The interval must keep running after `runner:end` until the queue drains. `should stop the timer if runner ended` owns that ordering. A flush test that calls `sync()` itself still passes if the interval is cleared too early.
|
|
15
|
-
- `should start sync when reporter gets initiated` must invoke the scheduled callback. Asserting `setInterval` alone does not prove the reporter syncs.
|