slnodejs 6.1.914 → 6.1.921

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.
Files changed (77) hide show
  1. package/package.json +1 -1
  2. package/tsOutputs/build-scanner/build-diff-process.js +2 -0
  3. package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
  4. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +11 -2
  5. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
  6. package/tsOutputs/cli-parse/cli.js +22 -0
  7. package/tsOutputs/cli-parse/cli.js.map +1 -1
  8. package/tsOutputs/cli-parse/contracts.d.ts +4 -1
  9. package/tsOutputs/cli-parse/contracts.js.map +1 -1
  10. package/tsOutputs/cli-parse/executors/build-args-dto.js +1 -0
  11. package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
  12. package/tsOutputs/cli-parse/executors/build-executor.js +19 -1
  13. package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
  14. package/tsOutputs/cli-parse/executors/run-executor.js +2 -1
  15. package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
  16. package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
  17. package/tsOutputs/common/config-process/config.d.ts +1 -0
  18. package/tsOutputs/common/config-process/config.js +1 -0
  19. package/tsOutputs/common/config-process/config.js.map +1 -1
  20. package/tsOutputs/common/constants/sl-env-vars.d.ts +4 -0
  21. package/tsOutputs/common/constants/sl-env-vars.js +4 -0
  22. package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
  23. package/tsOutputs/common/footprints-process-v6/hits-collector.js +1 -0
  24. package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
  25. package/tsOutputs/common/footprints-process-v6/index.d.ts +4 -8
  26. package/tsOutputs/common/footprints-process-v6/index.js +2 -14
  27. package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
  28. package/tsOutputs/common/http/contracts.d.ts +1 -1
  29. package/tsOutputs/common/watchdog.d.ts +9 -8
  30. package/tsOutputs/common/watchdog.js +1 -4
  31. package/tsOutputs/common/watchdog.js.map +1 -1
  32. package/tsOutputs/test-listener/agent-loader.js +8 -2
  33. package/tsOutputs/test-listener/agent-loader.js.map +1 -1
  34. package/tsOutputs/test-listener/agent.d.ts +1 -1
  35. package/tsOutputs/test-listener/bootstrap.js +4 -0
  36. package/tsOutputs/test-listener/bootstrap.js.map +1 -1
  37. package/tsOutputs/test-listener/config-process/config-loader.js +1 -1
  38. package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
  39. package/tsOutputs/test-listener/factory.d.ts +3 -5
  40. package/tsOutputs/test-listener/factory.js +15 -23
  41. package/tsOutputs/test-listener/factory.js.map +1 -1
  42. package/tsOutputs/test-listener/logs-process/index.d.ts +2 -2
  43. package/browser-agent/dist/browser-agent-all.js +0 -117546
  44. package/browser-agent/dist/browser-agent-all.min.js +0 -16
  45. package/browser-agent/package.json +0 -58
  46. package/tsOutputs/common/uuid.js +0 -21
  47. package/tsOutputs/common/uuid.js.map +0 -1
  48. package/tsOutputs/test-listener/config-process/config-system.d.ts +0 -88
  49. package/tsOutputs/test-listener/config-process/config-system.js +0 -259
  50. package/tsOutputs/test-listener/config-process/config-system.js.map +0 -1
  51. package/tsOutputs/test-listener/config-process/index.js +0 -110
  52. package/tsOutputs/test-listener/config-process/index.js.map +0 -1
  53. package/tsOutputs/test-listener/config.d.ts +0 -50
  54. package/tsOutputs/test-listener/config.js +0 -62
  55. package/tsOutputs/test-listener/config.js.map +0 -1
  56. package/tsOutputs/test-listener/environment-data-service.d.ts +0 -11
  57. package/tsOutputs/test-listener/environment-data-service.js +0 -60
  58. package/tsOutputs/test-listener/environment-data-service.js.map +0 -1
  59. package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js +0 -36
  60. package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js.map +0 -1
  61. package/tsOutputs/test-listener/footprints-process/index.js +0 -226
  62. package/tsOutputs/test-listener/footprints-process/index.js.map +0 -1
  63. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js +0 -130
  64. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js.map +0 -1
  65. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-contract.js +0 -3
  66. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-contract.js.map +0 -1
  67. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js +0 -272
  68. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js.map +0 -1
  69. package/tsOutputs/test-listener/queue.js +0 -40
  70. package/tsOutputs/test-listener/queue.js.map +0 -1
  71. package/tsOutputs/test-listener/state-tracker-process/index.js +0 -143
  72. package/tsOutputs/test-listener/state-tracker-process/index.js.map +0 -1
  73. package/tsOutputs/test-listener/utils.js +0 -68
  74. package/tsOutputs/test-listener/utils.js.map +0 -1
  75. package/tsOutputs/test-listener/watchdog.d.ts +0 -89
  76. package/tsOutputs/test-listener/watchdog.js +0 -128
  77. package/tsOutputs/test-listener/watchdog.js.map +0 -1
@@ -1,272 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IstanbulToFootprintsV3 = void 0;
4
- const istanbul_to_footprints_base_1 = require("./istanbul-to-footprints-base");
5
- const fs = require("fs");
6
- const path = require("path");
7
- const sourceMap = require("source-map");
8
- class IstanbulToFootprintsV3 extends istanbul_to_footprints_base_1.IstanbulToFootprintsBase {
9
- constructor(cfg, logger) {
10
- super(logger);
11
- this.cfg = cfg;
12
- this.totalTests = 0;
13
- if (!logger)
14
- throw new Error('logger is required');
15
- if (!cfg)
16
- throw new Error('cfg is required');
17
- }
18
- resetState() {
19
- this.totalTests = 0;
20
- //Holds the a mapping between a uniqueId for an element in a test, to an index in this elements 'hits' array.
21
- this.eidToHitsIndex = {};
22
- this.uniqueIdToElement = {};
23
- this.testNameToTestData = {};
24
- this.fileNameToAppFile = {};
25
- this.fileToSourceMapConsumer = {};
26
- }
27
- createFootprintsPackageForSending(queuedFootprints, extraData) {
28
- this.resetState();
29
- const result = this.createFootprintsFile(extraData);
30
- const app = result.apps[0]; //We assume single App for now.
31
- const istanbulMaps = this.getIstanbulCounters();
32
- // eslint-disable-next-line @typescript-eslint/no-this-alias
33
- const context = this;
34
- queuedFootprints.forEach(fp => {
35
- const test = this.getOrCreateTestData(fp.testName, fp.executionId, fp.localTime, result);
36
- for (const moduleName in fp.footprints) {
37
- const istanbulModule = fp.footprints[moduleName];
38
- const moduleWithMaps = istanbulMaps[moduleName];
39
- this.logger.debug('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
40
- this.logger.debug(`moduleName: ${moduleName}`);
41
- if (!moduleWithMaps) {
42
- continue;
43
- }
44
- const relPath = this.getRelativeModulePath(moduleWithMaps);
45
- if (!context.fileToSourceMapConsumer[relPath]) {
46
- context.fileToSourceMapConsumer[relPath] = this.readSourceMaps(relPath);
47
- this.logger.debug('Read source maps for file\':' + relPath + '\'');
48
- }
49
- const sourceMap = this.fileToSourceMapConsumer[relPath];
50
- const file = this.getOrCreateFootprintsAppFile(relPath, app);
51
- if (istanbulModule.f) {
52
- for (const funcId in istanbulModule.f) {
53
- const hits = istanbulModule.f[funcId];
54
- if (hits > 0) {
55
- const funcInfo = moduleWithMaps.fnMap[funcId];
56
- let start = funcInfo.loc.start;
57
- if (funcInfo.decl) {
58
- start = funcInfo.decl.start; //For NYC
59
- }
60
- const sourceMapData = this.readSourceMapData(sourceMap, start, relPath);
61
- let filePath = relPath;
62
- if (sourceMapData) {
63
- filePath = sourceMapData.originalFilename;
64
- start = sourceMapData.originalStart;
65
- }
66
- const uniqueId = filePath + '@' + this.formatLoc(start);
67
- const methodElement = this.getOrCreateMethodElement(uniqueId, file);
68
- if (this.cfg.extendedFootprints.value) {
69
- methodElement.funcInfo = JSON.stringify(funcInfo);
70
- methodElement.sourceMapData = JSON.stringify(sourceMapData);
71
- }
72
- this.addOrUpdateElementHits(test, uniqueId, methodElement, hits);
73
- }
74
- }
75
- }
76
- if (istanbulModule.b) {
77
- for (const branchId in istanbulModule.b) {
78
- const ifElseAndSwitchCasesArr = istanbulModule.b[branchId];
79
- const expressionInfo = moduleWithMaps.branchMap[branchId];
80
- for (let idx = 0; idx < ifElseAndSwitchCasesArr.length; idx++) {
81
- const branchInfo = expressionInfo.locations[idx];
82
- const hits = ifElseAndSwitchCasesArr[idx];
83
- if (hits > 0) {
84
- let start = branchInfo.start;
85
- const sourceMapData = this.readSourceMapData(sourceMap, start, relPath);
86
- let filePath = relPath;
87
- if (sourceMapData) {
88
- filePath = sourceMapData.originalFilename;
89
- start = sourceMapData.originalStart;
90
- }
91
- const uniqueId = filePath + '|' + this.formatLoc(start) + '|' + idx;
92
- const branchElement = this.getOrCreateBranchElement(uniqueId, file);
93
- if (this.cfg.extendedFootprints.value) {
94
- branchElement.branchInfo = JSON.stringify(branchInfo);
95
- branchElement.sourceMapData = JSON.stringify(sourceMapData);
96
- }
97
- this.addOrUpdateElementHits(test, uniqueId, branchElement, hits);
98
- }
99
- }
100
- }
101
- }
102
- }
103
- });
104
- return result;
105
- }
106
- addOrUpdateElementHits(testData, elementUniqueId, element, hits) {
107
- const HITS_INDEX = 1;
108
- const eid = elementUniqueId + '|' + testData.index;
109
- const index = this.eidToHitsIndex[eid];
110
- if (index != null) {
111
- const testIndexAndHits = element.hits[index];
112
- let elementHits = testIndexAndHits[HITS_INDEX];
113
- elementHits = elementHits + hits;
114
- testIndexAndHits[HITS_INDEX] = elementHits;
115
- }
116
- else {
117
- const testIndexAndHits = new Array();
118
- testIndexAndHits.push(testData.index);
119
- testIndexAndHits.push(hits);
120
- const length = element.hits.push(testIndexAndHits);
121
- this.eidToHitsIndex[eid] = length - 1;
122
- }
123
- }
124
- getOrCreateTestData(testName, executionId, localTime, result) {
125
- if (!this.testNameToTestData[testName]) {
126
- const test = {
127
- executionId: executionId,
128
- localTime: localTime,
129
- testName: testName
130
- };
131
- result.tests.push(test);
132
- this.testNameToTestData[testName] = {
133
- index: this.totalTests++,
134
- test: test
135
- };
136
- }
137
- return this.testNameToTestData[testName];
138
- }
139
- getOrCreateMethodElement(uniqueId, file) {
140
- if (!this.uniqueIdToElement[uniqueId]) {
141
- const x = {
142
- hits: new Array(),
143
- uniqueId: uniqueId
144
- };
145
- this.uniqueIdToElement[uniqueId] = x;
146
- file.methods.push(x);
147
- }
148
- return this.uniqueIdToElement[uniqueId];
149
- }
150
- getOrCreateBranchElement(uniqueId, file) {
151
- if (!this.uniqueIdToElement[uniqueId]) {
152
- const x = {
153
- hits: new Array(),
154
- uniqueId: uniqueId
155
- };
156
- this.uniqueIdToElement[uniqueId] = x;
157
- file.branches.push(x);
158
- }
159
- return this.uniqueIdToElement[uniqueId];
160
- }
161
- getOrCreateFootprintsAppFile(fileName, app) {
162
- if (this.fileNameToAppFile[fileName]) {
163
- return this.fileNameToAppFile[fileName];
164
- }
165
- //File doesn't exist in request.
166
- const file = {
167
- methods: new Array(),
168
- branches: new Array(),
169
- lines: new Array(),
170
- path: fileName
171
- };
172
- app.files.push(file);
173
- this.fileNameToAppFile[fileName] = file;
174
- return file;
175
- }
176
- createFootprintsFile(extraData) {
177
- //Supporting only one app right now
178
- const app = {
179
- appName: this.cfg.appName.value,
180
- branchName: this.cfg.branch.value,
181
- buildName: this.cfg.build.value,
182
- moduleName: null,
183
- files: new Array()
184
- };
185
- extraData.apps.push(app);
186
- return extraData;
187
- }
188
- readSourceMaps(fullFilename) {
189
- if (!fullFilename)
190
- return;
191
- const sourceMapsFilename = fullFilename + '.map';
192
- let contents, rawSourceMapJsonData, consumer;
193
- try {
194
- contents = fs.readFileSync(sourceMapsFilename).toString();
195
- }
196
- catch (e) {
197
- //Sourcemap file not found
198
- return null;
199
- }
200
- try {
201
- rawSourceMapJsonData = JSON.parse(contents);
202
- }
203
- catch (e) {
204
- console.error('[Sealights] Ignoring invalid source map: ' + sourceMapsFilename);
205
- return null;
206
- }
207
- try {
208
- //console.log('Procssing source maps from file: '+sourceMapsFilename);
209
- consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
210
- return consumer;
211
- }
212
- catch (e) {
213
- console.error('[Sealights] Error processing source maps for file: ' + sourceMapsFilename);
214
- return null;
215
- }
216
- }
217
- readSourceMapData(sourceMaps, start, coveragePath) {
218
- if (!sourceMaps)
219
- return null;
220
- try {
221
- //console.log('Checking original position for '+name+' at'+JSON.stringify(start));
222
- const originalPosition = sourceMaps.originalPositionFor(start); //{ line: start.line, column: start[1] });
223
- //console.log('Original position: '+JSON.stringify(originalPosition));
224
- if (originalPosition && originalPosition.source && originalPosition.line !== null && originalPosition.column !== null) {
225
- let originalFilename = originalPosition.source;
226
- if (originalFilename.indexOf('webpack:///webpack/') === -1 &&
227
- originalFilename.indexOf('webpack:///external') === -1) { //Ignore embedded and external module
228
- if (originalFilename.indexOf('webpack:///') === 0) {
229
- originalFilename = originalFilename.substring(11); //'webpack:///'.length
230
- }
231
- originalFilename = this.fixRelPath(coveragePath, originalFilename);
232
- const originalStart = { line: originalPosition.line, column: originalPosition.column };
233
- const result = { originalFilename: originalFilename, originalStart: originalStart };
234
- return result;
235
- }
236
- }
237
- }
238
- catch (e) {
239
- console.error(e);
240
- }
241
- return null;
242
- }
243
- fixRelPath(p1, p2) {
244
- try {
245
- if (!p1 || p1.length == 0)
246
- return p1;
247
- if (!p2 || p2.length == 0)
248
- return p1;
249
- //Make sure both paths are unix-style
250
- p1 = this.adjustPathSlashes(p1);
251
- p2 = this.adjustPathSlashes(p2);
252
- if (p2[0] == '/')
253
- return p2; //Absolute path
254
- const parts1 = p1.split('/');
255
- parts1.pop(); //remove the filename
256
- const parts2 = p2.split('/');
257
- const p3 = parts1.concat(parts2);
258
- const finalPath = this.adjustPathSlashes(path.normalize(p3.join('/')));
259
- return finalPath;
260
- }
261
- catch (err) {
262
- //log.error("Failed to fix real path for source maps. Error: " + err + ". Original File Name: " + p1 + ". Function: " + p2);
263
- return p2;
264
- }
265
- }
266
- adjustPathSlashes(filePath) {
267
- filePath = (filePath || '').replace(/\\/g, '/');
268
- return filePath;
269
- }
270
- }
271
- exports.IstanbulToFootprintsV3 = IstanbulToFootprintsV3;
272
- //# sourceMappingURL=istanbul-to-footprints-v3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"istanbul-to-footprints-v3.js","sourceRoot":"","sources":["../../../test-listener/footprints-process/istanbul-to-footprints-v3.ts"],"names":[],"mappings":";;;AACA,+EAAyE;AAGzE,yBAA0B;AAC1B,6BAA8B;AAC9B,wCAAyC;AAEzC,MAAa,sBAAuB,SAAQ,sDAAwB;IAShE,YAA2B,GAAgB,EAAE,MAAc;QACvD,KAAK,CAAC,MAAM,CAAC,CAAC;QADS,QAAG,GAAH,GAAG,CAAa;QAR3C,eAAU,GAAG,CAAC,CAAC;QAUX,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACnD,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACjD,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,6GAA6G;QAC7G,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;IACtC,CAAC;IAGM,iCAAiC,CAAC,gBAAqC,EAAE,SAA6B;QACzG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,+BAA+B;QAC3D,MAAM,YA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AChD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAzSD,wDAySC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Queue = void 0;
4
- const events = require("events");
5
- class Queue extends events.EventEmitter {
6
- constructor() {
7
- super(...arguments);
8
- this.queue = [];
9
- this.maxItemsInQueue = 1000;
10
- }
11
- requeue(items) {
12
- if (!items || !items.length)
13
- return;
14
- this.queue = items.concat(this.queue);
15
- }
16
- enqueue(item) {
17
- this.queue.push(item);
18
- if (this.maxItemsInQueue == this.queue.length) {
19
- this.emit('full');
20
- }
21
- }
22
- getQueueSize() {
23
- return this.queue.length;
24
- }
25
- dequeue(size) {
26
- if (size == 0)
27
- size = this.queue.length; //dequeue all
28
- if (this.queue.length == 0)
29
- return [];
30
- if (size > this.queue.length)
31
- size = this.queue.length;
32
- const dequeuedItems = this.queue.splice(0, size);
33
- return dequeuedItems;
34
- }
35
- clear() {
36
- this.queue = [];
37
- }
38
- }
39
- exports.Queue = Queue;
40
- //# sourceMappingURL=queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../test-listener/queue.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAClC,MAAa,KAAS,SAAQ,MAAM,CAAC,YAAY;IAAjD;;QAaY,UAAK,GAAQ,EAAE,CAAC;QAChB,oBAAe,GAAW,IAAI,CAAC;IAmB3C,CAAC;IAhCU,OAAO,CAAC,KAAU;QACrB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO,CAAC,IAAO;QAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAG,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAC;YACzC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrB;IACL,CAAC;IAKM,YAAY;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAEM,OAAO,CAAC,IAAY;QACvB,IAAI,IAAI,IAAI,CAAC;YAAE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,aAAa;QACtD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QACtC,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;YACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAE7B,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD,OAAO,aAAa,CAAC;IACzB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACpB,CAAC;CACJ;AAjCD,sBAiCC"}
@@ -1,143 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StateTrackerProcess = void 0;
4
- const events = require("events");
5
- const timers_1 = require("timers");
6
- const sl_env_vars_1 = require("../../common/constants/sl-env-vars");
7
- const INITIAL_COLOR = '00000000-0000-0000-0000-000000000000/__init';
8
- class StateTrackerProcess extends events.EventEmitter {
9
- constructor(cfg, configProcess, stateTrackerProxy, checkTestStatusWatchdog, logger) {
10
- super();
11
- this.cfg = cfg;
12
- this.configProcess = configProcess;
13
- this.stateTrackerProxy = stateTrackerProxy;
14
- this.checkTestStatusWatchdog = checkTestStatusWatchdog;
15
- this.logger = logger;
16
- this.currentTestIdentifier = null;
17
- this._hasAnonymousMappingAtServer = false;
18
- this.isRunning = false;
19
- if (!cfg) {
20
- throw new Error('cfg is required');
21
- }
22
- if (!configProcess) {
23
- throw new Error('configProcess is required');
24
- }
25
- if (!stateTrackerProxy) {
26
- throw new Error('stateTrackerProxy is required');
27
- }
28
- if (!checkTestStatusWatchdog) {
29
- throw new Error('checkTestStatusWatchdog is required');
30
- }
31
- if (!logger) {
32
- throw new Error('logger is required');
33
- }
34
- if (this.cfg.useInitialColor.value && this.currentTestIdentifier == null) {
35
- this.switchToAnonFootprints();
36
- }
37
- configProcess.on('configuration_changed', (newCfg) => {
38
- if (newCfg.useInitialColor.value && this.currentTestIdentifier == null) {
39
- this.switchToAnonFootprints();
40
- }
41
- this.cfg = newCfg;
42
- });
43
- this.startCheckingTestStatusAtServer();
44
- }
45
- startCheckingTestStatusAtServer() {
46
- if (sl_env_vars_1.SlEnvVars.inProductionListenerMode()) {
47
- this.logger.debug('In production listener, no need to check test status in server');
48
- return;
49
- }
50
- this.checkTestStatusWatchdog.on('alarm', () => {
51
- this.checkTestStatusAtServer();
52
- });
53
- //Invoke it directly after the CTOR ends.
54
- (0, timers_1.setTimeout)(() => { this.checkTestStatusAtServer(); }, 0);
55
- }
56
- checkTestStatusAtServer() {
57
- if (this.currentTestIdentifier == INITIAL_COLOR) {
58
- //check if there is still a mapping
59
- this.stateTrackerProxy.checkMappingStatus((err, hasMapping) => {
60
- if (err) {
61
- this.logger.warn(`Error while checking test execution status ${err}`);
62
- }
63
- else { //Agent was in "initial color" and now the server returns that the mapping is no longer active
64
- this._hasAnonymousMappingAtServer = hasMapping;
65
- }
66
- });
67
- }
68
- else {
69
- this.logger.info('\'currentTestIdentifier\' is null. That means that footprints will not be sent.');
70
- }
71
- }
72
- hasAnonymousMappingAtServer() {
73
- return this._hasAnonymousMappingAtServer;
74
- }
75
- isAnonymousColor(testIdentifier) {
76
- return INITIAL_COLOR == testIdentifier;
77
- }
78
- switchToAnonFootprints() {
79
- this.logger.info('Switching to anonymous footprints.');
80
- this.setTestIdentifier(INITIAL_COLOR, false);
81
- }
82
- getCurrentTestIdentifier() {
83
- return this.currentTestIdentifier;
84
- }
85
- setTestIdentifier(newTestIdentifier, silent) {
86
- this.logger.info('setting test identifier: ' + newTestIdentifier);
87
- if ((this.currentTestIdentifier == null) && (newTestIdentifier != null) || (this.currentTestIdentifier != null && this.currentTestIdentifier != newTestIdentifier && newTestIdentifier != INITIAL_COLOR)) {
88
- const previousTestIdentifier = this.currentTestIdentifier;
89
- this.currentTestIdentifier = newTestIdentifier;
90
- if (this.isRunning) {
91
- if (!silent) {
92
- this.emit('test_identifier_changed', this.currentTestIdentifier, previousTestIdentifier);
93
- }
94
- else {
95
- this.logger.info('Test identifier changed, running in silent mode not enqueuing footprints');
96
- }
97
- this.checkTestStatusWatchdog.reset();
98
- }
99
- }
100
- else {
101
- this.logger.info('Not setting the color. newTestIdentifier is \'' + newTestIdentifier + '\' ' + 'and currentTestIdentifier is \'' + this.currentTestIdentifier + '\'');
102
- }
103
- }
104
- start() {
105
- if (this.isRunning) {
106
- return;
107
- }
108
- this.checkTestStatusWatchdog.start();
109
- this.isRunning = true;
110
- }
111
- stop(callback) {
112
- try {
113
- if (!this.isRunning) {
114
- return callback();
115
- }
116
- this.checkTestStatusWatchdog.stop();
117
- this.isRunning = false;
118
- callback();
119
- }
120
- catch (err) {
121
- //TODO: log
122
- return callback();
123
- }
124
- }
125
- static splitTestIdToExecutionAndTestName(testId) {
126
- testId = testId || '';
127
- const executionId = testId.split('/')[0];
128
- let testName = (testId.indexOf('/') == -1) ? '' : testId.substring(executionId.length + 1);
129
- if (!executionId) {
130
- testName = '';
131
- }
132
- return { executionId: executionId, testName: testName };
133
- }
134
- static combineExecutionIdAndTestName(executionId, testName) {
135
- testName = testName || '';
136
- if (!executionId) {
137
- return '';
138
- }
139
- return executionId + '/' + testName;
140
- }
141
- }
142
- exports.StateTrackerProcess = StateTrackerProcess;
143
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../test-listener/state-tracker-process/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAKlC,mCAAoC;AAC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AAoB;QAC5B,IAAI;YACA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACjB,OAAO,QAAQ,EAAE,CAAC;aACrB;YACD,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,QAAQ,EAAE,CAAC;SACd;QAAC,OAAO,GAAG,EAAE;YACV,WAAW;YACX,OAAO,QAAQ,EAAE,CAAC;SACrB;IACL,CAAC;IAEM,MAAM,CAAC,iCAAiC,CAAC,MAAc;QAC1D,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QACtB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,WAAW,EAAE;YACd,QAAQ,GAAG,EAAE,CAAC;SACjB;QACD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAC5D,CAAC;IAEM,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,QAAQ;QAC7D,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,EAAE,CAAC;SACb;QACD,OAAO,WAAW,GAAG,GAAG,GAAG,QAAQ,CAAC;IACxC,CAAC;CACJ;AAhJD,kDAgJC"}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Utils = void 0;
4
- /**
5
- * Created by nadav on 21/03/2017.
6
- */
7
- const jwt_decode_1 = require("jwt-decode");
8
- class Utils {
9
- constructor() {
10
- this.JWTPrefix = 'eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.';
11
- }
12
- parseToken(parsedToken, parsedArgs) {
13
- try {
14
- if (parsedArgs.customerid && parsedArgs.customerid.indexOf(this.JWTPrefix) == 0) {
15
- parsedToken = parsedArgs.customerid;
16
- parsedArgs.token = parsedToken;
17
- }
18
- if (!parsedToken) {
19
- throw new Error('Token Must Be Given');
20
- }
21
- const tokenData = (0, jwt_decode_1.default)(parsedToken);
22
- if (!tokenData['x-sl-server']) {
23
- throw new Error('Doesn\'t Contain Server');
24
- }
25
- if (!tokenData['subject']) {
26
- throw new Error('Doesn\'t Contain Subject');
27
- }
28
- let customerId = tokenData['subject'];
29
- const subjectParts = tokenData['subject'].split('@');
30
- if (subjectParts.length >= 1) {
31
- customerId = subjectParts[0];
32
- }
33
- parsedArgs.server = tokenData['x-sl-server'];
34
- parsedArgs.customerid = customerId;
35
- parsedArgs.isValidToken = true;
36
- }
37
- catch (err) {
38
- console.error('Token Is Invalid. ' + err);
39
- parsedArgs.isValidToken = false;
40
- }
41
- }
42
- resolveLabId(labId, env, appName) {
43
- if (labId) {
44
- return labId;
45
- }
46
- if (env) {
47
- return env;
48
- }
49
- if (appName) {
50
- return appName;
51
- }
52
- return 'DefaultLabId';
53
- }
54
- resolveTestStage(testStage, env, labId) {
55
- if (testStage) {
56
- return testStage;
57
- }
58
- if (env) {
59
- return env;
60
- }
61
- if (labId) { // needed for backwards compatibility. only for nodejs
62
- return labId;
63
- }
64
- return 'Unit Tests';
65
- }
66
- }
67
- exports.Utils = Utils;
68
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../test-listener/utils.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,2CAAmC;AAEnC,MAAa,KAAK;IAAlB;QACY,cAAS,GAAW,uCAAuC,CAAC;IA0DxE,CAAC;IAxDU,UAAU,CAAC,WAAW,EAAE,UAAU;QACrC,IAA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ACL,OAAO,GAAG,CAAC;SACd;QACD,IAAI,OAAO,EAAE;YACT,OAAO,OAAO,CAAC;SAClB;QACD,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEM,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK;QACzC,IAAI,SAAS,EAAE;YACX,OAAO,SAAS,CAAC;SACpB;QACD,IAAI,GAAG,EAAE;YACL,OAAO,GAAG,CAAC;SACd;QACD,IAAI,KAAK,EAAE,EAAE,sDAAsD;YAC/D,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AA3DD,sBA2DC"}
@@ -1,89 +0,0 @@
1
- /// <reference types="node" />
2
- import events = require('events');
3
- export interface ITimers {
4
- setTimeout(callback: any, time: any): any;
5
- clearTimeout(handle: any): void;
6
- }
7
- export interface IWatchdogOptions {
8
- interval: number;
9
- name?: string;
10
- /**
11
- * Makes the watchdog Auto-Reset, immediately restarting itself after firing the "alarm" event
12
- * Defaults to false
13
- *
14
- * @type {boolean}
15
- * @memberOf IWatchdogOptions
16
- */
17
- autoReset?: boolean;
18
- /**
19
- * Makes this timer run in the background by calling the unref() method on the timer handle.
20
- * Running in the foreground (default) prevents the process from exiting, while running background doesn't.
21
- * Defaults to false
22
- *
23
- * @type {boolean}
24
- * @memberOf IWatchdogOptions
25
- */
26
- unref?: boolean;
27
- }
28
- /**
29
- * Wraps timers to fire an "alarm" alarm after a given interval. Supports
30
- *
31
- * @export
32
- * @class Watchdog
33
- * @extends {events.EventEmitter}
34
- */
35
- export declare class Watchdog extends events.EventEmitter {
36
- private options;
37
- private timers;
38
- private handle;
39
- private pendingAlarmDuringSuspended;
40
- private suspended;
41
- private stopped;
42
- constructor(options: IWatchdogOptions, timers: ITimers);
43
- abort(): void;
44
- /**
45
- * Restarts the watchdog
46
- *
47
- * @memberOf Watchdog
48
- */
49
- reset(): void;
50
- /**
51
- * Stops the watchdog
52
- *
53
- *
54
- * @memberOf Watchdog
55
- */
56
- stop(): void;
57
- /**
58
- * Starts the watchdog
59
- *
60
- * @memberOf Watchdog
61
- */
62
- start(): void;
63
- /**
64
- * Returns the current status of the watchdog
65
- * @returns
66
- *
67
- * @memberOf Watchdog
68
- */
69
- getStatus(): {
70
- pendingAlarmDuringSuspended: boolean;
71
- running: boolean;
72
- suspended: boolean;
73
- };
74
- /**
75
- * Suspends this watchdog, which prevents it from firing events.
76
- *
77
- * @memberOf Watchdog
78
- */
79
- suspend(): void;
80
- /**
81
- * Resumes this watchdog from suspended mode. If an alarm was fired while suspended, it will be fired now.
82
- *
83
- * @memberOf Watchdog
84
- */
85
- resume(): void;
86
- private fireAlarm;
87
- setInterval(newInterval: number): void;
88
- getInterval(): number;
89
- }