@wdio/sumologic-reporter 9.32.0 → 10.0.0-alpha.148
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/AGENTS.md +15 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -6
- package/package.json +7 -7
package/AGENTS.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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.
|
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,OAA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AW,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;IAoFV,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,6 +29,7 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
29
29
|
_interval;
|
|
30
30
|
_shutdownTimer;
|
|
31
31
|
_requestController;
|
|
32
|
+
_sourceAddress = "";
|
|
32
33
|
_unsynced = [];
|
|
33
34
|
_isSynchronising = false;
|
|
34
35
|
_isDisabled = false;
|
|
@@ -50,6 +51,7 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
50
51
|
this._disable('Sumo Logic reporter disabled: a non-empty "sourceAddress" is required');
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
54
|
+
this._sourceAddress = this._options.sourceAddress;
|
|
53
55
|
this._interval = global.setInterval(this.sync.bind(this), this._options.syncInterval);
|
|
54
56
|
}
|
|
55
57
|
// @ts-ignore
|
|
@@ -163,11 +165,6 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
163
165
|
if (this._isSynchronising || this._unsynced.length === 0 || Date.now() < this._nextRetryAt) {
|
|
164
166
|
return;
|
|
165
167
|
}
|
|
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
|
-
}
|
|
171
168
|
const logLines = this._unsynced.slice(0, MAX_LINES).join("\n");
|
|
172
169
|
this._isSynchronising = true;
|
|
173
170
|
log.debug("start synchronization");
|
|
@@ -175,7 +172,7 @@ var SumoLogicReporter = class extends WDIOReporter {
|
|
|
175
172
|
this._requestController = controller;
|
|
176
173
|
const requestTimer = setTimeout(() => controller.abort(), this._getRequestTimeout());
|
|
177
174
|
try {
|
|
178
|
-
const resp = await fetch(
|
|
175
|
+
const resp = await fetch(this._sourceAddress, {
|
|
179
176
|
method: "POST",
|
|
180
177
|
body: JSON.stringify(logLines),
|
|
181
178
|
signal: controller.signal
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/sumologic-reporter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-alpha.148+3a926c3d0",
|
|
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": ">=22.19.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": "6.0.3",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@wdio/logger": "
|
|
36
|
-
"@wdio/reporter": "
|
|
37
|
-
"@wdio/types": "
|
|
35
|
+
"@wdio/logger": "10.0.0-alpha.148+3a926c3d0",
|
|
36
|
+
"@wdio/reporter": "10.0.0-alpha.148+3a926c3d0",
|
|
37
|
+
"@wdio/types": "10.0.0-alpha.148+3a926c3d0",
|
|
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": "3a926c3d08dafa93c92021b2892341709d74968a"
|
|
47
47
|
}
|