slnodejs 6.1.217 → 6.1.225
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/browser-agent/dist/browser-agent-all.js +222 -137
- package/browser-agent/dist/browser-agent-all.min.js +24 -24
- package/browser-agent/package.json +1 -1
- package/package.json +3 -3
- package/tsOutputs/build-scanner/build-diff-process.js +7 -2
- package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +1 -1
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/file-instrumenter.js +12 -1
- package/tsOutputs/build-scanner/instrumentation/file-instrumenter.js.map +1 -1
- package/tsOutputs/cli-parse/cli.js +19 -0
- package/tsOutputs/cli-parse/cli.js.map +1 -1
- package/tsOutputs/cli-parse/executors/base-executor.js +4 -0
- package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +1 -0
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-instance-data.js +2 -1
- package/tsOutputs/common/agent-instance-data.js.map +1 -1
- package/tsOutputs/common/constants/sl-env-vars.js +19 -19
- package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/index.d.ts +4 -3
- package/tsOutputs/common/footprints-process-v6/index.js +107 -49
- package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.d.ts +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +41 -0
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/http/http-client.d.ts +5 -1
- package/tsOutputs/common/http/http-client.js +16 -12
- package/tsOutputs/common/http/http-client.js.map +1 -1
- package/tsOutputs/common/ignored-files-handler.js +7 -2
- package/tsOutputs/common/ignored-files-handler.js.map +1 -1
- package/tsOutputs/common/state-tracker.d.ts +1 -1
- package/tsOutputs/common/state-tracker.js +3 -4
- package/tsOutputs/common/state-tracker.js.map +1 -1
- package/tsOutputs/common/utils/{parsing-utils.d.ts → env-var-parsing.d.ts} +1 -1
- package/tsOutputs/common/utils/{parsing-utils.js → env-var-parsing.js} +8 -8
- package/tsOutputs/common/utils/env-var-parsing.js.map +1 -0
- package/tsOutputs/mocha-reporter/index.js +1 -1
- package/tsOutputs/test-listener/agent.d.ts +1 -1
- package/tsOutputs/test-listener/agent.js +4 -2
- package/tsOutputs/test-listener/agent.js.map +1 -1
- package/tsOutputs/test-listener/factory.d.ts +1 -1
- package/tsOutputs/test-listener/factory.js +48 -5
- package/tsOutputs/test-listener/factory.js.map +1 -1
- package/tsOutputs/test-listener/remote-agent.js +5 -3
- package/tsOutputs/test-listener/remote-agent.js.map +1 -1
- package/tsOutputs/common/utils/parsing-utils.js.map +0 -1
|
@@ -43063,11 +43063,30 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
43063
43063
|
this.slMappingLoader.loadSlMapping(this.configuration.buildSessionId);
|
|
43064
43064
|
};
|
|
43065
43065
|
BrowserAgentInstanceFpv6.prototype.stopFootprintsProcess = function () {
|
|
43066
|
-
this
|
|
43067
|
-
|
|
43066
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43067
|
+
return __generator(this, function (_a) {
|
|
43068
|
+
switch (_a.label) {
|
|
43069
|
+
case 0:
|
|
43070
|
+
this.flushFootprintsWatchdog.stop();
|
|
43071
|
+
return [4, this.footprintsProcess.stop()];
|
|
43072
|
+
case 1:
|
|
43073
|
+
_a.sent();
|
|
43074
|
+
return [2];
|
|
43075
|
+
}
|
|
43076
|
+
});
|
|
43077
|
+
});
|
|
43068
43078
|
};
|
|
43069
43079
|
BrowserAgentInstanceFpv6.prototype.submitFootprints = function () {
|
|
43070
|
-
this
|
|
43080
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
43081
|
+
return __generator(this, function (_a) {
|
|
43082
|
+
switch (_a.label) {
|
|
43083
|
+
case 0: return [4, this.footprintsProcess.submitQueuedFootprints(this.stateTracker.currentExecution)];
|
|
43084
|
+
case 1:
|
|
43085
|
+
_a.sent();
|
|
43086
|
+
return [2];
|
|
43087
|
+
}
|
|
43088
|
+
});
|
|
43089
|
+
});
|
|
43071
43090
|
};
|
|
43072
43091
|
BrowserAgentInstanceFpv6.prototype.submitFootprintsSync = function () {
|
|
43073
43092
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -46558,7 +46577,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
46558
46577
|
var _this = this;
|
|
46559
46578
|
var slEnvVars = {};
|
|
46560
46579
|
Object.keys(process.env).forEach(function (key) {
|
|
46561
|
-
if (key.indexOf(SEALIGHTS_ENV_VAR_PREFIX) === 0) {
|
|
46580
|
+
if (key.indexOf(SEALIGHTS_ENV_VAR_PREFIX) === 0 || key === 'NODE_OPTIONS') {
|
|
46562
46581
|
slEnvVars[key] = sensitive_data_filter_1.isSensitive(key, process.env[key], _this.logger) ?
|
|
46563
46582
|
AgentInstanceInfoBuilder.SECRET_VALUE_PLACEHOLDER : process.env[key];
|
|
46564
46583
|
}
|
|
@@ -47014,7 +47033,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47014
47033
|
return null;
|
|
47015
47034
|
};
|
|
47016
47035
|
AgentInstanceData.prototype.resolveAgentVersionForBrowserAgent = function () {
|
|
47017
|
-
|
|
47036
|
+
var windowVar = typeof window !== 'undefined' ? window : null;
|
|
47037
|
+
return (windowVar && windowVar[agent_instance_info_builder_1.AgentInstanceInfoBuilder.SEALIGHTS_WINDOW_OBJECT] && windowVar[agent_instance_info_builder_1.AgentInstanceInfoBuilder.SEALIGHTS_WINDOW_OBJECT].agentVersion) || agent_instance_info_builder_1.AgentInstanceInfoBuilder.DEFAULT_BROWSER_AGENT_VERSION;
|
|
47018
47038
|
};
|
|
47019
47039
|
return AgentInstanceData;
|
|
47020
47040
|
}());
|
|
@@ -47022,7 +47042,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47022
47042
|
});
|
|
47023
47043
|
|
|
47024
47044
|
}).call(this)}).call(this,"/tsOutputs/common")
|
|
47025
|
-
},{"./agent-events/agent-events-conracts":289,"./agent-events/agent-instance-info-builder":291,"./utils/files-utils":
|
|
47045
|
+
},{"./agent-events/agent-events-conracts":289,"./agent-events/agent-instance-info-builder":291,"./utils/files-utils":335,"fs":69,"uuid":507}],300:[function(require,module,exports){
|
|
47026
47046
|
(function (process){(function (){
|
|
47027
47047
|
(function (factory) {
|
|
47028
47048
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
@@ -47686,24 +47706,24 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47686
47706
|
if (v !== undefined) module.exports = v;
|
|
47687
47707
|
}
|
|
47688
47708
|
else if (typeof define === "function" && define.amd) {
|
|
47689
|
-
define(["require", "exports", "../utils/parsing
|
|
47709
|
+
define(["require", "exports", "../utils/env-var-parsing"], factory);
|
|
47690
47710
|
}
|
|
47691
47711
|
})(function (require, exports) {
|
|
47692
47712
|
"use strict";
|
|
47693
47713
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47694
47714
|
exports.SlEnvVars = void 0;
|
|
47695
|
-
var
|
|
47715
|
+
var env_var_parsing_1 = require("../utils/env-var-parsing");
|
|
47696
47716
|
var SlEnvVars = (function () {
|
|
47697
47717
|
function SlEnvVars() {
|
|
47698
47718
|
}
|
|
47699
47719
|
SlEnvVars.getHttpTimeout = function () {
|
|
47700
|
-
return
|
|
47720
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.HTTP_TIMEOUT);
|
|
47701
47721
|
};
|
|
47702
47722
|
SlEnvVars.getHttpMaxAttempts = function () {
|
|
47703
|
-
return
|
|
47723
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.HTTP_MAX_ATTEMPTS);
|
|
47704
47724
|
};
|
|
47705
47725
|
SlEnvVars.getHttpAttemptInterval = function () {
|
|
47706
|
-
return
|
|
47726
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.HTTP_ATTEMPT_INTERVAL);
|
|
47707
47727
|
};
|
|
47708
47728
|
SlEnvVars.inProductionListenerMode = function () {
|
|
47709
47729
|
return !!process.env[SlEnvVars.PRODUCTION_LISTENER];
|
|
@@ -47717,34 +47737,34 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47717
47737
|
SlEnvVars.getBasePath = function () {
|
|
47718
47738
|
return process.env[SlEnvVars.BASE_PATH];
|
|
47719
47739
|
};
|
|
47720
|
-
SlEnvVars.isUseNewUniqueId = function () { return
|
|
47721
|
-
SlEnvVars.isUseIstanbul = function () { return
|
|
47740
|
+
SlEnvVars.isUseNewUniqueId = function () { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.NEW_UNIQUE_ID); };
|
|
47741
|
+
SlEnvVars.isUseIstanbul = function () { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.USE_ISTANBUL); };
|
|
47722
47742
|
SlEnvVars.enableFootprintsV6 = function () {
|
|
47723
|
-
return
|
|
47743
|
+
return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.ENABLE_FOOTPRINTS_V6);
|
|
47724
47744
|
};
|
|
47725
47745
|
SlEnvVars.getFootprintsCollectIntervalSecs = function () {
|
|
47726
|
-
return
|
|
47746
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.FOOTPRINTS_COLLECTION_INTERVAL_SECS);
|
|
47727
47747
|
};
|
|
47728
47748
|
SlEnvVars.getFootprintsSendMaxIntervalSecs = function () {
|
|
47729
|
-
return
|
|
47749
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.FOOTPRINTS_SEND_MAX_INTERVAL_SECS);
|
|
47730
47750
|
};
|
|
47731
47751
|
SlEnvVars.getFootprintsQueueSize = function () {
|
|
47732
|
-
return
|
|
47752
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.FOOTPRINTS_QUEUE_SIZE);
|
|
47733
47753
|
};
|
|
47734
47754
|
SlEnvVars.getExecutionQueryIntervalSecs = function () {
|
|
47735
|
-
return
|
|
47755
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.EXECUTION_QUERY_INTERVAL_SEC);
|
|
47736
47756
|
};
|
|
47737
47757
|
SlEnvVars.getFootprintsBufferThresholdMb = function () {
|
|
47738
|
-
return
|
|
47758
|
+
return env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.FOOTPRINTS_BUFFER_THRESHOLD_MB);
|
|
47739
47759
|
};
|
|
47740
47760
|
SlEnvVars.blockBrowserHttpTraffic = function () {
|
|
47741
|
-
return
|
|
47761
|
+
return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.BLOCK_BROWSER_HTTP_TRAFFIC);
|
|
47742
47762
|
};
|
|
47743
47763
|
SlEnvVars.getDisableHookDependencyGuard = function () {
|
|
47744
|
-
return
|
|
47764
|
+
return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.DISABLE_HOOK_DEPENDENCY_GUARD);
|
|
47745
47765
|
};
|
|
47746
47766
|
SlEnvVars.useSlMapping = function () {
|
|
47747
|
-
return
|
|
47767
|
+
return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.USE_SL_MAPPING);
|
|
47748
47768
|
};
|
|
47749
47769
|
var _a;
|
|
47750
47770
|
SlEnvVars.HTTP_TIMEOUT = 'SL_httpTimeout';
|
|
@@ -47783,13 +47803,13 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47783
47803
|
return process.env[SlEnvVars.CIA.SL_MAPPING_URL];
|
|
47784
47804
|
};
|
|
47785
47805
|
class_1.reduceInstrumentedFileSize = function () {
|
|
47786
|
-
return
|
|
47806
|
+
return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.CIA.REDUCE_INSTRUMENTED_FILE_SIZE);
|
|
47787
47807
|
};
|
|
47788
|
-
class_1.minifyInstrumentedOutput = function () { return
|
|
47789
|
-
class_1.inProcessInstrumentation = function () { return
|
|
47808
|
+
class_1.minifyInstrumentedOutput = function () { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.CIA.MINIFY_INSTRUMENTED_OUTPUT); };
|
|
47809
|
+
class_1.inProcessInstrumentation = function () { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.CIA.IN_PROCESS_INSTRUMENTATION); };
|
|
47790
47810
|
class_1.getMaxBuffer = function () {
|
|
47791
47811
|
var oneMB = 1024 * 1024;
|
|
47792
|
-
var bufferInBytes =
|
|
47812
|
+
var bufferInBytes = env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.CIA.MAX_BUFFER);
|
|
47793
47813
|
if (bufferInBytes !== null) {
|
|
47794
47814
|
return bufferInBytes * oneMB;
|
|
47795
47815
|
}
|
|
@@ -47813,7 +47833,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
47813
47833
|
});
|
|
47814
47834
|
|
|
47815
47835
|
}).call(this)}).call(this,require('_process'))
|
|
47816
|
-
},{"../utils/parsing
|
|
47836
|
+
},{"../utils/env-var-parsing":334,"_process":179}],306:[function(require,module,exports){
|
|
47817
47837
|
(function (factory) {
|
|
47818
47838
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
47819
47839
|
var v = factory(require, exports);
|
|
@@ -48147,7 +48167,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
48147
48167
|
}
|
|
48148
48168
|
});
|
|
48149
48169
|
|
|
48150
|
-
},{"../system-date":333,"../utils/files-utils":
|
|
48170
|
+
},{"../system-date":333,"../utils/files-utils":335,"./istanbul-unique-id-converter":308,"path":171}],310:[function(require,module,exports){
|
|
48151
48171
|
(function (factory) {
|
|
48152
48172
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
48153
48173
|
var v = factory(require, exports);
|
|
@@ -48339,7 +48359,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
48339
48359
|
exports.OriginalModuleLoader = OriginalModuleLoader;
|
|
48340
48360
|
});
|
|
48341
48361
|
|
|
48342
|
-
},{"../source-maps-utils":330,"../utils/files-utils":
|
|
48362
|
+
},{"../source-maps-utils":330,"../utils/files-utils":335,"../utils/validation-utils":337}],311:[function(require,module,exports){
|
|
48343
48363
|
(function (factory) {
|
|
48344
48364
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
48345
48365
|
var v = factory(require, exports);
|
|
@@ -49005,7 +49025,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
49005
49025
|
exports.BaseBrowserHitsConverter = BaseBrowserHitsConverter;
|
|
49006
49026
|
});
|
|
49007
49027
|
|
|
49008
|
-
},{"../../common/footprints-process-v6/hits-converter":319,"../utils/files-utils":
|
|
49028
|
+
},{"../../common/footprints-process-v6/hits-converter":319,"../utils/files-utils":335,"./location-formatter":321}],316:[function(require,module,exports){
|
|
49009
49029
|
(function (factory) {
|
|
49010
49030
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
49011
49031
|
var v = factory(require, exports);
|
|
@@ -49684,22 +49704,53 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49684
49704
|
});
|
|
49685
49705
|
};
|
|
49686
49706
|
FootprintsProcess.prototype.updateConfig = function (updatedCfg) {
|
|
49687
|
-
this
|
|
49688
|
-
|
|
49689
|
-
|
|
49690
|
-
|
|
49691
|
-
|
|
49707
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49708
|
+
return __generator(this, function (_a) {
|
|
49709
|
+
switch (_a.label) {
|
|
49710
|
+
case 0:
|
|
49711
|
+
this.cfg = updatedCfg;
|
|
49712
|
+
return [4, this.stopIfNeededAfterConfigChanged(updatedCfg)];
|
|
49713
|
+
case 1:
|
|
49714
|
+
_a.sent();
|
|
49715
|
+
this.sendToServerWatchdog.setInterval(this.cfg.footprintsSendIntervalSecs.value);
|
|
49716
|
+
this.footprintsBuffer.agentConfig = updatedCfg;
|
|
49717
|
+
return [2];
|
|
49718
|
+
}
|
|
49692
49719
|
});
|
|
49693
|
-
}
|
|
49694
|
-
|
|
49695
|
-
|
|
49720
|
+
});
|
|
49721
|
+
};
|
|
49722
|
+
FootprintsProcess.prototype.stopIfNeededAfterConfigChanged = function (updatedCfg) {
|
|
49723
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49724
|
+
var e_1;
|
|
49725
|
+
return __generator(this, function (_a) {
|
|
49726
|
+
switch (_a.label) {
|
|
49727
|
+
case 0:
|
|
49728
|
+
if (!(updatedCfg.sendFootprints.value === false || updatedCfg.enabled.value === false)) return [3, 4];
|
|
49729
|
+
cockpit_notifier_1.CockpitNotifier.sendEvent(agent_events_conracts_1.AgentEventCode.AGENT_MUTED);
|
|
49730
|
+
this.footprintsBuffer.resetState();
|
|
49731
|
+
_a.label = 1;
|
|
49732
|
+
case 1:
|
|
49733
|
+
_a.trys.push([1, 3, , 4]);
|
|
49734
|
+
return [4, this.stop()];
|
|
49735
|
+
case 2:
|
|
49736
|
+
_a.sent();
|
|
49737
|
+
return [3, 4];
|
|
49738
|
+
case 3:
|
|
49739
|
+
e_1 = _a.sent();
|
|
49740
|
+
this.logger.error("Error stopping footprints process " + e_1.message);
|
|
49741
|
+
this.logger.debug(e_1.stackTrace);
|
|
49742
|
+
return [3, 4];
|
|
49743
|
+
case 4: return [2];
|
|
49744
|
+
}
|
|
49745
|
+
});
|
|
49746
|
+
});
|
|
49696
49747
|
};
|
|
49697
49748
|
FootprintsProcess.prototype.ensureKeepaliveThreadRunning = function () {
|
|
49698
49749
|
this.keepaliveWatchdog.start();
|
|
49699
49750
|
};
|
|
49700
49751
|
FootprintsProcess.prototype.submitQueuedFootprints = function (execution) {
|
|
49701
49752
|
return __awaiter(this, void 0, void 0, function () {
|
|
49702
|
-
var packet,
|
|
49753
|
+
var packet, e_2;
|
|
49703
49754
|
return __generator(this, function (_a) {
|
|
49704
49755
|
switch (_a.label) {
|
|
49705
49756
|
case 0:
|
|
@@ -49718,8 +49769,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49718
49769
|
this.logger.info("Footprints packet submitted successfully. packet contains " + packet.methods.length + " methods, " + packet.branches.length + " branches in " + packet.executions.length + " executions");
|
|
49719
49770
|
return [3, 5];
|
|
49720
49771
|
case 3:
|
|
49721
|
-
|
|
49722
|
-
this.logger.error("Error while submitting footprints '" +
|
|
49772
|
+
e_2 = _a.sent();
|
|
49773
|
+
this.logger.error("Error while submitting footprints '" + e_2 + "'");
|
|
49723
49774
|
cockpit_notifier_1.CockpitNotifier.sendEvent(agent_events_conracts_1.AgentEventCode.FOOTPRINTS_LOSS);
|
|
49724
49775
|
return [3, 5];
|
|
49725
49776
|
case 4:
|
|
@@ -49756,26 +49807,43 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49756
49807
|
this.ensureKeepaliveThreadRunning();
|
|
49757
49808
|
}
|
|
49758
49809
|
};
|
|
49759
|
-
FootprintsProcess.prototype.stop = function (
|
|
49760
|
-
|
|
49761
|
-
|
|
49762
|
-
|
|
49763
|
-
|
|
49764
|
-
|
|
49765
|
-
|
|
49766
|
-
|
|
49767
|
-
|
|
49768
|
-
|
|
49769
|
-
|
|
49770
|
-
|
|
49771
|
-
|
|
49772
|
-
|
|
49773
|
-
|
|
49774
|
-
|
|
49775
|
-
|
|
49776
|
-
|
|
49777
|
-
|
|
49778
|
-
|
|
49810
|
+
FootprintsProcess.prototype.stop = function () {
|
|
49811
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49812
|
+
var packet, e_3;
|
|
49813
|
+
return __generator(this, function (_a) {
|
|
49814
|
+
switch (_a.label) {
|
|
49815
|
+
case 0:
|
|
49816
|
+
this.sendToServerWatchdog.stop();
|
|
49817
|
+
if (!this.shouldSubmitFootprints()) {
|
|
49818
|
+
this.isRunning = false;
|
|
49819
|
+
return [2];
|
|
49820
|
+
}
|
|
49821
|
+
return [4, this.flushCurrentFootprints(true)];
|
|
49822
|
+
case 1:
|
|
49823
|
+
_a.sent();
|
|
49824
|
+
packet = this.footprintsBuffer.createPacket();
|
|
49825
|
+
this.isRunning = false;
|
|
49826
|
+
if (!packet) {
|
|
49827
|
+
this.logger.info('No hits collected, nothing to submit');
|
|
49828
|
+
return [2];
|
|
49829
|
+
}
|
|
49830
|
+
this.logger.info('Start submitting footprints, triggered by stop event.');
|
|
49831
|
+
_a.label = 2;
|
|
49832
|
+
case 2:
|
|
49833
|
+
_a.trys.push([2, 4, , 5]);
|
|
49834
|
+
return [4, this.backendProxy.submitFootprintsV6(packet, this.currentExecutionBsid, this.stateTracker.getTestStage(), this.cfg.buildSessionId.value)];
|
|
49835
|
+
case 3:
|
|
49836
|
+
_a.sent();
|
|
49837
|
+
this.logger.info('Final footprints submitted successfully');
|
|
49838
|
+
return [3, 5];
|
|
49839
|
+
case 4:
|
|
49840
|
+
e_3 = _a.sent();
|
|
49841
|
+
this.logger.error("Failed to submit final footprints, error: " + e_3.message);
|
|
49842
|
+
this.logger.debug(e_3);
|
|
49843
|
+
return [2];
|
|
49844
|
+
case 5: return [2];
|
|
49845
|
+
}
|
|
49846
|
+
});
|
|
49779
49847
|
});
|
|
49780
49848
|
};
|
|
49781
49849
|
FootprintsProcess.prototype.handleTestIdChanged = function (newTestIdentifier, previousTestIdentifier) {
|
|
@@ -49840,20 +49908,34 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49840
49908
|
};
|
|
49841
49909
|
FootprintsProcess.prototype.flushCurrentFootprints = function (isFinalFootprints) {
|
|
49842
49910
|
if (isFinalFootprints === void 0) { isFinalFootprints = false; }
|
|
49843
|
-
|
|
49844
|
-
|
|
49845
|
-
|
|
49846
|
-
|
|
49847
|
-
|
|
49848
|
-
|
|
49849
|
-
|
|
49850
|
-
|
|
49851
|
-
|
|
49852
|
-
|
|
49853
|
-
|
|
49854
|
-
|
|
49855
|
-
|
|
49856
|
-
|
|
49911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
49912
|
+
var currentTestIdentifier, testIdentifierParts;
|
|
49913
|
+
return __generator(this, function (_a) {
|
|
49914
|
+
switch (_a.label) {
|
|
49915
|
+
case 0:
|
|
49916
|
+
currentTestIdentifier = this.stateTracker.getCurrentTestIdentifier();
|
|
49917
|
+
if (!currentTestIdentifier) return [3, 2];
|
|
49918
|
+
testIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(currentTestIdentifier);
|
|
49919
|
+
this.logger.debug('Enqueue footprints interval - start enqueuing process. currentTestIdentifier: \'%s\'', currentTestIdentifier);
|
|
49920
|
+
return [4, this.enqueueCurrentFootprints(this.stateTracker.currentExecution, testIdentifierParts.testName, isFinalFootprints)];
|
|
49921
|
+
case 1:
|
|
49922
|
+
_a.sent();
|
|
49923
|
+
return [3, 5];
|
|
49924
|
+
case 2:
|
|
49925
|
+
if (!this.stateTracker.shouldCollectHits()) return [3, 4];
|
|
49926
|
+
this.logger.debug('Enqueue footprints interval - start enqueuing process. anonymous footprints');
|
|
49927
|
+
return [4, this.enqueueCurrentFootprints(this.stateTracker.currentExecution, null, isFinalFootprints)];
|
|
49928
|
+
case 3:
|
|
49929
|
+
_a.sent();
|
|
49930
|
+
return [3, 5];
|
|
49931
|
+
case 4:
|
|
49932
|
+
this.logger.info('Enqueue footprints interval - no active execution. skip enqueuing process.');
|
|
49933
|
+
this.handleNoExecutionFound();
|
|
49934
|
+
_a.label = 5;
|
|
49935
|
+
case 5: return [2];
|
|
49936
|
+
}
|
|
49937
|
+
});
|
|
49938
|
+
});
|
|
49857
49939
|
};
|
|
49858
49940
|
FootprintsProcess.prototype.handleNoExecutionFound = function () {
|
|
49859
49941
|
if (this.stateTracker.openExecutionFoundOnce) {
|
|
@@ -50641,7 +50723,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50641
50723
|
if (v !== undefined) module.exports = v;
|
|
50642
50724
|
}
|
|
50643
50725
|
else if (typeof define === "function" && define.amd) {
|
|
50644
|
-
define(["require", "exports", "./contracts", "request", "zlib", "
|
|
50726
|
+
define(["require", "exports", "./contracts", "request", "zlib", "../constants/sl-env-vars", "./http-verb", "../utils/validation-utils"], factory);
|
|
50645
50727
|
}
|
|
50646
50728
|
})(function (require, exports) {
|
|
50647
50729
|
"use strict";
|
|
@@ -50650,7 +50732,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50650
50732
|
var contracts_1 = require("./contracts");
|
|
50651
50733
|
var request = require("request");
|
|
50652
50734
|
var zlib = require("zlib");
|
|
50653
|
-
var uuid = require("uuid/v1");
|
|
50654
50735
|
var sl_env_vars_1 = require("../constants/sl-env-vars");
|
|
50655
50736
|
var http_verb_1 = require("./http-verb");
|
|
50656
50737
|
var validation_utils_1 = require("../utils/validation-utils");
|
|
@@ -50683,9 +50764,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50683
50764
|
var reportFile = requestData.reportFile;
|
|
50684
50765
|
try {
|
|
50685
50766
|
var opts = this.createDefaultOptions(urlPath);
|
|
50686
|
-
var
|
|
50687
|
-
|
|
50688
|
-
|
|
50767
|
+
var onRequestCallback = this.createOnRequestCallback({
|
|
50768
|
+
httpVerb: http_verb_1.HttpVerb.POST,
|
|
50769
|
+
callback: callback,
|
|
50770
|
+
});
|
|
50771
|
+
this.logger.info("Sending " + http_verb_1.HttpVerb.POST + " request. Url: '" + opts.url + "'");
|
|
50689
50772
|
var req = request.post(opts, onRequestCallback);
|
|
50690
50773
|
var form = req.form();
|
|
50691
50774
|
form.append('file', JSON.stringify(agentData), {
|
|
@@ -50735,9 +50818,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50735
50818
|
opts.headers[header] = additionalHeaders[header];
|
|
50736
50819
|
}
|
|
50737
50820
|
}
|
|
50738
|
-
var
|
|
50739
|
-
|
|
50740
|
-
|
|
50821
|
+
var onRequestCallback = this.createOnRequestCallback({
|
|
50822
|
+
httpVerb: httpVerb,
|
|
50823
|
+
callback: callback,
|
|
50824
|
+
isNotFoundAcceptable: isNotFoundAcceptable,
|
|
50825
|
+
});
|
|
50826
|
+
this.logger.info("Sending " + httpVerb + " request. Url: '" + opts.url + "'");
|
|
50741
50827
|
if (httpVerb === http_verb_1.HttpVerb.GET) {
|
|
50742
50828
|
opts.json = true;
|
|
50743
50829
|
request.get(opts, onRequestCallback);
|
|
@@ -50765,16 +50851,16 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50765
50851
|
return callback(err, null, null);
|
|
50766
50852
|
}
|
|
50767
50853
|
};
|
|
50768
|
-
HttpClient.prototype.createOnRequestCallback = function (
|
|
50854
|
+
HttpClient.prototype.createOnRequestCallback = function (_a) {
|
|
50769
50855
|
var _this = this;
|
|
50770
|
-
|
|
50856
|
+
var httpVerb = _a.httpVerb, callback = _a.callback, isNotFoundAcceptable = _a.isNotFoundAcceptable;
|
|
50771
50857
|
var handler = function (err, requestResponse, body) {
|
|
50772
50858
|
var txId = requestResponse && requestResponse.headers && requestResponse.headers['x-sl-txid'];
|
|
50773
50859
|
if (err || ((requestResponse != null) && (requestResponse.statusCode < 200 || requestResponse.statusCode >= 400))) {
|
|
50774
50860
|
var statusCode = -1;
|
|
50775
50861
|
if (requestResponse != null) {
|
|
50776
50862
|
statusCode = requestResponse.statusCode;
|
|
50777
|
-
_this.logger.warn("Got " + statusCode + " in '" + httpVerb + "' request.
|
|
50863
|
+
_this.logger.warn("Got " + statusCode + " in '" + httpVerb + "' request. Transaction ID:'" + txId + "'.");
|
|
50778
50864
|
}
|
|
50779
50865
|
if (err) {
|
|
50780
50866
|
err = new Error("HttpClient failed. Error: " + err.message + ", StatusCode: " + statusCode + ", Stack: " + err.stack);
|
|
@@ -50792,13 +50878,13 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50792
50878
|
}).join('');
|
|
50793
50879
|
}
|
|
50794
50880
|
catch (e) {
|
|
50795
|
-
errorMessage += "
|
|
50881
|
+
errorMessage += "Parsing of server response failed, body: " + body + ", transaction ID:'" + txId + "', error: " + e;
|
|
50796
50882
|
}
|
|
50797
50883
|
err = new Error(errorMessage);
|
|
50798
50884
|
}
|
|
50799
50885
|
return callback(err, body, statusCode);
|
|
50800
50886
|
}
|
|
50801
|
-
_this.logger.debug("'" + httpVerb + "' request was completed successfully.
|
|
50887
|
+
_this.logger.debug("'" + httpVerb + "' request was completed successfully. statusCode: " + requestResponse.statusCode + " body: " + body + ", Transaction ID: " + txId);
|
|
50802
50888
|
if (body && body.length > 0 && typeof body == 'string') {
|
|
50803
50889
|
try {
|
|
50804
50890
|
body = JSON.parse(body);
|
|
@@ -50846,7 +50932,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
50846
50932
|
});
|
|
50847
50933
|
|
|
50848
50934
|
}).call(this)}).call(this,require('_process'),require("buffer").Buffer)
|
|
50849
|
-
},{"../constants/sl-env-vars":305,"../utils/validation-utils":337,"./contracts":325,"./http-verb":328,"_process":179,"buffer":71,"request":454,"
|
|
50935
|
+
},{"../constants/sl-env-vars":305,"../utils/validation-utils":337,"./contracts":325,"./http-verb":328,"_process":179,"buffer":71,"request":454,"zlib":68}],328:[function(require,module,exports){
|
|
50850
50936
|
(function (factory) {
|
|
50851
50937
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
50852
50938
|
var v = factory(require, exports);
|
|
@@ -51400,18 +51486,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51400
51486
|
this.isRunning = true;
|
|
51401
51487
|
}
|
|
51402
51488
|
};
|
|
51403
|
-
StateTracker.prototype.stop = function (
|
|
51489
|
+
StateTracker.prototype.stop = function () {
|
|
51404
51490
|
try {
|
|
51405
51491
|
if (!this.isRunning) {
|
|
51406
|
-
return
|
|
51492
|
+
return;
|
|
51407
51493
|
}
|
|
51408
51494
|
this.checkTestStatusWatchdog.stop();
|
|
51409
51495
|
this.isRunning = false;
|
|
51410
|
-
callback();
|
|
51411
51496
|
}
|
|
51412
51497
|
catch (err) {
|
|
51413
51498
|
this.logger.error("Error while stopping StateTracker. '" + err + "'");
|
|
51414
|
-
return
|
|
51499
|
+
return;
|
|
51415
51500
|
}
|
|
51416
51501
|
};
|
|
51417
51502
|
StateTracker.prototype.getTestStage = function () {
|
|
@@ -51538,6 +51623,49 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51538
51623
|
});
|
|
51539
51624
|
|
|
51540
51625
|
},{}],334:[function(require,module,exports){
|
|
51626
|
+
(function (process){(function (){
|
|
51627
|
+
(function (factory) {
|
|
51628
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
51629
|
+
var v = factory(require, exports);
|
|
51630
|
+
if (v !== undefined) module.exports = v;
|
|
51631
|
+
}
|
|
51632
|
+
else if (typeof define === "function" && define.amd) {
|
|
51633
|
+
define(["require", "exports"], factory);
|
|
51634
|
+
}
|
|
51635
|
+
})(function (require, exports) {
|
|
51636
|
+
"use strict";
|
|
51637
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51638
|
+
exports.EnvVarParsing = void 0;
|
|
51639
|
+
var EnvVarParsing = (function () {
|
|
51640
|
+
function EnvVarParsing() {
|
|
51641
|
+
}
|
|
51642
|
+
EnvVarParsing.parseNumber = function (key) {
|
|
51643
|
+
var valueFromEnv = process.env[key];
|
|
51644
|
+
if (valueFromEnv != null) {
|
|
51645
|
+
var valueAsNumber = Number.parseFloat(valueFromEnv);
|
|
51646
|
+
if (!isNaN(valueAsNumber)) {
|
|
51647
|
+
valueFromEnv = valueAsNumber;
|
|
51648
|
+
}
|
|
51649
|
+
else {
|
|
51650
|
+
valueFromEnv = null;
|
|
51651
|
+
}
|
|
51652
|
+
}
|
|
51653
|
+
return valueFromEnv;
|
|
51654
|
+
};
|
|
51655
|
+
EnvVarParsing.parseBoolean = function (key) {
|
|
51656
|
+
var valueFromEnv = process.env[key];
|
|
51657
|
+
if (valueFromEnv != null && typeof (valueFromEnv) == 'string') {
|
|
51658
|
+
valueFromEnv = valueFromEnv.toLowerCase();
|
|
51659
|
+
}
|
|
51660
|
+
return valueFromEnv == 'true';
|
|
51661
|
+
};
|
|
51662
|
+
return EnvVarParsing;
|
|
51663
|
+
}());
|
|
51664
|
+
exports.EnvVarParsing = EnvVarParsing;
|
|
51665
|
+
});
|
|
51666
|
+
|
|
51667
|
+
}).call(this)}).call(this,require('_process'))
|
|
51668
|
+
},{"_process":179}],335:[function(require,module,exports){
|
|
51541
51669
|
(function (factory) {
|
|
51542
51670
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
51543
51671
|
var v = factory(require, exports);
|
|
@@ -51594,50 +51722,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51594
51722
|
exports.FilesUtils = FilesUtils;
|
|
51595
51723
|
});
|
|
51596
51724
|
|
|
51597
|
-
},{"fs":69,"path":171}],
|
|
51598
|
-
(function (process){(function (){
|
|
51599
|
-
(function (factory) {
|
|
51600
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
51601
|
-
var v = factory(require, exports);
|
|
51602
|
-
if (v !== undefined) module.exports = v;
|
|
51603
|
-
}
|
|
51604
|
-
else if (typeof define === "function" && define.amd) {
|
|
51605
|
-
define(["require", "exports"], factory);
|
|
51606
|
-
}
|
|
51607
|
-
})(function (require, exports) {
|
|
51608
|
-
"use strict";
|
|
51609
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51610
|
-
exports.ParsingUtils = void 0;
|
|
51611
|
-
var ParsingUtils = (function () {
|
|
51612
|
-
function ParsingUtils() {
|
|
51613
|
-
}
|
|
51614
|
-
ParsingUtils.parseNumber = function (key) {
|
|
51615
|
-
var valueFromEnv = process.env[key];
|
|
51616
|
-
if (valueFromEnv != null) {
|
|
51617
|
-
var valueAsNumber = Number.parseFloat(valueFromEnv);
|
|
51618
|
-
if (!isNaN(valueAsNumber)) {
|
|
51619
|
-
valueFromEnv = valueAsNumber;
|
|
51620
|
-
}
|
|
51621
|
-
else {
|
|
51622
|
-
valueFromEnv = null;
|
|
51623
|
-
}
|
|
51624
|
-
}
|
|
51625
|
-
return valueFromEnv;
|
|
51626
|
-
};
|
|
51627
|
-
ParsingUtils.parseBoolean = function (key) {
|
|
51628
|
-
var valueFromEnv = process.env[key];
|
|
51629
|
-
if (valueFromEnv != null && typeof (valueFromEnv) == 'string') {
|
|
51630
|
-
valueFromEnv = valueFromEnv.toLowerCase();
|
|
51631
|
-
}
|
|
51632
|
-
return valueFromEnv == 'true';
|
|
51633
|
-
};
|
|
51634
|
-
return ParsingUtils;
|
|
51635
|
-
}());
|
|
51636
|
-
exports.ParsingUtils = ParsingUtils;
|
|
51637
|
-
});
|
|
51638
|
-
|
|
51639
|
-
}).call(this)}).call(this,require('_process'))
|
|
51640
|
-
},{"_process":179}],336:[function(require,module,exports){
|
|
51725
|
+
},{"fs":69,"path":171}],336:[function(require,module,exports){
|
|
51641
51726
|
(function (factory) {
|
|
51642
51727
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
51643
51728
|
var v = factory(require, exports);
|