slnodejs 6.1.1143 → 6.1.1147

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 (40) hide show
  1. package/package.json +1 -1
  2. package/tsOutputs/cli-parse/executors/nyc-report-executor.js +1 -2
  3. package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
  4. package/tsOutputs/common/contracts.d.ts +1 -1
  5. package/tsOutputs/common/coverage-elements/original-module-loader.d.ts +1 -1
  6. package/tsOutputs/common/footprints-process-v6/collection-interval.js.map +1 -0
  7. package/tsOutputs/common/footprints-process-v6/index.js +1 -1
  8. package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
  9. package/tsOutputs/common/{footprints-process → footprints-process-v6}/istanbul-to-footprints-contract.d.ts +0 -7
  10. package/tsOutputs/common/footprints-process-v6/istanbul-to-footprints-contract.js +3 -0
  11. package/tsOutputs/common/footprints-process-v6/istanbul-to-footprints-contract.js.map +1 -0
  12. package/tsOutputs/test-listener/agent.d.ts +1 -2
  13. package/tsOutputs/test-listener/agent.js.map +1 -1
  14. package/tsOutputs/test-listener/api.js +3 -7
  15. package/tsOutputs/test-listener/api.js.map +1 -1
  16. package/tsOutputs/test-listener/factory.d.ts +1 -6
  17. package/tsOutputs/test-listener/factory.js +1 -30
  18. package/tsOutputs/test-listener/factory.js.map +1 -1
  19. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +1 -1
  20. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
  21. package/tsOutputs/common/footprints-process/collection-interval.js.map +0 -1
  22. package/tsOutputs/common/footprints-process/footprints-service-proxy.d.ts +0 -13
  23. package/tsOutputs/common/footprints-process/footprints-service-proxy.js +0 -63
  24. package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +0 -1
  25. package/tsOutputs/common/footprints-process/index.d.ts +0 -72
  26. package/tsOutputs/common/footprints-process/index.js +0 -287
  27. package/tsOutputs/common/footprints-process/index.js.map +0 -1
  28. package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js +0 -7
  29. package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js.map +0 -1
  30. package/tsOutputs/common/footprints-process/istanbul-to-footprints.d.ts +0 -47
  31. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +0 -426
  32. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +0 -1
  33. package/tsOutputs/common/footprints-process/production-footprints-handler.d.ts +0 -55
  34. package/tsOutputs/common/footprints-process/production-footprints-handler.js +0 -278
  35. package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +0 -1
  36. package/tsOutputs/common/messages-formatter.d.ts +0 -6
  37. package/tsOutputs/test-listener/nyc-report-executor.js +0 -108
  38. package/tsOutputs/test-listener/nyc-report-executor.js.map +0 -1
  39. /package/tsOutputs/common/{footprints-process → footprints-process-v6}/collection-interval.d.ts +0 -0
  40. /package/tsOutputs/common/{footprints-process → footprints-process-v6}/collection-interval.js +0 -0
@@ -1,72 +0,0 @@
1
- import { AgentConfig } from '../config-process/config';
2
- import { Watchdog } from '../watchdog';
3
- import { IstanbulToFootprints } from './istanbul-to-footprints';
4
- import { EnvironmentDataService } from '../environment-data-service';
5
- import { Logger, IFootprintsHandler } from '../contracts';
6
- import { StateTracker } from '../state-tracker';
7
- import { AgentInstanceData } from '../agent-instance-data';
8
- export declare class FootprintsProcess {
9
- /**
10
- * Initial configuration
11
- */
12
- private cfg;
13
- /**
14
- * Background thread that tells the footprints service to send footprints from the queue to the server
15
- */
16
- private sendToServerWatchdog;
17
- /**
18
- * Foreground thread that prevents the process from shutting down, and kept alive while there are items to submit to the server or items are currently being submitted
19
- */
20
- private keepaliveWatchdog;
21
- /**
22
- * Proxy to the server for footprints submission
23
- */
24
- private footprintsServiceProxy;
25
- /**
26
- * Environments service, used to get environmental data for submission (process id, machine data, etc.)
27
- */
28
- private environmentDataService;
29
- private agentInstanceData;
30
- private istanbulToFootprints;
31
- private stateTracker;
32
- private logger;
33
- private collectionInterval;
34
- constructor(
35
- /**
36
- * Initial configuration
37
- */
38
- cfg: AgentConfig,
39
- /**
40
- * Background thread that tells the footprints service to send footprints from the queue to the server
41
- */
42
- sendToServerWatchdog: Watchdog,
43
- /**
44
- * Foreground thread that prevents the process from shutting down, and kept alive while there are items to submit to the server or items are currently being submitted
45
- */
46
- keepaliveWatchdog: Watchdog,
47
- /**
48
- * Proxy to the server for footprints submission
49
- */
50
- footprintsServiceProxy: IFootprintsHandler,
51
- /**
52
- * Environments service, used to get environmental data for submission (process id, machine data, etc.)
53
- */
54
- environmentDataService: EnvironmentDataService, agentInstanceData: AgentInstanceData, istanbulToFootprints: IstanbulToFootprints, stateTracker: StateTracker, logger: Logger);
55
- private isSubmittingFootprints;
56
- private footprintsQueue;
57
- enqueueCurrentFootprints(executionId: string, testName: string): void;
58
- private ensureKeepaliveThreadRunning;
59
- updateConfig(updatedCfg: AgentConfig): void;
60
- private sequence;
61
- private createFootprintsPacket;
62
- submitQueuedFootprints(): void;
63
- private fireQueueEmpty;
64
- private isRunning;
65
- start(): void;
66
- private stopCallbacks;
67
- stop(callback: () => void): void;
68
- handleTestIdChanged(newTestIdentifier: any, previousTestIdentifier: any): void;
69
- flushCurrentFootprints(): void;
70
- getQueueSize(): number;
71
- loadSlMapping(): Promise<void>;
72
- }
@@ -1,287 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FootprintsProcess = void 0;
13
- const queue_1 = require("../queue");
14
- const collection_interval_1 = require("./collection-interval");
15
- const system_date_1 = require("../system-date");
16
- const state_tracker_1 = require("../state-tracker");
17
- const sl_env_vars_1 = require("../constants/sl-env-vars");
18
- const cockpit_notifier_1 = require("../agent-events/cockpit-notifier");
19
- const agent_events_contracts_1 = require("../agent-events/agent-events-contracts");
20
- class FootprintsProcess {
21
- constructor(
22
- /**
23
- * Initial configuration
24
- */
25
- cfg,
26
- /**
27
- * Background thread that tells the footprints service to send footprints from the queue to the server
28
- */
29
- sendToServerWatchdog,
30
- /**
31
- * Foreground thread that prevents the process from shutting down, and kept alive while there are items to submit to the server or items are currently being submitted
32
- */
33
- keepaliveWatchdog,
34
- /**
35
- * Proxy to the server for footprints submission
36
- */
37
- footprintsServiceProxy,
38
- /**
39
- * Environments service, used to get environmental data for submission (process id, machine data, etc.)
40
- */
41
- environmentDataService, agentInstanceData, istanbulToFootprints, stateTracker, logger) {
42
- this.cfg = cfg;
43
- this.sendToServerWatchdog = sendToServerWatchdog;
44
- this.keepaliveWatchdog = keepaliveWatchdog;
45
- this.footprintsServiceProxy = footprintsServiceProxy;
46
- this.environmentDataService = environmentDataService;
47
- this.agentInstanceData = agentInstanceData;
48
- this.istanbulToFootprints = istanbulToFootprints;
49
- this.stateTracker = stateTracker;
50
- this.logger = logger;
51
- this.isSubmittingFootprints = false;
52
- this.sequence = 0;
53
- this.isRunning = false;
54
- this.stopCallbacks = [];
55
- if (!cfg)
56
- throw new Error('cfg was not specified');
57
- if (!sendToServerWatchdog)
58
- throw new Error('sendToServerWatchdog was not specified');
59
- if (!keepaliveWatchdog)
60
- throw new Error('keepaliveWatchdog was not specified');
61
- if (!footprintsServiceProxy)
62
- throw new Error('footprintsServiceProxy was not specified');
63
- if (!environmentDataService)
64
- throw new Error('environmentDataService was not specified');
65
- if (!agentInstanceData)
66
- throw new Error('agentInstanceData was not specified');
67
- if (!istanbulToFootprints)
68
- throw new Error('istanbulToFootprints was not specified');
69
- if (!logger) {
70
- throw new Error('logger was not specified');
71
- }
72
- this.collectionInterval = new collection_interval_1.CollectionInterval(cfg.interval.value);
73
- this.footprintsQueue = new queue_1.Queue();
74
- sendToServerWatchdog.on('alarm', () => {
75
- this.logger.debug('Start submitting footprints, triggered by send to server watchdog.');
76
- this.submitQueuedFootprints();
77
- });
78
- this.footprintsQueue.on('full', () => {
79
- this.logger.debug('Start submitting footprints, queue is full.');
80
- this.submitQueuedFootprints();
81
- });
82
- keepaliveWatchdog.on('alarm', () => {
83
- //console.log('keepaliveWatchdog. isSubmittingFootprints:' + this.isSubmittingFootprints + ', queue size: ' + this.footprintsQueue.getQueueSize());
84
- if (!this.isSubmittingFootprints &&
85
- this.footprintsQueue.getQueueSize() == 0) {
86
- keepaliveWatchdog.stop();
87
- }
88
- });
89
- }
90
- enqueueCurrentFootprints(executionId, testName) {
91
- this.collectionInterval.next();
92
- const footprints = this.istanbulToFootprints.getCurrentFootprints();
93
- const hitModules = Object.keys(footprints);
94
- if (!hitModules || hitModules.length == 0) {
95
- //If no modules were hit at all, don't enqueue anything
96
- this.logger.info('No files were hit, not enqueuing footprints.');
97
- return;
98
- }
99
- this.logger.info(`Enqueuing footprints for ${hitModules.length} files`);
100
- this.footprintsQueue.enqueue({
101
- executionId: executionId,
102
- testName: testName,
103
- footprints: footprints,
104
- localTime: (0, system_date_1.getSystemDateValueOf)(),
105
- collectionInterval: this.collectionInterval.toJson(),
106
- });
107
- if (this.isRunning &&
108
- this.cfg.sendFootprints.value &&
109
- this.cfg.enabled.value) {
110
- this.ensureKeepaliveThreadRunning();
111
- this.sendToServerWatchdog.start();
112
- }
113
- }
114
- ensureKeepaliveThreadRunning() {
115
- this.keepaliveWatchdog.start();
116
- }
117
- updateConfig(updatedCfg) {
118
- if (updatedCfg.sendFootprints.value === false ||
119
- updatedCfg.enabled.value === false) {
120
- cockpit_notifier_1.CockpitNotifier.sendEvent(agent_events_contracts_1.AgentEventCode.AGENT_MUTED);
121
- this.footprintsQueue.clear();
122
- this.stop(() => { });
123
- }
124
- this.cfg = updatedCfg;
125
- this.sendToServerWatchdog.setInterval(this.cfg.interval.value);
126
- }
127
- createFootprintsPacket(items) {
128
- const packet = this.istanbulToFootprints.createFootprintsPackageFromQueue(items, {
129
- customerId: this.cfg.customerId.value,
130
- environment: this.environmentDataService.getEnvDataForSubmission(),
131
- configurationData: this.cfg.toJsonObject(),
132
- meta: {
133
- sequence: ++this.sequence,
134
- generated: (0, system_date_1.getSystemDateValueOf)(),
135
- agentId: this.agentInstanceData.agentId,
136
- },
137
- tests: [],
138
- apps: [],
139
- });
140
- return packet;
141
- }
142
- submitQueuedFootprints() {
143
- if (!this.isRunning) {
144
- this.logger.info('Agent is not running, not sending footprints');
145
- return;
146
- }
147
- if (this.cfg.sendFootprints.value === false) {
148
- this.logger.info('Not sending footprints since agent is configured to not send.');
149
- return; //Can't start without server or token
150
- }
151
- if (this.isSubmittingFootprints) {
152
- this.logger.info('Not sending footprints since its already submitting.');
153
- return;
154
- }
155
- if (this.footprintsQueue.getQueueSize() == 0) {
156
- this.logger.info('Not sending footprints since queue size is 0');
157
- return;
158
- }
159
- this.logger.info('About to send footprints. Queue size:' +
160
- this.footprintsQueue.getQueueSize());
161
- const items = this.footprintsQueue.dequeue(
162
- /*this.cfg.maxFootprintsChunkSize ||*/ 1000);
163
- const packet = this.createFootprintsPacket(items);
164
- this.isSubmittingFootprints = true;
165
- this.footprintsServiceProxy.handleFootprints(packet, (err) => {
166
- this.isSubmittingFootprints = false;
167
- this.logger.info('Sent footprints. Queue size:' +
168
- this.footprintsQueue.getQueueSize() +
169
- ', err:' +
170
- err);
171
- if (err) {
172
- this.environmentDataService.setLastError(err.stack);
173
- this.footprintsQueue.requeue(items); //Requeue items for later submission
174
- }
175
- else if (this.footprintsQueue.getQueueSize() > 0) {
176
- //If there was an error, don't send now. Otherwise, if the queue still has items, send those now
177
- this.submitQueuedFootprints();
178
- }
179
- else
180
- this.fireQueueEmpty();
181
- });
182
- }
183
- fireQueueEmpty() {
184
- if (this.stopCallbacks.length > 0) {
185
- this.stopCallbacks.forEach((cb) => {
186
- try {
187
- cb();
188
- }
189
- catch (err) {
190
- this.environmentDataService.setLastError(err.stack);
191
- }
192
- });
193
- }
194
- }
195
- start() {
196
- if (this.isRunning)
197
- return; //Already started
198
- if (this.cfg.enabled.value == false)
199
- return; //Don't do anything if agent is completely disabled
200
- this.isRunning = true;
201
- this.sendToServerWatchdog.start();
202
- if (this.footprintsQueue.getQueueSize() > 0) {
203
- this.ensureKeepaliveThreadRunning();
204
- }
205
- }
206
- stop(callback) {
207
- try {
208
- this.sendToServerWatchdog.stop();
209
- if (this.cfg.enabled.value === false ||
210
- this.cfg.sendFootprints.value === false) {
211
- //Footprints/Agent functionality is disabled. Return immediately
212
- this.isRunning = false;
213
- return callback();
214
- }
215
- this.logger.debug('Start submitting footprints, triggered by stop event.');
216
- this.submitQueuedFootprints(); //If footprints are being submitted, this has no effect. Otherwise, it will start submitting footprints if the queue is non-empty
217
- if (this.isSubmittingFootprints) {
218
- /*
219
- Nothing to do right now, since footprints are being submitted
220
- When the submission is over (successfully or not), if the queue is empty the next batch of footprints will be sent.
221
- If after submission the queue is cleared, this callback will be called
222
- */
223
- this.stopCallbacks.push(() => {
224
- this.isRunning = false;
225
- this.keepaliveWatchdog.stop();
226
- return callback();
227
- });
228
- }
229
- else {
230
- /*
231
- Queue must be empty, and nothing is sent. submitQueuedFootprints() would have started sending footprints if the queue was non-empty
232
- */
233
- this.isRunning = false;
234
- this.keepaliveWatchdog.stop();
235
- return callback();
236
- }
237
- }
238
- catch (err) {
239
- this.logger.error(err);
240
- return callback();
241
- }
242
- }
243
- handleTestIdChanged(newTestIdentifier, previousTestIdentifier) {
244
- if (previousTestIdentifier != null) {
245
- if (!this.stateTracker.hasMappingAtServer() &&
246
- this.stateTracker.isAnonymousColor(previousTestIdentifier)) {
247
- this.logger.info("Test identifier changed, couldn't find active execution for anonymous footprints. Skip enqueuing footprints process.");
248
- return;
249
- }
250
- this.logger.debug('Test identifier changed, start enqueuing footprints process.');
251
- const prevTestIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(previousTestIdentifier);
252
- this.enqueueCurrentFootprints(prevTestIdentifierParts.executionId, prevTestIdentifierParts.testName);
253
- }
254
- else {
255
- this.logger.info("Test identifier changed, previous identifier wasn't set, meaning that we didn't have active test. Skip enqueuing footprints process.");
256
- }
257
- }
258
- flushCurrentFootprints() {
259
- const currentTestIdentifier = this.stateTracker.getCurrentTestIdentifier();
260
- const testIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(currentTestIdentifier);
261
- if (sl_env_vars_1.SlEnvVars.inProductionListenerMode()) {
262
- this.logger.debug('Enqueue footprints for production listener');
263
- this.enqueueCurrentFootprints(testIdentifierParts.executionId, testIdentifierParts.testName);
264
- return;
265
- }
266
- if (currentTestIdentifier != null) {
267
- if (!this.stateTracker.hasMappingAtServer() &&
268
- this.stateTracker.isAnonymousColor(currentTestIdentifier)) {
269
- this.logger.info(`Enqueue footprints interval - couldn\'t find active execution for anonymous footprints. skip enqueue footprints process. currentTestIdentifier: '${currentTestIdentifier}'`);
270
- return;
271
- }
272
- this.logger.debug(`Enqueue footprints interval - start enqueuing process. currentTestIdentifier: '${currentTestIdentifier}'`);
273
- this.enqueueCurrentFootprints(testIdentifierParts.executionId, testIdentifierParts.testName);
274
- }
275
- else {
276
- this.logger.info('Enqueue footprints interval - no test identifier. skip enqueuing process. ');
277
- }
278
- }
279
- getQueueSize() {
280
- return this.footprintsQueue.getQueueSize();
281
- }
282
- loadSlMapping() {
283
- return __awaiter(this, void 0, void 0, function* () { });
284
- }
285
- }
286
- exports.FootprintsProcess = FootprintsProcess;
287
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../common/footprints-process/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oCAAiC;AAMjC,+DAA2D;AAC3D,gDAAsD;AACtD,o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,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,kFAAkF,qBAAqB,GAAG,CAC3G,CAAC;YACF,IAAI,CAAC,wBAAwB,CAC3B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,QAAQ,CAC7B,CAAC;SACH;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,4EAA4E,CAC7E,CAAC;SACH;IACH,CAAC;IAEM,YAAY;QACjB,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;IAC7C,CAAC;IAEY,aAAa;8DAAI,CAAC;KAAA;CAChC;AA1UD,8CA0UC"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IExtendedIstanbulMetrics = void 0;
4
- class IExtendedIstanbulMetrics {
5
- }
6
- exports.IExtendedIstanbulMetrics = IExtendedIstanbulMetrics;
7
- //# sourceMappingURL=istanbul-to-footprints-contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"istanbul-to-footprints-contract.js","sourceRoot":"","sources":["../../../common/footprints-process/istanbul-to-footprints-contract.ts"],"names":[],"mappings":";;;AAAA,MAAa,wBAAwB;CAMpC;AAND,4DAMC"}
@@ -1,47 +0,0 @@
1
- import { IIstanbulModule, IIstanbulProcessMetrics, IExtendedIstanbulMetrics } from './istanbul-to-footprints-contract';
2
- import { IFootprintsFile, Logger } from '../contracts';
3
- import { AgentConfig } from '../config-process/config';
4
- export declare class IstanbulToFootprints {
5
- private cfg;
6
- private totalTests;
7
- private eidToHitsIndex;
8
- private uniqueIdToElement;
9
- private testNameToTestData;
10
- private fileToSourceMapConsumer;
11
- private fileNameToAppFile;
12
- private globalCoverageContainer;
13
- private previousIstanbulCounters;
14
- private nycFinalReportData;
15
- private logger;
16
- constructor(cfg: AgentConfig, logger: Logger);
17
- private resetState;
18
- createFootprintsPackageFromQueue(queuedFootprints: IExtendedIstanbulMetrics[], extraData: IFootprintsFile): IFootprintsFile;
19
- createFootprintsPackageFromRawData(rawData: IExtendedIstanbulMetrics, extraData: IFootprintsFile): IFootprintsFile;
20
- private convertIstanbulDataToFootprints;
21
- private handleBranchesData;
22
- private handleFunctionsData;
23
- private addDeclarationFootprints;
24
- private getSourceMapForModule;
25
- private addOrUpdateElementHits;
26
- private getOrCreateTestData;
27
- private getOrCreateMethodElement;
28
- private getOrCreateBranchElement;
29
- private getOrCreateFootprintsAppFile;
30
- private createFootprintsAppData;
31
- private readSourceMapData;
32
- private adjustPathSlashes;
33
- protected getIstanbulCounters(): IIstanbulProcessMetrics;
34
- private getCoverageObject;
35
- private relativeModulePaths;
36
- getRelativeModulePath(module: IIstanbulModule): string;
37
- protected formatLoc(loc: {
38
- column: number;
39
- line: number;
40
- }): string;
41
- getCurrentFootprints(): IIstanbulProcessMetrics;
42
- protected getIstanbulCountersDiff(currentCounters: IIstanbulProcessMetrics): IIstanbulProcessMetrics;
43
- private logDiff;
44
- private newNumberArray;
45
- private loadOriginalModules;
46
- private resolveProjectRoot;
47
- }