slnodejs 6.1.410 → 6.1.429

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 (431) hide show
  1. package/browser-agent/dist/browser-agent-all.js +33 -28
  2. package/browser-agent/dist/browser-agent-all.min.js +2 -2
  3. package/browser-agent/package.json +1 -1
  4. package/package.json +2 -2
  5. package/tsOutputs/api.js +32 -86
  6. package/tsOutputs/build-scanner/ast-utils.js +11 -11
  7. package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
  8. package/tsOutputs/build-scanner/build-diff-process.js +36 -16
  9. package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
  10. package/tsOutputs/build-scanner/cia.js +2 -2
  11. package/tsOutputs/build-scanner/cia.js.map +1 -1
  12. package/tsOutputs/build-scanner/default-values-resolver.js +5 -7
  13. package/tsOutputs/build-scanner/default-values-resolver.js.map +1 -1
  14. package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js +101 -159
  15. package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js.map +1 -1
  16. package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js +23 -55
  17. package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js.map +1 -1
  18. package/tsOutputs/build-scanner/file-and-folder-utils.js +3 -3
  19. package/tsOutputs/build-scanner/file-and-folder-utils.js.map +1 -1
  20. package/tsOutputs/build-scanner/file-system/actual-file.js +3 -3
  21. package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
  22. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +57 -60
  23. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
  24. package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js +9 -10
  25. package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js.map +1 -1
  26. package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js +80 -124
  27. package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js.map +1 -1
  28. package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +3 -3
  29. package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js.map +1 -1
  30. package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +4 -4
  31. package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js.map +1 -1
  32. package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js +15 -50
  33. package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js.map +1 -1
  34. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +84 -141
  35. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
  36. package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js +15 -34
  37. package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js.map +1 -1
  38. package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js +9 -27
  39. package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -1
  40. package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js +8 -10
  41. package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js.map +1 -1
  42. package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js +22 -54
  43. package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js.map +1 -1
  44. package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js +55 -107
  45. package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js.map +1 -1
  46. package/tsOutputs/build-scanner/js_diff/file-signature.js +5 -6
  47. package/tsOutputs/build-scanner/js_diff/file-signature.js.map +1 -1
  48. package/tsOutputs/build-scanner/js_diff/files-mapping.js +6 -6
  49. package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
  50. package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +3 -3
  51. package/tsOutputs/build-scanner/js_diff/generated-file-signature.js.map +1 -1
  52. package/tsOutputs/build-scanner/js_diff/guess-method-location.js +26 -27
  53. package/tsOutputs/build-scanner/js_diff/guess-method-location.js.map +1 -1
  54. package/tsOutputs/build-scanner/js_diff/method-signature.js +1 -1
  55. package/tsOutputs/build-scanner/js_diff/method-signature.js.map +1 -1
  56. package/tsOutputs/build-scanner/js_diff/sl-mapper.js +28 -79
  57. package/tsOutputs/build-scanner/js_diff/sl-mapper.js.map +1 -1
  58. package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +3 -2
  59. package/tsOutputs/build-scanner/js_diff/source-data-enricher.js.map +1 -1
  60. package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +1 -1
  61. package/tsOutputs/build-scanner/js_diff/source-files-notifier.js.map +1 -1
  62. package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +76 -149
  63. package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
  64. package/tsOutputs/build-scanner/mappings/file-element-utils.js +9 -9
  65. package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
  66. package/tsOutputs/build-scanner/mappings/file-enricher.js +71 -100
  67. package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
  68. package/tsOutputs/build-scanner/mappings/file-path-fixer.js +106 -0
  69. package/tsOutputs/build-scanner/mappings/file-path-fixer.js.map +1 -0
  70. package/tsOutputs/build-scanner/mappings/files-container.js +89 -0
  71. package/tsOutputs/build-scanner/mappings/files-container.js.map +1 -0
  72. package/tsOutputs/build-scanner/mappings/files-data-container.js +18 -23
  73. package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
  74. package/tsOutputs/build-scanner/mappings/source-path-mapper.js +15 -45
  75. package/tsOutputs/build-scanner/mappings/source-path-mapper.js.map +1 -1
  76. package/tsOutputs/build-scanner/markup-files-parser.js +1 -1
  77. package/tsOutputs/build-scanner/markup-files-parser.js.map +1 -1
  78. package/tsOutputs/build-scanner/scm/scm-file-fixer.js +27 -0
  79. package/tsOutputs/build-scanner/scm/scm-file-fixer.js.map +1 -0
  80. package/tsOutputs/build-scanner/scm/scm-files-container.js +9 -45
  81. package/tsOutputs/build-scanner/scm/scm-files-container.js.map +1 -1
  82. package/tsOutputs/build-scanner/sl-config-cia-cli.js +1 -1
  83. package/tsOutputs/build-scanner/sl-config-cia-cli.js.map +1 -1
  84. package/tsOutputs/build-scanner/utils.js +5 -5
  85. package/tsOutputs/build-scanner/utils.js.map +1 -1
  86. package/tsOutputs/cli-parse/agent-instance-data.js +2 -2
  87. package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
  88. package/tsOutputs/cli-parse/child-process-wrapper.js +26 -60
  89. package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
  90. package/tsOutputs/cli-parse/cli.js +74 -191
  91. package/tsOutputs/cli-parse/cli.js.map +1 -1
  92. package/tsOutputs/cli-parse/constants/constants.js +9 -9
  93. package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
  94. package/tsOutputs/cli-parse/contracts.d.ts +2 -0
  95. package/tsOutputs/cli-parse/contracts.js.map +1 -1
  96. package/tsOutputs/cli-parse/custom-commander.js +17 -18
  97. package/tsOutputs/cli-parse/custom-commander.js.map +1 -1
  98. package/tsOutputs/cli-parse/executors/base-executor.js +121 -236
  99. package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
  100. package/tsOutputs/cli-parse/executors/build-args-dto.js +11 -11
  101. package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
  102. package/tsOutputs/cli-parse/executors/build-end-executor.js +34 -92
  103. package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
  104. package/tsOutputs/cli-parse/executors/build-executor.js +68 -132
  105. package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
  106. package/tsOutputs/cli-parse/executors/config-executor.js +35 -92
  107. package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
  108. package/tsOutputs/cli-parse/executors/dry-run/base-data.js +29 -39
  109. package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
  110. package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +92 -177
  111. package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js.map +1 -1
  112. package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +110 -194
  113. package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
  114. package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js +49 -83
  115. package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
  116. package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +55 -113
  117. package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
  118. package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +24 -25
  119. package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
  120. package/tsOutputs/cli-parse/executors/end-execution-executor.js +16 -64
  121. package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
  122. package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +29 -82
  123. package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
  124. package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js +12 -59
  125. package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js.map +1 -1
  126. package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js +9 -58
  127. package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
  128. package/tsOutputs/cli-parse/executors/mocha-executor.js +41 -101
  129. package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
  130. package/tsOutputs/cli-parse/executors/nyc-report-executor.js +24 -83
  131. package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
  132. package/tsOutputs/cli-parse/executors/pr-config-executor.js +15 -63
  133. package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
  134. package/tsOutputs/cli-parse/executors/run-executor.js +23 -75
  135. package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
  136. package/tsOutputs/cli-parse/executors/start-execution-executor.js +16 -64
  137. package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
  138. package/tsOutputs/cli-parse/executors/test-executions-executor.js +9 -63
  139. package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
  140. package/tsOutputs/cli-parse/executors/test-listener-executor.js +47 -117
  141. package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
  142. package/tsOutputs/cli-parse/executors/upload-report-executor.js +23 -71
  143. package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
  144. package/tsOutputs/cli-parse/utils.js +10 -10
  145. package/tsOutputs/cli-parse/utils.js.map +1 -1
  146. package/tsOutputs/common/agent-events/agent-events-controller.js +146 -251
  147. package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
  148. package/tsOutputs/common/agent-events/agent-events-guard.js +12 -15
  149. package/tsOutputs/common/agent-events/agent-events-guard.js.map +1 -1
  150. package/tsOutputs/common/agent-events/agent-instance-info-builder.js +22 -24
  151. package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
  152. package/tsOutputs/common/agent-events/agent-start-info-builder.js +7 -8
  153. package/tsOutputs/common/agent-events/agent-start-info-builder.js.map +1 -1
  154. package/tsOutputs/common/agent-events/browser-info-builder.js +9 -10
  155. package/tsOutputs/common/agent-events/browser-info-builder.js.map +1 -1
  156. package/tsOutputs/common/agent-events/ci-info-builder.js +12 -13
  157. package/tsOutputs/common/agent-events/ci-info-builder.js.map +1 -1
  158. package/tsOutputs/common/agent-events/cockpit-notifier.js +38 -87
  159. package/tsOutputs/common/agent-events/cockpit-notifier.js.map +1 -1
  160. package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js +10 -27
  161. package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
  162. package/tsOutputs/common/agent-events/machine-info-builder.js +21 -22
  163. package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
  164. package/tsOutputs/common/agent-events/no-op-agent-events-controller.js +30 -84
  165. package/tsOutputs/common/agent-events/no-op-agent-events-controller.js.map +1 -1
  166. package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +7 -8
  167. package/tsOutputs/common/agent-events/nodejs-env-info-builder.js.map +1 -1
  168. package/tsOutputs/common/agent-events/sensitive-data-filter.js +3 -4
  169. package/tsOutputs/common/agent-events/sensitive-data-filter.js.map +1 -1
  170. package/tsOutputs/common/agent-instance-data.js +23 -28
  171. package/tsOutputs/common/agent-instance-data.js.map +1 -1
  172. package/tsOutputs/common/cli-progress.js +16 -19
  173. package/tsOutputs/common/cli-progress.js.map +1 -1
  174. package/tsOutputs/common/config-process/config-loader.js +23 -24
  175. package/tsOutputs/common/config-process/config-loader.js.map +1 -1
  176. package/tsOutputs/common/config-process/config-system.js +104 -131
  177. package/tsOutputs/common/config-process/config-system.js.map +1 -1
  178. package/tsOutputs/common/config-process/config.js +52 -73
  179. package/tsOutputs/common/config-process/config.js.map +1 -1
  180. package/tsOutputs/common/config-process/index.js +38 -57
  181. package/tsOutputs/common/config-process/index.js.map +1 -1
  182. package/tsOutputs/common/config-process/no-op-config-process.js +9 -29
  183. package/tsOutputs/common/config-process/no-op-config-process.js.map +1 -1
  184. package/tsOutputs/common/constants/constants.js +19 -25
  185. package/tsOutputs/common/constants/constants.js.map +1 -1
  186. package/tsOutputs/common/constants/sl-env-vars.js +125 -131
  187. package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
  188. package/tsOutputs/common/coverage-elements/file-element.js +66 -103
  189. package/tsOutputs/common/coverage-elements/file-element.js.map +1 -1
  190. package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +28 -47
  191. package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
  192. package/tsOutputs/common/coverage-elements/new-id-resolver.js +17 -17
  193. package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
  194. package/tsOutputs/common/coverage-elements/original-module-loader.js +71 -79
  195. package/tsOutputs/common/coverage-elements/original-module-loader.js.map +1 -1
  196. package/tsOutputs/common/coverage-elements/unique-id-converter.js +90 -110
  197. package/tsOutputs/common/coverage-elements/unique-id-converter.js.map +1 -1
  198. package/tsOutputs/common/environment-data-service.js +10 -11
  199. package/tsOutputs/common/environment-data-service.js.map +1 -1
  200. package/tsOutputs/common/events-process/events-creator.js +20 -32
  201. package/tsOutputs/common/events-process/events-creator.js.map +1 -1
  202. package/tsOutputs/common/events-process/index.js +97 -186
  203. package/tsOutputs/common/events-process/index.js.map +1 -1
  204. package/tsOutputs/common/footprints-process/collection-interval.js +10 -11
  205. package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
  206. package/tsOutputs/common/footprints-process/footprints-service-proxy.js +21 -22
  207. package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
  208. package/tsOutputs/common/footprints-process/index.js +68 -102
  209. package/tsOutputs/common/footprints-process/index.js.map +1 -1
  210. package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js +2 -5
  211. package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js.map +1 -1
  212. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +160 -162
  213. package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
  214. package/tsOutputs/common/footprints-process/production-footprints-handler.js +103 -156
  215. package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
  216. package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +30 -48
  217. package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
  218. package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js +7 -25
  219. package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js.map +1 -1
  220. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +13 -14
  221. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
  222. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +14 -32
  223. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
  224. package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js +43 -109
  225. package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js.map +1 -1
  226. package/tsOutputs/common/footprints-process-v6/contracts.js +2 -5
  227. package/tsOutputs/common/footprints-process-v6/contracts.js.map +1 -1
  228. package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +55 -78
  229. package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
  230. package/tsOutputs/common/footprints-process-v6/hits-collector.js +89 -129
  231. package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
  232. package/tsOutputs/common/footprints-process-v6/hits-converter.js +70 -78
  233. package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
  234. package/tsOutputs/common/footprints-process-v6/index.js +204 -347
  235. package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
  236. package/tsOutputs/common/footprints-process-v6/location-formatter.js +2 -2
  237. package/tsOutputs/common/footprints-process-v6/location-formatter.js.map +1 -1
  238. package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js +10 -11
  239. package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js.map +1 -1
  240. package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js +5 -25
  241. package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
  242. package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +6 -57
  243. package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
  244. package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js +7 -27
  245. package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
  246. package/tsOutputs/common/footprints-process-v6/source-map-data.js +14 -15
  247. package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
  248. package/tsOutputs/common/http/backend-proxy.js +222 -321
  249. package/tsOutputs/common/http/backend-proxy.js.map +1 -1
  250. package/tsOutputs/common/http/contracts.js +40 -116
  251. package/tsOutputs/common/http/contracts.js.map +1 -1
  252. package/tsOutputs/common/http/dry-run-proxy.js +68 -111
  253. package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
  254. package/tsOutputs/common/http/entities-mapper.js +6 -9
  255. package/tsOutputs/common/http/entities-mapper.js.map +1 -1
  256. package/tsOutputs/common/http/http-client.js +76 -86
  257. package/tsOutputs/common/http/http-client.js.map +1 -1
  258. package/tsOutputs/common/http/sl-routes.js +119 -122
  259. package/tsOutputs/common/http/sl-routes.js.map +1 -1
  260. package/tsOutputs/common/ignored-files-handler.js +48 -49
  261. package/tsOutputs/common/ignored-files-handler.js.map +1 -1
  262. package/tsOutputs/common/logger.js +66 -88
  263. package/tsOutputs/common/logger.js.map +1 -1
  264. package/tsOutputs/common/messages-formatter.js +9 -14
  265. package/tsOutputs/common/messages-formatter.js.map +1 -1
  266. package/tsOutputs/common/no-op-state-tracker.js +14 -37
  267. package/tsOutputs/common/no-op-state-tracker.js.map +1 -1
  268. package/tsOutputs/common/queue.js +18 -36
  269. package/tsOutputs/common/queue.js.map +1 -1
  270. package/tsOutputs/common/scm/git-cloner.js +30 -94
  271. package/tsOutputs/common/scm/git-cloner.js.map +1 -1
  272. package/tsOutputs/common/scm/git-format-builder.js +24 -25
  273. package/tsOutputs/common/scm/git-format-builder.js.map +1 -1
  274. package/tsOutputs/common/scm/git.js +192 -327
  275. package/tsOutputs/common/scm/git.js.map +1 -1
  276. package/tsOutputs/common/scm/none.js +58 -110
  277. package/tsOutputs/common/scm/none.js.map +1 -1
  278. package/tsOutputs/common/scm/scm-factory.js +6 -9
  279. package/tsOutputs/common/scm/scm-factory.js.map +1 -1
  280. package/tsOutputs/common/short-name-to-file-mapper.js +30 -33
  281. package/tsOutputs/common/short-name-to-file-mapper.js.map +1 -1
  282. package/tsOutputs/common/source-map-handler.js +76 -98
  283. package/tsOutputs/common/source-map-handler.js.map +1 -1
  284. package/tsOutputs/common/source-map-reader.js +35 -36
  285. package/tsOutputs/common/source-map-reader.js.map +1 -1
  286. package/tsOutputs/common/source-maps-utils.js +8 -11
  287. package/tsOutputs/common/source-maps-utils.js.map +1 -1
  288. package/tsOutputs/common/state-tracker-fpv6.js +15 -37
  289. package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
  290. package/tsOutputs/common/state-tracker.js +124 -212
  291. package/tsOutputs/common/state-tracker.js.map +1 -1
  292. package/tsOutputs/common/system-date.js +3 -3
  293. package/tsOutputs/common/system-date.js.map +1 -1
  294. package/tsOutputs/common/utils/abstract-data-builder.js +8 -9
  295. package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
  296. package/tsOutputs/common/utils/build-session-data-builder.js +25 -79
  297. package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
  298. package/tsOutputs/common/utils/dependency-utils.js +13 -16
  299. package/tsOutputs/common/utils/dependency-utils.js.map +1 -1
  300. package/tsOutputs/common/utils/env-var-parsing.js +10 -14
  301. package/tsOutputs/common/utils/env-var-parsing.js.map +1 -1
  302. package/tsOutputs/common/utils/files-utils.js +16 -19
  303. package/tsOutputs/common/utils/files-utils.js.map +1 -1
  304. package/tsOutputs/common/utils/process-utils.js +12 -25
  305. package/tsOutputs/common/utils/process-utils.js.map +1 -1
  306. package/tsOutputs/common/utils/test-runner-build-session-data-builder.js +16 -62
  307. package/tsOutputs/common/utils/test-runner-build-session-data-builder.js.map +1 -1
  308. package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +120 -192
  309. package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js.map +1 -1
  310. package/tsOutputs/common/utils/timer-utils.js +4 -7
  311. package/tsOutputs/common/utils/timer-utils.js.map +1 -1
  312. package/tsOutputs/common/utils/token-data-builder.js +30 -50
  313. package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
  314. package/tsOutputs/common/utils/validation-utils.js +7 -10
  315. package/tsOutputs/common/utils/validation-utils.js.map +1 -1
  316. package/tsOutputs/common/uuid.js +7 -10
  317. package/tsOutputs/common/uuid.js.map +1 -1
  318. package/tsOutputs/common/v8-utils.js +12 -50
  319. package/tsOutputs/common/v8-utils.js.map +1 -1
  320. package/tsOutputs/common/watchdog.js +35 -56
  321. package/tsOutputs/common/watchdog.js.map +1 -1
  322. package/tsOutputs/mocha-reporter/index.js +12 -12
  323. package/tsOutputs/mocha-reporter/index.js.map +1 -1
  324. package/tsOutputs/mocha-reporter/otel-agent.js +47 -118
  325. package/tsOutputs/mocha-reporter/otel-agent.js.map +1 -1
  326. package/tsOutputs/test-listener/SlNodeJsProxy.js +34 -35
  327. package/tsOutputs/test-listener/SlNodeJsProxy.js.map +1 -1
  328. package/tsOutputs/test-listener/UserMessageHelper.js +14 -19
  329. package/tsOutputs/test-listener/UserMessageHelper.js.map +1 -1
  330. package/tsOutputs/test-listener/agent-loader.js +42 -59
  331. package/tsOutputs/test-listener/agent-loader.js.map +1 -1
  332. package/tsOutputs/test-listener/agent.js +93 -150
  333. package/tsOutputs/test-listener/agent.js.map +1 -1
  334. package/tsOutputs/test-listener/api.js +36 -70
  335. package/tsOutputs/test-listener/api.js.map +1 -1
  336. package/tsOutputs/test-listener/base-proxy.js +25 -27
  337. package/tsOutputs/test-listener/base-proxy.js.map +1 -1
  338. package/tsOutputs/test-listener/bootstrap.js +6 -6
  339. package/tsOutputs/test-listener/bootstrap.js.map +1 -1
  340. package/tsOutputs/test-listener/child-process-patcher.js +10 -10
  341. package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
  342. package/tsOutputs/test-listener/cli.js +27 -30
  343. package/tsOutputs/test-listener/cli.js.map +1 -1
  344. package/tsOutputs/test-listener/coloring/http-coloring.js +30 -33
  345. package/tsOutputs/test-listener/coloring/http-coloring.js.map +1 -1
  346. package/tsOutputs/test-listener/coloring/listening-port.js +14 -17
  347. package/tsOutputs/test-listener/coloring/listening-port.js.map +1 -1
  348. package/tsOutputs/test-listener/command-line-arg-parser.js +12 -15
  349. package/tsOutputs/test-listener/command-line-arg-parser.js.map +1 -1
  350. package/tsOutputs/test-listener/config-process/config-loader.js +21 -22
  351. package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
  352. package/tsOutputs/test-listener/config-process/config-system.js +100 -127
  353. package/tsOutputs/test-listener/config-process/config-system.js.map +1 -1
  354. package/tsOutputs/test-listener/config-process/index.js +38 -57
  355. package/tsOutputs/test-listener/config-process/index.js.map +1 -1
  356. package/tsOutputs/test-listener/config.js +38 -59
  357. package/tsOutputs/test-listener/config.js.map +1 -1
  358. package/tsOutputs/test-listener/entities/BasicConfigurationData.js +37 -64
  359. package/tsOutputs/test-listener/entities/BasicConfigurationData.js.map +1 -1
  360. package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js +17 -42
  361. package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
  362. package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js +19 -45
  363. package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
  364. package/tsOutputs/test-listener/environment-data-service.js +10 -11
  365. package/tsOutputs/test-listener/environment-data-service.js.map +1 -1
  366. package/tsOutputs/test-listener/execution-process/entities-mapper.js +11 -14
  367. package/tsOutputs/test-listener/execution-process/entities-mapper.js.map +1 -1
  368. package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +54 -72
  369. package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
  370. package/tsOutputs/test-listener/execution-process/index.js +26 -26
  371. package/tsOutputs/test-listener/execution-process/index.js.map +1 -1
  372. package/tsOutputs/test-listener/factory.js +140 -175
  373. package/tsOutputs/test-listener/factory.js.map +1 -1
  374. package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js +17 -34
  375. package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js.map +1 -1
  376. package/tsOutputs/test-listener/footprints-process/index.js +53 -58
  377. package/tsOutputs/test-listener/footprints-process/index.js.map +1 -1
  378. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js +49 -50
  379. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js.map +1 -1
  380. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js +98 -117
  381. package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js.map +1 -1
  382. package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js +57 -141
  383. package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js.map +1 -1
  384. package/tsOutputs/test-listener/integrations/SlGulp.js +25 -26
  385. package/tsOutputs/test-listener/integrations/SlGulp.js.map +1 -1
  386. package/tsOutputs/test-listener/logs-process/index.js +30 -35
  387. package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
  388. package/tsOutputs/test-listener/logs-process/log-service-proxy.js +8 -25
  389. package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
  390. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +53 -110
  391. package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
  392. package/tsOutputs/test-listener/nyc-report-executor.js +48 -85
  393. package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
  394. package/tsOutputs/test-listener/otel-agent-loader.js +30 -33
  395. package/tsOutputs/test-listener/otel-agent-loader.js.map +1 -1
  396. package/tsOutputs/test-listener/queue.js +18 -36
  397. package/tsOutputs/test-listener/queue.js.map +1 -1
  398. package/tsOutputs/test-listener/remote-agent.js +97 -223
  399. package/tsOutputs/test-listener/remote-agent.js.map +1 -1
  400. package/tsOutputs/test-listener/resolvers/AppNameResolver.js +8 -25
  401. package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
  402. package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +11 -12
  403. package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
  404. package/tsOutputs/test-listener/resolvers/BuildResolver.js +8 -25
  405. package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
  406. package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js +8 -25
  407. package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
  408. package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js +8 -25
  409. package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
  410. package/tsOutputs/test-listener/resolvers/ProxyResolver.js +8 -25
  411. package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
  412. package/tsOutputs/test-listener/resolvers/TokenResolver.js +8 -25
  413. package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
  414. package/tsOutputs/test-listener/state-tracker-process/index.js +54 -74
  415. package/tsOutputs/test-listener/state-tracker-process/index.js.map +1 -1
  416. package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +18 -37
  417. package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
  418. package/tsOutputs/test-listener/test-recommendation-handler.js +66 -109
  419. package/tsOutputs/test-listener/test-recommendation-handler.js.map +1 -1
  420. package/tsOutputs/test-listener/upload-report-handler.js +33 -35
  421. package/tsOutputs/test-listener/upload-report-handler.js.map +1 -1
  422. package/tsOutputs/test-listener/utils.js +13 -14
  423. package/tsOutputs/test-listener/utils.js.map +1 -1
  424. package/tsOutputs/test-listener/uuid.js +7 -10
  425. package/tsOutputs/test-listener/uuid.js.map +1 -1
  426. package/tsOutputs/test-listener/wait-for-multiple-callbacks.js +17 -19
  427. package/tsOutputs/test-listener/wait-for-multiple-callbacks.js.map +1 -1
  428. package/tsOutputs/test-listener/watchdog.js +32 -51
  429. package/tsOutputs/test-listener/watchdog.js.map +1 -1
  430. package/tsOutputs/build-scanner/mappings/scm-file-fixer.js +0 -96
  431. package/tsOutputs/build-scanner/mappings/scm-file-fixer.js.map +0 -1
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -19,44 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
20
9
  });
21
10
  };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
11
  Object.defineProperty(exports, "__esModule", { value: true });
50
12
  exports.FootprintsProcess = void 0;
51
- var footprints_buffer_1 = require("./footprints-buffer");
52
- var collection_interval_1 = require("../footprints-process/collection-interval");
53
- var state_tracker_1 = require("../state-tracker");
54
- var cockpit_notifier_1 = require("../agent-events/cockpit-notifier");
55
- var agent_events_contracts_1 = require("../agent-events/agent-events-contracts");
56
- var sl_env_vars_1 = require("../constants/sl-env-vars");
57
- var agent_events_guard_1 = require("../agent-events/agent-events-guard");
58
- var FootprintsProcess = /** @class */ (function () {
59
- function FootprintsProcess(cfg, sendToServerWatchdog, keepaliveWatchdog, logger, hitsCollector, hitsConverter, footprintsBuffer, backendProxy, stateTracker) {
13
+ const footprints_buffer_1 = require("./footprints-buffer");
14
+ const collection_interval_1 = require("../footprints-process/collection-interval");
15
+ const state_tracker_1 = require("../state-tracker");
16
+ const cockpit_notifier_1 = require("../agent-events/cockpit-notifier");
17
+ const agent_events_contracts_1 = require("../agent-events/agent-events-contracts");
18
+ const sl_env_vars_1 = require("../constants/sl-env-vars");
19
+ const agent_events_guard_1 = require("../agent-events/agent-events-guard");
20
+ class FootprintsProcess {
21
+ constructor(cfg, sendToServerWatchdog, keepaliveWatchdog, logger, hitsCollector, hitsConverter, footprintsBuffer, backendProxy, stateTracker) {
60
22
  this.isRunning = false;
61
23
  this._ongoingRequestsCounter = 0;
62
24
  this.footprintsEnqueueOnce = false;
@@ -72,120 +34,79 @@ var FootprintsProcess = /** @class */ (function () {
72
34
  this.logger = logger;
73
35
  this.delegateEvents();
74
36
  }
75
- FootprintsProcess.prototype.enqueueCurrentFootprints = function (execution, testName, isFinalFootprints) {
76
- if (isFinalFootprints === void 0) { isFinalFootprints = false; }
77
- return __awaiter(this, void 0, void 0, function () {
78
- var hitFilesData, convertedHits;
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
81
- case 0:
82
- this.currentExecutionBsid = execution.buildSessionId;
83
- this.collectionInterval.next();
84
- return [4 /*yield*/, this.hitsCollector.getHitElements()];
85
- case 1:
86
- hitFilesData = _a.sent();
87
- if (hitFilesData.length) {
88
- this.logger.info("Collecting hits for '".concat(hitFilesData.length, "' files"));
89
- convertedHits = this.hitsConverter.convertHits(hitFilesData);
90
- this.footprintsBuffer.addHit(convertedHits, this.collectionInterval.toJson(), execution.executionId, testName, this.isInitFootprints(), isFinalFootprints);
91
- }
92
- else {
93
- this.logger.info('No files were hits, not collecting footprints');
94
- }
95
- if (this.isRunning && this.cfg.sendFootprints.value && this.cfg.enabled.value) {
96
- this.ensureKeepaliveThreadRunning();
97
- this.sendToServerWatchdog.startIfNotRunning();
98
- }
99
- this.footprintsEnqueueOnce = true;
100
- return [2 /*return*/];
101
- }
102
- });
37
+ enqueueCurrentFootprints(execution, testName, isFinalFootprints = false) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ this.currentExecutionBsid = execution.buildSessionId;
40
+ this.collectionInterval.next();
41
+ const hitFilesData = yield this.hitsCollector.getHitElements();
42
+ if (hitFilesData.length) {
43
+ this.logger.info(`Collecting hits for '${hitFilesData.length}' files`);
44
+ const convertedHits = this.hitsConverter.convertHits(hitFilesData);
45
+ this.footprintsBuffer.addHit(convertedHits, this.collectionInterval.toJson(), execution.executionId, testName, this.isInitFootprints(), isFinalFootprints);
46
+ }
47
+ else {
48
+ this.logger.info('No files were hits, not collecting footprints');
49
+ }
50
+ if (this.isRunning && this.cfg.sendFootprints.value && this.cfg.enabled.value) {
51
+ this.ensureKeepaliveThreadRunning();
52
+ this.sendToServerWatchdog.startIfNotRunning();
53
+ }
54
+ this.footprintsEnqueueOnce = true;
103
55
  });
104
- };
105
- FootprintsProcess.prototype.updateConfig = function (updatedCfg) {
106
- return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0:
110
- this.cfg = updatedCfg;
111
- return [4 /*yield*/, this.stopIfNeededAfterConfigChanged(updatedCfg)];
112
- case 1:
113
- _a.sent();
114
- this.sendToServerWatchdog.setInterval(this.cfg.footprintsSendIntervalSecs.value);
115
- this.footprintsBuffer.agentConfig = updatedCfg;
116
- return [2 /*return*/];
117
- }
118
- });
56
+ }
57
+ updateConfig(updatedCfg) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ this.cfg = updatedCfg;
60
+ yield this.stopIfNeededAfterConfigChanged(updatedCfg);
61
+ this.sendToServerWatchdog.setInterval(this.cfg.footprintsSendIntervalSecs.value);
62
+ this.footprintsBuffer.agentConfig = updatedCfg;
119
63
  });
120
- };
121
- FootprintsProcess.prototype.stopIfNeededAfterConfigChanged = function (updatedCfg) {
122
- return __awaiter(this, void 0, void 0, function () {
123
- var e_1;
124
- return __generator(this, function (_a) {
125
- switch (_a.label) {
126
- case 0:
127
- if (!(updatedCfg.sendFootprints.value === false || updatedCfg.enabled.value === false)) return [3 /*break*/, 4];
128
- cockpit_notifier_1.CockpitNotifier.sendEvent(agent_events_contracts_1.AgentEventCode.AGENT_MUTED);
129
- this.footprintsBuffer.resetState();
130
- _a.label = 1;
131
- case 1:
132
- _a.trys.push([1, 3, , 4]);
133
- return [4 /*yield*/, this.stop()];
134
- case 2:
135
- _a.sent();
136
- return [3 /*break*/, 4];
137
- case 3:
138
- e_1 = _a.sent();
139
- this.logger.error("Error stopping footprints process ".concat(e_1.message));
140
- this.logger.debug(e_1.stackTrace);
141
- return [3 /*break*/, 4];
142
- case 4: return [2 /*return*/];
64
+ }
65
+ stopIfNeededAfterConfigChanged(updatedCfg) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ if (updatedCfg.sendFootprints.value === false || updatedCfg.enabled.value === false) {
68
+ cockpit_notifier_1.CockpitNotifier.sendEvent(agent_events_contracts_1.AgentEventCode.AGENT_MUTED);
69
+ this.footprintsBuffer.resetState();
70
+ try {
71
+ yield this.stop();
143
72
  }
144
- });
73
+ catch (e) {
74
+ this.logger.error(`Error stopping footprints process ${e.message}`);
75
+ this.logger.debug(e.stackTrace);
76
+ }
77
+ }
145
78
  });
146
- };
147
- FootprintsProcess.prototype.ensureKeepaliveThreadRunning = function () {
79
+ }
80
+ ensureKeepaliveThreadRunning() {
148
81
  this.keepaliveWatchdog.start();
149
- };
150
- FootprintsProcess.prototype.submitQueuedFootprints = function (execution) {
151
- return __awaiter(this, void 0, void 0, function () {
152
- var packet, e_2;
153
- return __generator(this, function (_a) {
154
- switch (_a.label) {
155
- case 0:
156
- this.hitsCollector.sendErrors();
157
- if (!this.shouldSubmitFootprints()) {
158
- return [2 /*return*/];
159
- }
160
- packet = this.footprintsBuffer.createPacket();
161
- if (!packet) return [3 /*break*/, 6];
162
- this.ongoingRequestsCounter++;
163
- _a.label = 1;
164
- case 1:
165
- _a.trys.push([1, 3, 4, 5]);
166
- return [4 /*yield*/, this.backendProxy.submitFootprintsV6(packet, execution.buildSessionId, execution.testStage, this.cfg.buildSessionId.value)];
167
- case 2:
168
- _a.sent();
169
- this.logger.info("Footprints packet submitted successfully. packet contains ".concat(packet.methods.length, " methods, ").concat(packet.branches.length, " branches in ").concat(packet.executions.length, " executions"));
170
- return [3 /*break*/, 5];
171
- case 3:
172
- e_2 = _a.sent();
173
- this.logger.error("Error while submitting footprints '".concat(e_2, "'"));
174
- agent_events_guard_1.AgentEventsGuard.notifyIfNeeded(agent_events_contracts_1.AgentEventCode.FOOTPRINTS_SUBMISSION_ERROR, e_2);
175
- return [3 /*break*/, 5];
176
- case 4:
177
- this.ongoingRequestsCounter--;
178
- return [7 /*endfinally*/];
179
- case 5: return [3 /*break*/, 7];
180
- case 6:
181
- this.logger.info('No hits collected nothing to submit');
182
- _a.label = 7;
183
- case 7: return [2 /*return*/];
82
+ }
83
+ submitQueuedFootprints(execution) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ this.hitsCollector.sendErrors();
86
+ if (!this.shouldSubmitFootprints()) {
87
+ return;
88
+ }
89
+ const packet = this.footprintsBuffer.createPacket();
90
+ if (packet) {
91
+ this.ongoingRequestsCounter++;
92
+ try {
93
+ yield this.backendProxy.submitFootprintsV6(packet, execution.buildSessionId, execution.testStage, this.cfg.buildSessionId.value);
94
+ this.logger.info(`Footprints packet submitted successfully. packet contains ${packet.methods.length} methods, ${packet.branches.length} branches in ${packet.executions.length} executions`);
184
95
  }
185
- });
96
+ catch (e) {
97
+ this.logger.error(`Error while submitting footprints '${e}'`);
98
+ agent_events_guard_1.AgentEventsGuard.notifyIfNeeded(agent_events_contracts_1.AgentEventCode.FOOTPRINTS_SUBMISSION_ERROR, e);
99
+ }
100
+ finally {
101
+ this.ongoingRequestsCounter--;
102
+ }
103
+ }
104
+ else {
105
+ this.logger.info('No hits collected nothing to submit');
106
+ }
186
107
  });
187
- };
188
- FootprintsProcess.prototype.shouldSubmitFootprints = function () {
108
+ }
109
+ shouldSubmitFootprints() {
189
110
  if (!this.isRunning) {
190
111
  this.logger.info('Agent is not running, not sending footprints');
191
112
  return false;
@@ -195,8 +116,8 @@ var FootprintsProcess = /** @class */ (function () {
195
116
  return false;
196
117
  }
197
118
  return true;
198
- };
199
- FootprintsProcess.prototype.start = function () {
119
+ }
120
+ start() {
200
121
  if (this.isRunning)
201
122
  return;
202
123
  if (this.cfg.enabled.value == false)
@@ -206,225 +127,161 @@ var FootprintsProcess = /** @class */ (function () {
206
127
  if (this.footprintsBuffer.hasHitsInBuffer()) {
207
128
  this.ensureKeepaliveThreadRunning();
208
129
  }
209
- };
210
- FootprintsProcess.prototype.stop = function () {
211
- return __awaiter(this, void 0, void 0, function () {
212
- var packet, e_3;
213
- return __generator(this, function (_a) {
214
- switch (_a.label) {
215
- case 0:
216
- this.sendToServerWatchdog.stop();
217
- this.hitsCollector.sendErrors();
218
- if (!this.shouldSubmitFootprints()) {
219
- this.isRunning = false;
220
- return [2 /*return*/];
221
- }
222
- return [4 /*yield*/, this.flushCurrentFootprints(true)];
223
- case 1:
224
- _a.sent();
225
- packet = this.footprintsBuffer.createPacket();
226
- this.isRunning = false;
227
- if (!packet) {
228
- this.logger.info('No hits collected, nothing to submit');
229
- return [2 /*return*/];
230
- }
231
- this.logger.info('Start submitting footprints, triggered by stop event.');
232
- _a.label = 2;
233
- case 2:
234
- _a.trys.push([2, 4, , 5]);
235
- return [4 /*yield*/, this.backendProxy.submitFootprintsV6(packet, this.currentExecutionBsid, this.stateTracker.getTestStage(), this.cfg.buildSessionId.value)];
236
- case 3:
237
- _a.sent();
238
- this.logger.info('Final footprints submitted successfully');
239
- return [3 /*break*/, 5];
240
- case 4:
241
- e_3 = _a.sent();
242
- this.logger.error("Failed to submit final footprints, error: ".concat(e_3.message));
243
- this.logger.debug(e_3);
244
- return [2 /*return*/];
245
- case 5: return [2 /*return*/];
246
- }
247
- });
130
+ }
131
+ stop() {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ this.sendToServerWatchdog.stop();
134
+ this.hitsCollector.sendErrors();
135
+ if (!this.shouldSubmitFootprints()) {
136
+ this.isRunning = false;
137
+ return;
138
+ }
139
+ yield this.flushCurrentFootprints(true);
140
+ const packet = this.footprintsBuffer.createPacket();
141
+ this.isRunning = false;
142
+ if (!packet) {
143
+ this.logger.info('No hits collected, nothing to submit');
144
+ return;
145
+ }
146
+ this.logger.info('Start submitting footprints, triggered by stop event.');
147
+ try {
148
+ yield this.backendProxy.submitFootprintsV6(packet, this.currentExecutionBsid, this.stateTracker.getTestStage(), this.cfg.buildSessionId.value);
149
+ this.logger.info('Final footprints submitted successfully');
150
+ }
151
+ catch (e) {
152
+ this.logger.error(`Failed to submit final footprints, error: ${e.message}`);
153
+ this.logger.debug(e);
154
+ return;
155
+ }
248
156
  });
249
- };
250
- FootprintsProcess.prototype.handleTestIdChanged = function (newTestIdentifier, previousTestIdentifier) {
157
+ }
158
+ handleTestIdChanged(newTestIdentifier, previousTestIdentifier) {
251
159
  if (previousTestIdentifier == null) {
252
160
  this.logger.info('Test identifier changed, previous identifier wasn\'t set, meaning that we didn\'t have active test. Skip enqueuing footprints process.');
253
161
  }
254
162
  else {
255
- var _a = this.stateTracker.getCollectHitsState(), shouldCollectHits = _a.shouldCollectHits, message = _a.message;
163
+ const { shouldCollectHits, message } = this.stateTracker.getCollectHitsState();
256
164
  if (!shouldCollectHits) {
257
- this.logger.info("Test identifier changed. ".concat(message));
165
+ this.logger.info(`Test identifier changed. ${message}`);
258
166
  return;
259
167
  }
260
168
  this.logger.debug('Test identifier changed, start enqueuing footprints process.');
261
- var prevTestIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(previousTestIdentifier);
169
+ const prevTestIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(previousTestIdentifier);
262
170
  this.enqueueCurrentFootprints(this.stateTracker.currentExecution, prevTestIdentifierParts.testName);
263
171
  }
264
- };
265
- FootprintsProcess.prototype.delegateEvents = function () {
266
- var _this = this;
267
- this.sendToServerWatchdog.on(FootprintsProcess.ALARM_FIRED, function () {
268
- _this.logger.debug('Start submitting footprints, triggered by send to server watchdog.');
269
- _this.submitQueuedFootprints(_this.stateTracker.currentExecution);
172
+ }
173
+ delegateEvents() {
174
+ this.sendToServerWatchdog.on(FootprintsProcess.ALARM_FIRED, () => {
175
+ this.logger.debug('Start submitting footprints, triggered by send to server watchdog.');
176
+ this.submitQueuedFootprints(this.stateTracker.currentExecution);
270
177
  });
271
- this.keepaliveWatchdog.on(FootprintsProcess.ALARM_FIRED, function () {
272
- if (!_this.hasOngoingRequests() && !_this.footprintsBuffer.hasHitsInBuffer()) {
273
- _this.keepaliveWatchdog.stop();
178
+ this.keepaliveWatchdog.on(FootprintsProcess.ALARM_FIRED, () => {
179
+ if (!this.hasOngoingRequests() && !this.footprintsBuffer.hasHitsInBuffer()) {
180
+ this.keepaliveWatchdog.stop();
274
181
  }
275
182
  });
276
- this.footprintsBuffer.on(footprints_buffer_1.FootprintsBuffer.BUFFER_FULL, function () {
277
- _this.submitQueuedFootprints(_this.stateTracker.currentExecution);
183
+ this.footprintsBuffer.on(footprints_buffer_1.FootprintsBuffer.BUFFER_FULL, () => {
184
+ this.submitQueuedFootprints(this.stateTracker.currentExecution);
278
185
  });
279
- this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_BSID_CHANGED, function (prevExecution, newBuildSession) {
280
- _this.logger.warn("Execution points to different build session '".concat(newBuildSession, "'. Collecting and submitting previous footprints"));
281
- _this.enqueueAndSubmit(prevExecution);
186
+ this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_BSID_CHANGED, (prevExecution, newBuildSession) => {
187
+ this.logger.warn(`Execution points to different build session '${newBuildSession}'. Collecting and submitting previous footprints`);
188
+ this.enqueueAndSubmit(prevExecution);
282
189
  });
283
- this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_ID_CHANGED, function (prevExecution, newExecutionId) {
284
- _this.logger.warn("Execution id changed to'".concat(newExecutionId, "'. Collecting previous footprints"));
285
- _this.enqueueCurrentFootprints(prevExecution, null);
190
+ this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_ID_CHANGED, (prevExecution, newExecutionId) => {
191
+ this.logger.warn(`Execution id changed to'${newExecutionId}'. Collecting previous footprints`);
192
+ this.enqueueCurrentFootprints(prevExecution, null);
286
193
  });
287
- this.stateTracker.on(state_tracker_1.StateTracker.TEST_STAGE_CHANGED, function (prevExecution, newTestStage) {
288
- _this.logger.warn("Execution points to different test stage '".concat(newTestStage, "'. Collecting and submitting previous footprints"));
289
- _this.enqueueAndSubmit(prevExecution);
194
+ this.stateTracker.on(state_tracker_1.StateTracker.TEST_STAGE_CHANGED, (prevExecution, newTestStage) => {
195
+ this.logger.warn(`Execution points to different test stage '${newTestStage}'. Collecting and submitting previous footprints`);
196
+ this.enqueueAndSubmit(prevExecution);
290
197
  });
291
- this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_STATUS_PENDING_DELETE, function (execution) {
292
- _this.enqueueAndSubmit(execution);
198
+ this.stateTracker.on(state_tracker_1.StateTracker.EXECUTION_STATUS_PENDING_DELETE, (execution) => {
199
+ this.enqueueAndSubmit(execution);
293
200
  });
294
- };
295
- FootprintsProcess.prototype.enqueueAndSubmit = function (executionData, isFinalFootprints) {
296
- if (isFinalFootprints === void 0) { isFinalFootprints = false; }
297
- return __awaiter(this, void 0, void 0, function () {
298
- return __generator(this, function (_a) {
299
- switch (_a.label) {
300
- case 0: return [4 /*yield*/, this.enqueueCurrentFootprints(executionData, null, isFinalFootprints)];
301
- case 1:
302
- _a.sent();
303
- return [4 /*yield*/, this.submitQueuedFootprints(executionData)];
304
- case 2:
305
- _a.sent();
306
- return [2 /*return*/];
307
- }
308
- });
201
+ }
202
+ enqueueAndSubmit(executionData, isFinalFootprints = false) {
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ yield this.enqueueCurrentFootprints(executionData, null, isFinalFootprints);
205
+ yield this.submitQueuedFootprints(executionData);
309
206
  });
310
- };
311
- FootprintsProcess.prototype.flushCurrentFootprints = function (isFinalFootprints) {
312
- if (isFinalFootprints === void 0) { isFinalFootprints = false; }
313
- return __awaiter(this, void 0, void 0, function () {
314
- var currentTestIdentifier, _a, shouldCollectHits, message, reason, testIdentifierParts;
315
- return __generator(this, function (_b) {
316
- switch (_b.label) {
317
- case 0:
318
- currentTestIdentifier = this.stateTracker.getCurrentTestIdentifier();
319
- _a = this.stateTracker.getCollectHitsState(), shouldCollectHits = _a.shouldCollectHits, message = _a.message, reason = _a.reason;
320
- // No active execution or execution is pending delete
321
- if (!shouldCollectHits) {
322
- this.logger.info("Enqueue footprints interval - ".concat(message));
323
- this.checkShouldUpdateCoverageSnapshot(reason);
324
- return [2 /*return*/];
325
- }
326
- if (!currentTestIdentifier) return [3 /*break*/, 2];
327
- testIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(currentTestIdentifier);
328
- this.logger.debug("Enqueue footprints interval - start enqueuing process. currentTestIdentifier: '".concat(currentTestIdentifier, "'"));
329
- return [4 /*yield*/, this.enqueueCurrentFootprints(this.stateTracker.currentExecution, testIdentifierParts.testName, isFinalFootprints)];
330
- case 1:
331
- _b.sent();
332
- return [3 /*break*/, 4];
333
- case 2:
334
- this.logger.debug('Enqueue footprints interval - start enqueuing process. anonymous footprints');
335
- return [4 /*yield*/, this.enqueueCurrentFootprints(this.stateTracker.currentExecution, null, isFinalFootprints)];
336
- case 3:
337
- _b.sent();
338
- _b.label = 4;
339
- case 4: return [2 /*return*/];
340
- }
341
- });
207
+ }
208
+ flushCurrentFootprints(isFinalFootprints = false) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ const currentTestIdentifier = this.stateTracker.getCurrentTestIdentifier();
211
+ const { shouldCollectHits, message, reason } = this.stateTracker.getCollectHitsState();
212
+ // No active execution or execution is pending delete
213
+ if (!shouldCollectHits) {
214
+ this.logger.info(`Enqueue footprints interval - ${message}`);
215
+ this.checkShouldUpdateCoverageSnapshot(reason);
216
+ return;
217
+ }
218
+ // Colored footprints with active execution
219
+ if (currentTestIdentifier) {
220
+ const testIdentifierParts = state_tracker_1.StateTracker.splitTestIdToExecutionAndTestName(currentTestIdentifier);
221
+ this.logger.debug(`Enqueue footprints interval - start enqueuing process. currentTestIdentifier: '${currentTestIdentifier}'`);
222
+ yield this.enqueueCurrentFootprints(this.stateTracker.currentExecution, testIdentifierParts.testName, isFinalFootprints);
223
+ }
224
+ // Anonymous footprints with active execution
225
+ else {
226
+ this.logger.debug('Enqueue footprints interval - start enqueuing process. anonymous footprints');
227
+ yield this.enqueueCurrentFootprints(this.stateTracker.currentExecution, null, isFinalFootprints);
228
+ }
342
229
  });
343
- };
344
- FootprintsProcess.prototype.checkShouldUpdateCoverageSnapshot = function (reason) {
230
+ }
231
+ checkShouldUpdateCoverageSnapshot(reason) {
345
232
  if (this.stateTracker.openExecutionFoundOnce) {
346
- this.logger.debug("Did not collect hits - reason: ".concat(reason, " and not in initFootprints mode, updating coverage snapshot"));
233
+ this.logger.debug(`Did not collect hits - reason: ${reason} and not in initFootprints mode, updating coverage snapshot`);
347
234
  this.hitsCollector.dropHits();
348
235
  }
349
- };
350
- FootprintsProcess.prototype.isInitFootprints = function () {
236
+ }
237
+ isInitFootprints() {
351
238
  return this.stateTracker.openExecutionFoundOnce && !this.footprintsEnqueueOnce;
352
- };
353
- FootprintsProcess.prototype.hasOngoingRequests = function () {
239
+ }
240
+ hasOngoingRequests() {
354
241
  return this.ongoingRequestsCounter > 0;
355
- };
242
+ }
356
243
  // TODO: use generic solution for browser and remote agents
357
- FootprintsProcess.prototype.loadSlMapping = function () {
358
- return __awaiter(this, void 0, void 0, function () {
359
- var mappingsArr, flatted;
360
- return __generator(this, function (_a) {
361
- switch (_a.label) {
362
- case 0:
363
- if (!sl_env_vars_1.SlEnvVars.useSlMapping()) {
364
- return [2 /*return*/];
365
- }
366
- return [4 /*yield*/, this.backendProxy.getBlobsAsJson(this.cfg.buildSessionId.value)];
367
- case 1:
368
- mappingsArr = _a.sent();
369
- flatted = {};
370
- mappingsArr.forEach(function (mapping) {
371
- flatted = __assign(__assign({}, flatted), mapping);
372
- });
373
- this.hitsConverter.slMapping = flatted;
374
- return [2 /*return*/];
375
- }
244
+ loadSlMapping() {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ if (!sl_env_vars_1.SlEnvVars.useSlMapping()) {
247
+ return;
248
+ }
249
+ const mappingsArr = yield this.backendProxy.getBlobsAsJson(this.cfg.buildSessionId.value);
250
+ let flatted = {};
251
+ mappingsArr.forEach(mapping => {
252
+ flatted = Object.assign(Object.assign({}, flatted), mapping);
376
253
  });
254
+ this.hitsConverter.slMapping = flatted;
377
255
  });
378
- };
379
- Object.defineProperty(FootprintsProcess.prototype, "ongoingRequestsCounter", {
380
- set: function (value) {
381
- this._ongoingRequestsCounter = value;
382
- },
383
- enumerable: false,
384
- configurable: true
385
- });
386
- Object.defineProperty(FootprintsProcess.prototype, "backendProxy", {
387
- get: function () {
388
- return this._backendProxy;
389
- },
390
- set: function (value) {
391
- this._backendProxy = value;
392
- },
393
- enumerable: false,
394
- configurable: true
395
- });
396
- Object.defineProperty(FootprintsProcess.prototype, "cfg", {
397
- get: function () {
398
- return this._cfg;
399
- },
400
- set: function (value) {
401
- this._cfg = value;
402
- },
403
- enumerable: false,
404
- configurable: true
405
- });
406
- Object.defineProperty(FootprintsProcess.prototype, "sendToServerWatchdog", {
407
- get: function () {
408
- return this._sendToServerWatchdog;
409
- },
410
- set: function (value) {
411
- this._sendToServerWatchdog = value;
412
- },
413
- enumerable: false,
414
- configurable: true
415
- });
416
- Object.defineProperty(FootprintsProcess.prototype, "keepaliveWatchdog", {
417
- get: function () {
418
- return this._keepaliveWatchdog;
419
- },
420
- set: function (value) {
421
- this._keepaliveWatchdog = value;
422
- },
423
- enumerable: false,
424
- configurable: true
425
- });
426
- FootprintsProcess.ALARM_FIRED = 'alarm';
427
- return FootprintsProcess;
428
- }());
256
+ }
257
+ set ongoingRequestsCounter(value) {
258
+ this._ongoingRequestsCounter = value;
259
+ }
260
+ get backendProxy() {
261
+ return this._backendProxy;
262
+ }
263
+ set backendProxy(value) {
264
+ this._backendProxy = value;
265
+ }
266
+ get cfg() {
267
+ return this._cfg;
268
+ }
269
+ set cfg(value) {
270
+ this._cfg = value;
271
+ }
272
+ get sendToServerWatchdog() {
273
+ return this._sendToServerWatchdog;
274
+ }
275
+ set sendToServerWatchdog(value) {
276
+ this._sendToServerWatchdog = value;
277
+ }
278
+ get keepaliveWatchdog() {
279
+ return this._keepaliveWatchdog;
280
+ }
281
+ set keepaliveWatchdog(value) {
282
+ this._keepaliveWatchdog = value;
283
+ }
284
+ }
429
285
  exports.FootprintsProcess = FootprintsProcess;
286
+ FootprintsProcess.ALARM_FIRED = 'alarm';
430
287
  //# sourceMappingURL=index.js.map