@datadog/datadog-ci 3.3.1 → 3.5.0

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 (403) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/cloud-run/flare.js +14 -14
  4. package/dist/commands/cloud-run/flare.js.map +1 -1
  5. package/dist/commands/coverage/renderer.js +2 -2
  6. package/dist/commands/coverage/renderer.js.map +1 -1
  7. package/dist/commands/coverage/upload.js +10 -11
  8. package/dist/commands/coverage/upload.js.map +1 -1
  9. package/dist/commands/coverage/utils.js +2 -2
  10. package/dist/commands/coverage/utils.js.map +1 -1
  11. package/dist/commands/dsyms/renderer.js +3 -3
  12. package/dist/commands/dsyms/renderer.js.map +1 -1
  13. package/dist/commands/dsyms/upload.js +9 -9
  14. package/dist/commands/dsyms/upload.js.map +1 -1
  15. package/dist/commands/dsyms/utils.js +4 -4
  16. package/dist/commands/dsyms/utils.js.map +1 -1
  17. package/dist/commands/elf-symbols/upload.js +4 -4
  18. package/dist/commands/elf-symbols/upload.js.map +1 -1
  19. package/dist/commands/flutter-symbols/helpers.js +5 -25
  20. package/dist/commands/flutter-symbols/helpers.js.map +1 -1
  21. package/dist/commands/flutter-symbols/upload.js +2 -2
  22. package/dist/commands/flutter-symbols/upload.js.map +1 -1
  23. package/dist/commands/git-metadata/gitdb.js +4 -4
  24. package/dist/commands/git-metadata/gitdb.js.map +1 -1
  25. package/dist/commands/junit/api.js +2 -2
  26. package/dist/commands/junit/api.js.map +1 -1
  27. package/dist/commands/junit/renderer.js +2 -2
  28. package/dist/commands/junit/renderer.js.map +1 -1
  29. package/dist/commands/junit/upload.js +7 -7
  30. package/dist/commands/junit/upload.js.map +1 -1
  31. package/dist/commands/lambda/constants.d.ts +3 -0
  32. package/dist/commands/lambda/constants.js +5 -2
  33. package/dist/commands/lambda/constants.js.map +1 -1
  34. package/dist/commands/lambda/flare.js +18 -18
  35. package/dist/commands/lambda/flare.js.map +1 -1
  36. package/dist/commands/lambda/functions/instrument.js +10 -0
  37. package/dist/commands/lambda/functions/instrument.js.map +1 -1
  38. package/dist/commands/lambda/functions/uninstrument.js +3 -0
  39. package/dist/commands/lambda/functions/uninstrument.js.map +1 -1
  40. package/dist/commands/lambda/instrument.d.ts +1 -0
  41. package/dist/commands/lambda/instrument.js +5 -2
  42. package/dist/commands/lambda/instrument.js.map +1 -1
  43. package/dist/commands/lambda/interfaces.d.ts +3 -0
  44. package/dist/commands/pe-symbols/upload.js +2 -3
  45. package/dist/commands/pe-symbols/upload.js.map +1 -1
  46. package/dist/commands/react-native/codepush.js +7 -2
  47. package/dist/commands/react-native/codepush.js.map +1 -1
  48. package/dist/commands/react-native/utils.d.ts +1 -0
  49. package/dist/commands/react-native/utils.js +5 -1
  50. package/dist/commands/react-native/utils.js.map +1 -1
  51. package/dist/commands/react-native/xcode.js +1 -2
  52. package/dist/commands/react-native/xcode.js.map +1 -1
  53. package/dist/commands/sarif/renderer.js +3 -3
  54. package/dist/commands/sarif/renderer.js.map +1 -1
  55. package/dist/commands/sarif/upload.js +5 -6
  56. package/dist/commands/sarif/upload.js.map +1 -1
  57. package/dist/commands/sbom/constants.d.ts +1 -0
  58. package/dist/commands/sbom/constants.js +2 -1
  59. package/dist/commands/sbom/constants.js.map +1 -1
  60. package/dist/commands/sbom/payload.js +66 -0
  61. package/dist/commands/sbom/payload.js.map +1 -1
  62. package/dist/commands/sbom/types.d.ts +13 -0
  63. package/dist/commands/sourcemaps/upload.js +4 -5
  64. package/dist/commands/sourcemaps/upload.js.map +1 -1
  65. package/dist/commands/sourcemaps/utils.js +2 -2
  66. package/dist/commands/sourcemaps/utils.js.map +1 -1
  67. package/dist/commands/span/cli.js +5 -0
  68. package/dist/commands/span/cli.js.map +1 -0
  69. package/dist/commands/span/span.d.ts +10 -0
  70. package/dist/commands/span/span.js +112 -0
  71. package/dist/commands/span/span.js.map +1 -0
  72. package/dist/commands/synthetics/api.d.ts +1 -1
  73. package/dist/commands/synthetics/api.js +40 -12
  74. package/dist/commands/synthetics/api.js.map +1 -1
  75. package/dist/commands/synthetics/batch.js +12 -11
  76. package/dist/commands/synthetics/batch.js.map +1 -1
  77. package/dist/commands/synthetics/build-and-test.d.ts +20 -3
  78. package/dist/commands/synthetics/build-and-test.js +157 -63
  79. package/dist/commands/synthetics/build-and-test.js.map +1 -1
  80. package/dist/commands/synthetics/interfaces.d.ts +71 -35
  81. package/dist/commands/synthetics/interfaces.js.map +1 -1
  82. package/dist/commands/synthetics/multilocator.js +2 -2
  83. package/dist/commands/synthetics/multilocator.js.map +1 -1
  84. package/dist/commands/synthetics/reporters/default.js +10 -9
  85. package/dist/commands/synthetics/reporters/default.js.map +1 -1
  86. package/dist/commands/synthetics/reporters/junit.js +74 -63
  87. package/dist/commands/synthetics/reporters/junit.js.map +1 -1
  88. package/dist/commands/synthetics/run-tests-command.js +5 -2
  89. package/dist/commands/synthetics/run-tests-command.js.map +1 -1
  90. package/dist/commands/synthetics/test.d.ts +2 -2
  91. package/dist/commands/synthetics/utils/internal.d.ts +3 -5
  92. package/dist/commands/synthetics/utils/internal.js +2 -17
  93. package/dist/commands/synthetics/utils/internal.js.map +1 -1
  94. package/dist/commands/synthetics/utils/public.d.ts +4 -4
  95. package/dist/commands/synthetics/utils/public.js +22 -11
  96. package/dist/commands/synthetics/utils/public.js.map +1 -1
  97. package/dist/commands/trace/helper.d.ts +16 -0
  98. package/dist/commands/trace/helper.js +123 -0
  99. package/dist/commands/trace/helper.js.map +1 -0
  100. package/dist/commands/trace/test-utils.d.ts +4 -0
  101. package/dist/commands/trace/{__tests__/trace.test.js → test-utils.js} +15 -41
  102. package/dist/commands/trace/test-utils.js.map +1 -0
  103. package/dist/commands/trace/trace.d.ts +2 -12
  104. package/dist/commands/trace/trace.js +14 -93
  105. package/dist/commands/trace/trace.js.map +1 -1
  106. package/dist/commands/unity-symbols/upload.js +7 -7
  107. package/dist/commands/unity-symbols/upload.js.map +1 -1
  108. package/dist/helpers/file-finder.js +3 -3
  109. package/dist/helpers/file-finder.js.map +1 -1
  110. package/dist/helpers/flare.js +6 -5
  111. package/dist/helpers/flare.js.map +1 -1
  112. package/dist/helpers/fs.js +3 -3
  113. package/dist/helpers/fs.js.map +1 -1
  114. package/dist/helpers/glob.d.ts +12 -0
  115. package/dist/helpers/glob.js +70 -0
  116. package/dist/helpers/glob.js.map +1 -0
  117. package/dist/helpers/interfaces.d.ts +5 -6
  118. package/dist/helpers/renderer.js +3 -3
  119. package/dist/helpers/renderer.js.map +1 -1
  120. package/dist/helpers/tags.js +3 -3
  121. package/dist/helpers/tags.js.map +1 -1
  122. package/dist/helpers/utils.d.ts +0 -1
  123. package/dist/helpers/utils.js +1 -12
  124. package/dist/helpers/utils.js.map +1 -1
  125. package/package.json +6 -5
  126. package/dist/__tests__/cli.test.js +0 -93
  127. package/dist/__tests__/cli.test.js.map +0 -1
  128. package/dist/commands/cloud-run/__tests__/fixtures.d.ts +0 -2
  129. package/dist/commands/cloud-run/__tests__/fixtures.js +0 -12
  130. package/dist/commands/cloud-run/__tests__/fixtures.js.map +0 -1
  131. package/dist/commands/cloud-run/__tests__/flare.test.d.ts +0 -1
  132. package/dist/commands/cloud-run/__tests__/flare.test.js +0 -557
  133. package/dist/commands/cloud-run/__tests__/flare.test.js.map +0 -1
  134. package/dist/commands/coverage/__tests__/upload.test.d.ts +0 -1
  135. package/dist/commands/coverage/__tests__/upload.test.js +0 -291
  136. package/dist/commands/coverage/__tests__/upload.test.js.map +0 -1
  137. package/dist/commands/coverage/__tests__/utils.test.d.ts +0 -1
  138. package/dist/commands/coverage/__tests__/utils.test.js +0 -47
  139. package/dist/commands/coverage/__tests__/utils.test.js.map +0 -1
  140. package/dist/commands/deployment/__tests__/correlate.test.d.ts +0 -1
  141. package/dist/commands/deployment/__tests__/correlate.test.js +0 -106
  142. package/dist/commands/deployment/__tests__/correlate.test.js.map +0 -1
  143. package/dist/commands/deployment/__tests__/mark.test.d.ts +0 -1
  144. package/dist/commands/deployment/__tests__/mark.test.js +0 -97
  145. package/dist/commands/deployment/__tests__/mark.test.js.map +0 -1
  146. package/dist/commands/dora/__tests__/deployment.test.d.ts +0 -1
  147. package/dist/commands/dora/__tests__/deployment.test.js +0 -203
  148. package/dist/commands/dora/__tests__/deployment.test.js.map +0 -1
  149. package/dist/commands/dsyms/__tests__/upload.test.d.ts +0 -1
  150. package/dist/commands/dsyms/__tests__/upload.test.js +0 -346
  151. package/dist/commands/dsyms/__tests__/upload.test.js.map +0 -1
  152. package/dist/commands/dsyms/__tests__/utils.test.d.ts +0 -1
  153. package/dist/commands/dsyms/__tests__/utils.test.js +0 -100
  154. package/dist/commands/dsyms/__tests__/utils.test.js.map +0 -1
  155. package/dist/commands/elf-symbols/__tests__/elf.test.d.ts +0 -1
  156. package/dist/commands/elf-symbols/__tests__/elf.test.js +0 -822
  157. package/dist/commands/elf-symbols/__tests__/elf.test.js.map +0 -1
  158. package/dist/commands/elf-symbols/__tests__/upload.test.d.ts +0 -1
  159. package/dist/commands/elf-symbols/__tests__/upload.test.js +0 -228
  160. package/dist/commands/elf-symbols/__tests__/upload.test.js.map +0 -1
  161. package/dist/commands/flutter-symbols/__tests__/upload.test.d.ts +0 -1
  162. package/dist/commands/flutter-symbols/__tests__/upload.test.js +0 -617
  163. package/dist/commands/flutter-symbols/__tests__/upload.test.js.map +0 -1
  164. package/dist/commands/gate/__tests__/evaluate.test.d.ts +0 -1
  165. package/dist/commands/gate/__tests__/evaluate.test.js +0 -398
  166. package/dist/commands/gate/__tests__/evaluate.test.js.map +0 -1
  167. package/dist/commands/gate/__tests__/scope.test.d.ts +0 -1
  168. package/dist/commands/gate/__tests__/scope.test.js +0 -29
  169. package/dist/commands/gate/__tests__/scope.test.js.map +0 -1
  170. package/dist/commands/git-metadata/__tests__/git.test.d.ts +0 -1
  171. package/dist/commands/git-metadata/__tests__/git.test.js +0 -132
  172. package/dist/commands/git-metadata/__tests__/git.test.js.map +0 -1
  173. package/dist/commands/git-metadata/__tests__/gitdb.test.d.ts +0 -1
  174. package/dist/commands/git-metadata/__tests__/gitdb.test.js +0 -1386
  175. package/dist/commands/git-metadata/__tests__/gitdb.test.js.map +0 -1
  176. package/dist/commands/git-metadata/__tests__/library.test.d.ts +0 -1
  177. package/dist/commands/git-metadata/__tests__/library.test.js +0 -118
  178. package/dist/commands/git-metadata/__tests__/library.test.js.map +0 -1
  179. package/dist/commands/git-metadata/__tests__/upload.test.d.ts +0 -1
  180. package/dist/commands/git-metadata/__tests__/upload.test.js +0 -52
  181. package/dist/commands/git-metadata/__tests__/upload.test.js.map +0 -1
  182. package/dist/commands/junit/__tests__/upload.test.d.ts +0 -1
  183. package/dist/commands/junit/__tests__/upload.test.js +0 -495
  184. package/dist/commands/junit/__tests__/upload.test.js.map +0 -1
  185. package/dist/commands/lambda/__tests__/fixtures.d.ts +0 -51
  186. package/dist/commands/lambda/__tests__/fixtures.js +0 -146
  187. package/dist/commands/lambda/__tests__/fixtures.js.map +0 -1
  188. package/dist/commands/lambda/__tests__/flare.test.d.ts +0 -1
  189. package/dist/commands/lambda/__tests__/flare.test.js +0 -730
  190. package/dist/commands/lambda/__tests__/flare.test.js.map +0 -1
  191. package/dist/commands/lambda/__tests__/functions/commons.test.d.ts +0 -1
  192. package/dist/commands/lambda/__tests__/functions/commons.test.js +0 -791
  193. package/dist/commands/lambda/__tests__/functions/commons.test.js.map +0 -1
  194. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.d.ts +0 -1
  195. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js +0 -386
  196. package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js.map +0 -1
  197. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.d.ts +0 -1
  198. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js +0 -728
  199. package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js.map +0 -1
  200. package/dist/commands/lambda/__tests__/functions/uninstrument.test.d.ts +0 -1
  201. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +0 -513
  202. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +0 -1
  203. package/dist/commands/lambda/__tests__/functions/versionChecker.test.d.ts +0 -1
  204. package/dist/commands/lambda/__tests__/functions/versionChecker.test.js +0 -33
  205. package/dist/commands/lambda/__tests__/functions/versionChecker.test.js.map +0 -1
  206. package/dist/commands/lambda/__tests__/instrument.test.d.ts +0 -1
  207. package/dist/commands/lambda/__tests__/instrument.test.js +0 -1599
  208. package/dist/commands/lambda/__tests__/instrument.test.js.map +0 -1
  209. package/dist/commands/lambda/__tests__/loggroup.test.d.ts +0 -1
  210. package/dist/commands/lambda/__tests__/loggroup.test.js +0 -340
  211. package/dist/commands/lambda/__tests__/loggroup.test.js.map +0 -1
  212. package/dist/commands/lambda/__tests__/prompt.test.d.ts +0 -1
  213. package/dist/commands/lambda/__tests__/prompt.test.js +0 -206
  214. package/dist/commands/lambda/__tests__/prompt.test.js.map +0 -1
  215. package/dist/commands/lambda/__tests__/tags.test.d.ts +0 -1
  216. package/dist/commands/lambda/__tests__/tags.test.js +0 -305
  217. package/dist/commands/lambda/__tests__/tags.test.js.map +0 -1
  218. package/dist/commands/lambda/__tests__/uninstrument.test.d.ts +0 -1
  219. package/dist/commands/lambda/__tests__/uninstrument.test.js +0 -722
  220. package/dist/commands/lambda/__tests__/uninstrument.test.js.map +0 -1
  221. package/dist/commands/measure/__tests__/measure.test.d.ts +0 -1
  222. package/dist/commands/measure/__tests__/measure.test.js +0 -102
  223. package/dist/commands/measure/__tests__/measure.test.js.map +0 -1
  224. package/dist/commands/pe-symbols/__tests__/pe.test.d.ts +0 -1
  225. package/dist/commands/pe-symbols/__tests__/pe.test.js +0 -81
  226. package/dist/commands/pe-symbols/__tests__/pe.test.js.map +0 -1
  227. package/dist/commands/react-native/__tests__/codepush.test.d.ts +0 -1
  228. package/dist/commands/react-native/__tests__/codepush.test.js +0 -161
  229. package/dist/commands/react-native/__tests__/codepush.test.js.map +0 -1
  230. package/dist/commands/react-native/__tests__/interfaces.test.d.ts +0 -1
  231. package/dist/commands/react-native/__tests__/interfaces.test.js +0 -33
  232. package/dist/commands/react-native/__tests__/interfaces.test.js.map +0 -1
  233. package/dist/commands/react-native/__tests__/upload.test.d.ts +0 -1
  234. package/dist/commands/react-native/__tests__/upload.test.js +0 -238
  235. package/dist/commands/react-native/__tests__/upload.test.js.map +0 -1
  236. package/dist/commands/react-native/__tests__/utils.test.d.ts +0 -1
  237. package/dist/commands/react-native/__tests__/utils.test.js +0 -27
  238. package/dist/commands/react-native/__tests__/utils.test.js.map +0 -1
  239. package/dist/commands/react-native/__tests__/xcode.test.d.ts +0 -1
  240. package/dist/commands/react-native/__tests__/xcode.test.js +0 -465
  241. package/dist/commands/react-native/__tests__/xcode.test.js.map +0 -1
  242. package/dist/commands/sarif/__tests__/upload.test.d.ts +0 -1
  243. package/dist/commands/sarif/__tests__/upload.test.js +0 -291
  244. package/dist/commands/sarif/__tests__/upload.test.js.map +0 -1
  245. package/dist/commands/sarif/__tests__/utils.test.d.ts +0 -1
  246. package/dist/commands/sarif/__tests__/utils.test.js +0 -26
  247. package/dist/commands/sarif/__tests__/utils.test.js.map +0 -1
  248. package/dist/commands/sarif/__tests__/validation.test.d.ts +0 -1
  249. package/dist/commands/sarif/__tests__/validation.test.js +0 -19
  250. package/dist/commands/sarif/__tests__/validation.test.js.map +0 -1
  251. package/dist/commands/sbom/__tests__/payload.test.d.ts +0 -1
  252. package/dist/commands/sbom/__tests__/payload.test.js +0 -436
  253. package/dist/commands/sbom/__tests__/payload.test.js.map +0 -1
  254. package/dist/commands/sbom/__tests__/validation.test.d.ts +0 -1
  255. package/dist/commands/sbom/__tests__/validation.test.js +0 -141
  256. package/dist/commands/sbom/__tests__/validation.test.js.map +0 -1
  257. package/dist/commands/sourcemaps/__tests__/upload.test.d.ts +0 -1
  258. package/dist/commands/sourcemaps/__tests__/upload.test.js +0 -270
  259. package/dist/commands/sourcemaps/__tests__/upload.test.js.map +0 -1
  260. package/dist/commands/sourcemaps/__tests__/utils.test.d.ts +0 -1
  261. package/dist/commands/sourcemaps/__tests__/utils.test.js +0 -31
  262. package/dist/commands/sourcemaps/__tests__/utils.test.js.map +0 -1
  263. package/dist/commands/stepfunctions/__tests__/awsCommands.test.d.ts +0 -1
  264. package/dist/commands/stepfunctions/__tests__/awsCommands.test.js +0 -210
  265. package/dist/commands/stepfunctions/__tests__/awsCommands.test.js.map +0 -1
  266. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.d.ts +0 -6
  267. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js +0 -45
  268. package/dist/commands/stepfunctions/__tests__/fixtures/aws-resources.js.map +0 -1
  269. package/dist/commands/stepfunctions/__tests__/fixtures/cli.d.ts +0 -5
  270. package/dist/commands/stepfunctions/__tests__/fixtures/cli.js +0 -19
  271. package/dist/commands/stepfunctions/__tests__/fixtures/cli.js.map +0 -1
  272. package/dist/commands/stepfunctions/__tests__/helpers.test.d.ts +0 -1
  273. package/dist/commands/stepfunctions/__tests__/helpers.test.js +0 -501
  274. package/dist/commands/stepfunctions/__tests__/helpers.test.js.map +0 -1
  275. package/dist/commands/stepfunctions/__tests__/instrument.test.d.ts +0 -1
  276. package/dist/commands/stepfunctions/__tests__/instrument.test.js +0 -431
  277. package/dist/commands/stepfunctions/__tests__/instrument.test.js.map +0 -1
  278. package/dist/commands/stepfunctions/__tests__/uninstrument.test.d.ts +0 -1
  279. package/dist/commands/stepfunctions/__tests__/uninstrument.test.js +0 -166
  280. package/dist/commands/stepfunctions/__tests__/uninstrument.test.js.map +0 -1
  281. package/dist/commands/synthetics/__tests__/api.test.d.ts +0 -1
  282. package/dist/commands/synthetics/__tests__/api.test.js +0 -416
  283. package/dist/commands/synthetics/__tests__/api.test.js.map +0 -1
  284. package/dist/commands/synthetics/__tests__/batch.test.d.ts +0 -1
  285. package/dist/commands/synthetics/__tests__/batch.test.js +0 -907
  286. package/dist/commands/synthetics/__tests__/batch.test.js.map +0 -1
  287. package/dist/commands/synthetics/__tests__/build-and-test.test.d.ts +0 -1
  288. package/dist/commands/synthetics/__tests__/build-and-test.test.js +0 -133
  289. package/dist/commands/synthetics/__tests__/build-and-test.test.js.map +0 -1
  290. package/dist/commands/synthetics/__tests__/cli.test.d.ts +0 -1
  291. package/dist/commands/synthetics/__tests__/cli.test.js +0 -1407
  292. package/dist/commands/synthetics/__tests__/cli.test.js.map +0 -1
  293. package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.d.ts +0 -1
  294. package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.js +0 -112
  295. package/dist/commands/synthetics/__tests__/deploy-tests-lib.test.js.map +0 -1
  296. package/dist/commands/synthetics/__tests__/fixtures.d.ts +0 -123
  297. package/dist/commands/synthetics/__tests__/fixtures.js +0 -493
  298. package/dist/commands/synthetics/__tests__/fixtures.js.map +0 -1
  299. package/dist/commands/synthetics/__tests__/import-tests-lib.test.d.ts +0 -1
  300. package/dist/commands/synthetics/__tests__/import-tests-lib.test.js +0 -186
  301. package/dist/commands/synthetics/__tests__/import-tests-lib.test.js.map +0 -1
  302. package/dist/commands/synthetics/__tests__/mobile.test.d.ts +0 -1
  303. package/dist/commands/synthetics/__tests__/mobile.test.js +0 -376
  304. package/dist/commands/synthetics/__tests__/mobile.test.js.map +0 -1
  305. package/dist/commands/synthetics/__tests__/multilocator.test.d.ts +0 -1
  306. package/dist/commands/synthetics/__tests__/multilocator.test.js +0 -142
  307. package/dist/commands/synthetics/__tests__/multilocator.test.js.map +0 -1
  308. package/dist/commands/synthetics/__tests__/reporters/default.test.d.ts +0 -1
  309. package/dist/commands/synthetics/__tests__/reporters/default.test.js +0 -410
  310. package/dist/commands/synthetics/__tests__/reporters/default.test.js.map +0 -1
  311. package/dist/commands/synthetics/__tests__/reporters/junit.test.d.ts +0 -1
  312. package/dist/commands/synthetics/__tests__/reporters/junit.test.js +0 -354
  313. package/dist/commands/synthetics/__tests__/reporters/junit.test.js.map +0 -1
  314. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.d.ts +0 -1
  315. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js +0 -232
  316. package/dist/commands/synthetics/__tests__/reporters/mobile/app-upload.test.js.map +0 -1
  317. package/dist/commands/synthetics/__tests__/run-tests-lib.test.d.ts +0 -1
  318. package/dist/commands/synthetics/__tests__/run-tests-lib.test.js +0 -698
  319. package/dist/commands/synthetics/__tests__/run-tests-lib.test.js.map +0 -1
  320. package/dist/commands/synthetics/__tests__/test.test.d.ts +0 -1
  321. package/dist/commands/synthetics/__tests__/test.test.js +0 -268
  322. package/dist/commands/synthetics/__tests__/test.test.js.map +0 -1
  323. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.d.ts +0 -1
  324. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js +0 -21
  325. package/dist/commands/synthetics/__tests__/tunnel/crypto.test.js.map +0 -1
  326. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.d.ts +0 -1
  327. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js +0 -80
  328. package/dist/commands/synthetics/__tests__/tunnel/tunnel.test.js.map +0 -1
  329. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.d.ts +0 -1
  330. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js +0 -109
  331. package/dist/commands/synthetics/__tests__/tunnel/websocket.test.js.map +0 -1
  332. package/dist/commands/synthetics/__tests__/utils/internal.test.d.ts +0 -1
  333. package/dist/commands/synthetics/__tests__/utils/internal.test.js +0 -161
  334. package/dist/commands/synthetics/__tests__/utils/internal.test.js.map +0 -1
  335. package/dist/commands/synthetics/__tests__/utils/public.test.d.ts +0 -1
  336. package/dist/commands/synthetics/__tests__/utils/public.test.js +0 -576
  337. package/dist/commands/synthetics/__tests__/utils/public.test.js.map +0 -1
  338. package/dist/commands/tag/__tests__/tag.test.d.ts +0 -1
  339. package/dist/commands/tag/__tests__/tag.test.js +0 -85
  340. package/dist/commands/tag/__tests__/tag.test.js.map +0 -1
  341. package/dist/commands/trace/__tests__/trace.test.d.ts +0 -1
  342. package/dist/commands/trace/__tests__/trace.test.js.map +0 -1
  343. package/dist/commands/unity-symbols/__tests__/upload.test.d.ts +0 -1
  344. package/dist/commands/unity-symbols/__tests__/upload.test.js +0 -369
  345. package/dist/commands/unity-symbols/__tests__/upload.test.js.map +0 -1
  346. package/dist/helpers/__tests__/app.test.d.ts +0 -1
  347. package/dist/helpers/__tests__/app.test.js +0 -31
  348. package/dist/helpers/__tests__/app.test.js.map +0 -1
  349. package/dist/helpers/__tests__/ci.test.d.ts +0 -1
  350. package/dist/helpers/__tests__/ci.test.js +0 -344
  351. package/dist/helpers/__tests__/ci.test.js.map +0 -1
  352. package/dist/helpers/__tests__/env.test.d.ts +0 -1
  353. package/dist/helpers/__tests__/env.test.js +0 -74
  354. package/dist/helpers/__tests__/env.test.js.map +0 -1
  355. package/dist/helpers/__tests__/fips.test.d.ts +0 -1
  356. package/dist/helpers/__tests__/fips.test.js +0 -30
  357. package/dist/helpers/__tests__/fips.test.js.map +0 -1
  358. package/dist/helpers/__tests__/fixtures.d.ts +0 -41
  359. package/dist/helpers/__tests__/fixtures.js +0 -80
  360. package/dist/helpers/__tests__/fixtures.js.map +0 -1
  361. package/dist/helpers/__tests__/flare.test.d.ts +0 -1
  362. package/dist/helpers/__tests__/flare.test.js +0 -226
  363. package/dist/helpers/__tests__/flare.test.js.map +0 -1
  364. package/dist/helpers/__tests__/fs.test.d.ts +0 -1
  365. package/dist/helpers/__tests__/fs.test.js +0 -189
  366. package/dist/helpers/__tests__/fs.test.js.map +0 -1
  367. package/dist/helpers/__tests__/id.test.d.ts +0 -1
  368. package/dist/helpers/__tests__/id.test.js +0 -24
  369. package/dist/helpers/__tests__/id.test.js.map +0 -1
  370. package/dist/helpers/__tests__/plist.test.d.ts +0 -1
  371. package/dist/helpers/__tests__/plist.test.js +0 -43
  372. package/dist/helpers/__tests__/plist.test.js.map +0 -1
  373. package/dist/helpers/__tests__/prompt.test.d.ts +0 -1
  374. package/dist/helpers/__tests__/prompt.test.js +0 -71
  375. package/dist/helpers/__tests__/prompt.test.js.map +0 -1
  376. package/dist/helpers/__tests__/retry.test.d.ts +0 -1
  377. package/dist/helpers/__tests__/retry.test.js +0 -99
  378. package/dist/helpers/__tests__/retry.test.js.map +0 -1
  379. package/dist/helpers/__tests__/tags.test.d.ts +0 -1
  380. package/dist/helpers/__tests__/tags.test.js +0 -362
  381. package/dist/helpers/__tests__/tags.test.js.map +0 -1
  382. package/dist/helpers/__tests__/upload.test.d.ts +0 -1
  383. package/dist/helpers/__tests__/upload.test.js +0 -231
  384. package/dist/helpers/__tests__/upload.test.js.map +0 -1
  385. package/dist/helpers/__tests__/user-provided-git.test.d.ts +0 -1
  386. package/dist/helpers/__tests__/user-provided-git.test.js +0 -119
  387. package/dist/helpers/__tests__/user-provided-git.test.js.map +0 -1
  388. package/dist/helpers/__tests__/utils.test.d.ts +0 -1
  389. package/dist/helpers/__tests__/utils.test.js +0 -429
  390. package/dist/helpers/__tests__/utils.test.js.map +0 -1
  391. package/dist/helpers/__tests__/validation.test.d.ts +0 -1
  392. package/dist/helpers/__tests__/validation.test.js +0 -25
  393. package/dist/helpers/__tests__/validation.test.js.map +0 -1
  394. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.d.ts +0 -1
  395. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js +0 -103
  396. package/dist/helpers/git/__tests__/format-git-sourcemaps-data.test.js.map +0 -1
  397. package/dist/helpers/git/__tests__/format-git-span-data.test.d.ts +0 -1
  398. package/dist/helpers/git/__tests__/format-git-span-data.test.js +0 -121
  399. package/dist/helpers/git/__tests__/format-git-span-data.test.js.map +0 -1
  400. package/dist/helpers/git/__tests__/get-git-data.test.d.ts +0 -1
  401. package/dist/helpers/git/__tests__/get-git-data.test.js +0 -72
  402. package/dist/helpers/git/__tests__/get-git-data.test.js.map +0 -1
  403. /package/dist/{__tests__/cli.test.d.ts → commands/span/cli.d.ts} +0 -0
@@ -1,698 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- const fs_1 = __importDefault(require("fs"));
39
- const fixtures_1 = require("../../../helpers/__tests__/fixtures");
40
- const ciUtils = __importStar(require("../../../helpers/utils"));
41
- const api = __importStar(require("../api"));
42
- const batchUtils = __importStar(require("../batch"));
43
- const errors_1 = require("../errors");
44
- const interfaces_1 = require("../interfaces");
45
- const default_1 = require("../reporters/default");
46
- const junit_1 = require("../reporters/junit");
47
- const appUploadReporterModule = __importStar(require("../reporters/mobile/app-upload"));
48
- const runTests = __importStar(require("../run-tests-lib"));
49
- const testUtils = __importStar(require("../test"));
50
- const tunnel_1 = require("../tunnel");
51
- const internalUtils = __importStar(require("../utils/internal"));
52
- const utils = __importStar(require("../utils/public"));
53
- const fixtures_2 = require("./fixtures");
54
- describe('run-test', () => {
55
- beforeEach(() => {
56
- jest.restoreAllMocks();
57
- jest.spyOn(ciUtils, 'getConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({}); }));
58
- process.env = {};
59
- });
60
- describe('executeTests', () => {
61
- test('should apply config override for tests triggered by public id', () => __awaiter(void 0, void 0, void 0, function* () {
62
- const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
63
- initialSummary: utils.createInitialSummary(),
64
- overriddenTestsToTrigger: [],
65
- tests: [],
66
- }));
67
- jest.spyOn(batchUtils, 'runTests').mockImplementation();
68
- const startUrl = '{{PROTOCOL}}//myhost{{PATHNAME}}{{PARAMS}}';
69
- const locations = ['location1', 'location2'];
70
- const userConfigOverride = { locations, startUrl };
71
- const apiHelper = {};
72
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
73
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: userConfigOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow();
74
- expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
75
- expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: userConfigOverride }),
76
- expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: userConfigOverride }),
77
- ]), expect.anything(), false, false, false);
78
- }));
79
- test('Use appropriate list of locations for tests triggered by public id', () => __awaiter(void 0, void 0, void 0, function* () {
80
- const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
81
- initialSummary: utils.createInitialSummary(),
82
- overriddenTestsToTrigger: [],
83
- tests: [],
84
- }));
85
- const apiHelper = {};
86
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
87
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { locations: ['defaultTestOverrides-location-1'] }, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
88
- expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
89
- expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: { locations: ['defaultTestOverrides-location-1'] } }),
90
- expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: { locations: ['defaultTestOverrides-location-1'] } }),
91
- ]), expect.anything(), false, false, false);
92
- }));
93
- test('should not wait for `skipped` only tests batch results', () => __awaiter(void 0, void 0, void 0, function* () {
94
- const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
95
- initialSummary: utils.createInitialSummary(),
96
- overriddenTestsToTrigger: [],
97
- tests: [],
98
- }));
99
- const apiHelper = {};
100
- const configOverride = { executionRule: interfaces_1.ExecutionRule.SKIPPED };
101
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({}));
102
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: configOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'] }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
103
- expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
104
- expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: configOverride }),
105
- expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: configOverride }),
106
- ]), expect.anything(), false, false, false);
107
- }));
108
- test('should not open tunnel if no test to run', () => __awaiter(void 0, void 0, void 0, function* () {
109
- const getTestsToTriggersMock = jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
110
- initialSummary: utils.createInitialSummary(),
111
- overriddenTestsToTrigger: [],
112
- tests: [],
113
- }));
114
- const apiHelper = {
115
- getTunnelPresignedURL: jest.fn(),
116
- };
117
- const configOverride = { executionRule: interfaces_1.ExecutionRule.SKIPPED };
118
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
119
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: configOverride, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CiError('NO_TESTS_TO_RUN'));
120
- expect(getTestsToTriggersMock).toHaveBeenCalledWith(apiHelper, expect.arrayContaining([
121
- expect.objectContaining({ id: 'aaa-aaa-aaa', testOverrides: configOverride }),
122
- expect.objectContaining({ id: 'bbb-bbb-bbb', testOverrides: configOverride }),
123
- ]), expect.anything(), false, false, true);
124
- expect(apiHelper.getTunnelPresignedURL).not.toHaveBeenCalled();
125
- }));
126
- test('open and close tunnel for successful runs', () => __awaiter(void 0, void 0, void 0, function* () {
127
- jest.spyOn(internalUtils, 'wait').mockImplementation(() => new Promise((res) => setTimeout(res, 10)));
128
- const startTunnelSpy = jest
129
- .spyOn(tunnel_1.Tunnel.prototype, 'start')
130
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
131
- const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
132
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
133
- initialSummary: utils.createInitialSummary(),
134
- overriddenTestsToTrigger: [],
135
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: '123-456-789' }],
136
- }));
137
- jest.spyOn(batchUtils, 'runTests').mockResolvedValue(fixtures_2.mockTestTriggerResponse);
138
- const apiHelper = {
139
- getBatch: () => ({ results: [] }),
140
- getTunnelPresignedURL: () => ({ url: 'url' }),
141
- pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
142
- triggerTests: () => fixtures_2.mockTestTriggerResponse,
143
- };
144
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
145
- yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { failOnCriticalErrors: true, publicIds: ['123-456-789'], tunnel: true }));
146
- expect(startTunnelSpy).toHaveBeenCalledTimes(1);
147
- expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
148
- }));
149
- const cases = [
150
- [403, 'AUTHORIZATION_ERROR'],
151
- [502, 'UNAVAILABLE_TEST_CONFIG'],
152
- ];
153
- describe.each(cases)('%s triggers %s', (status, error) => {
154
- test(`getTestsList throws - ${status}`, () => __awaiter(void 0, void 0, void 0, function* () {
155
- const apiHelper = {
156
- searchTests: jest.fn(() => {
157
- throw (0, fixtures_1.getAxiosError)(status, { message: 'Server Error' });
158
- }),
159
- };
160
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
161
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { testSearchQuery: 'a-search-query', tunnel: true }))).rejects.toThrow(new errors_1.CriticalError(error, 'Server Error'));
162
- }));
163
- test(`getTestsToTrigger throws - ${status}`, () => __awaiter(void 0, void 0, void 0, function* () {
164
- const apiHelper = {
165
- getTest: jest.fn(() => {
166
- throw (0, fixtures_1.getAxiosError)(status, { errors: ['Bad Gateway'] });
167
- }),
168
- };
169
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
170
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError(error, 'Failed to get test: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
171
- }));
172
- });
173
- test('getTunnelPresignedURL throws', () => __awaiter(void 0, void 0, void 0, function* () {
174
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
175
- initialSummary: utils.createInitialSummary(),
176
- overriddenTestsToTrigger: [],
177
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
178
- }));
179
- const apiHelper = {
180
- getTunnelPresignedURL: jest.fn(() => {
181
- throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
182
- }),
183
- };
184
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
185
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('UNAVAILABLE_TUNNEL_CONFIG', 'Server Error'));
186
- }));
187
- test('getMobileApplicationPresignedURLs throws', () => __awaiter(void 0, void 0, void 0, function* () {
188
- const mobileTest = (0, fixtures_2.getMobileTest)();
189
- jest.spyOn(testUtils, 'getTestAndOverrideConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
190
- return Promise.resolve({
191
- overriddenConfig: { executionRule: interfaces_1.ExecutionRule.NON_BLOCKING, public_id: mobileTest.public_id },
192
- test: mobileTest,
193
- });
194
- }));
195
- // use /dev/null to create a valid empty fs.ReadStream
196
- const testStream = fs_1.default.createReadStream('/dev/null');
197
- jest.spyOn(fs_1.default, 'createReadStream').mockReturnValue(testStream);
198
- const { AppUploadReporter } = jest.requireActual('../reporters/mobile/app-upload');
199
- jest
200
- .spyOn(appUploadReporterModule, 'AppUploadReporter')
201
- .mockImplementation(() => new AppUploadReporter({ stdout: { write: jest.fn() } }));
202
- const apiHelper = {
203
- getMobileApplicationPresignedURLs: jest.fn(() => {
204
- throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
205
- }),
206
- };
207
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
208
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { mobileApplicationVersionFilePath: 'filePath' }, publicIds: [mobileTest.public_id] }))).rejects.toThrow('Failed to get presigned URL: could not query https://app.datadoghq.com/example');
209
- }));
210
- test('uploadMobileApplicationPart throws', () => __awaiter(void 0, void 0, void 0, function* () {
211
- const mobileTest = (0, fixtures_2.getMobileTest)();
212
- jest.spyOn(testUtils, 'getTestAndOverrideConfig').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
213
- return Promise.resolve({
214
- overriddenConfig: { executionRule: interfaces_1.ExecutionRule.NON_BLOCKING, public_id: mobileTest.public_id },
215
- test: mobileTest,
216
- });
217
- }));
218
- // use /dev/null to create a valid empty fs.ReadStream
219
- const testStream = fs_1.default.createReadStream('/dev/null');
220
- jest.spyOn(fs_1.default, 'createReadStream').mockReturnValue(testStream);
221
- const { AppUploadReporter } = jest.requireActual('../reporters/mobile/app-upload');
222
- jest
223
- .spyOn(appUploadReporterModule, 'AppUploadReporter')
224
- .mockImplementation(() => new AppUploadReporter({ stdout: { write: jest.fn() } }));
225
- jest.spyOn(fs_1.default.promises, 'readFile').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return Buffer.from('aa'); }));
226
- const apiHelper = {
227
- getMobileApplicationPresignedURLs: jest.fn(() => fixtures_2.MOBILE_PRESIGNED_URLS_PAYLOAD),
228
- uploadMobileApplicationPart: jest.fn(() => {
229
- throw (0, fixtures_1.getAxiosError)(502, { message: 'Server Error' });
230
- }),
231
- };
232
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
233
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides: { mobileApplicationVersionFilePath: 'filePath' }, publicIds: [mobileTest.public_id] }))).rejects.toThrow('Failed to upload mobile application: could not query https://app.datadoghq.com/example');
234
- }));
235
- test('runTests throws', () => __awaiter(void 0, void 0, void 0, function* () {
236
- jest
237
- .spyOn(tunnel_1.Tunnel.prototype, 'start')
238
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
239
- const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
240
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
241
- initialSummary: utils.createInitialSummary(),
242
- overriddenTestsToTrigger: [],
243
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
244
- }));
245
- const apiHelper = {
246
- getTunnelPresignedURL: () => ({ url: 'url' }),
247
- triggerTests: jest.fn(() => {
248
- throw (0, fixtures_1.getAxiosError)(502, { errors: ['Bad Gateway'] });
249
- }),
250
- };
251
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
252
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('TRIGGER_TESTS_FAILED', '[] Failed to trigger tests: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
253
- expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
254
- }));
255
- test('waitForResults throws', () => __awaiter(void 0, void 0, void 0, function* () {
256
- const location = {
257
- display_name: 'us1',
258
- id: 1,
259
- is_active: true,
260
- name: 'us1',
261
- region: 'us1',
262
- };
263
- jest
264
- .spyOn(tunnel_1.Tunnel.prototype, 'start')
265
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return ({ host: 'host', id: 'id', privateKey: 'key' }); }));
266
- const stopTunnelSpy = jest.spyOn(tunnel_1.Tunnel.prototype, 'stop');
267
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
268
- initialSummary: utils.createInitialSummary(),
269
- overriddenTestsToTrigger: [],
270
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'publicId' }],
271
- }));
272
- jest.spyOn(batchUtils, 'runTests').mockReturnValue(Promise.resolve({
273
- batch_id: 'bid',
274
- locations: [location],
275
- }));
276
- const apiHelper = {
277
- getBatch: () => ({ results: [] }),
278
- getTunnelPresignedURL: () => ({ url: 'url' }),
279
- pollResults: jest.fn(() => {
280
- throw (0, fixtures_1.getAxiosError)(502, { errors: ['Bad Gateway'] });
281
- }),
282
- };
283
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
284
- yield expect(runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { failOnCriticalErrors: true, publicIds: ['aaa-aaa-aaa', 'bbb-bbb-bbb'], tunnel: true }))).rejects.toThrow(new errors_1.CriticalError('POLL_RESULTS_FAILED', 'Failed to poll results: query on https://app.datadoghq.com/example returned: "Bad Gateway"\n'));
285
- expect(stopTunnelSpy).toHaveBeenCalledTimes(1);
286
- }));
287
- test('log when selective rerun is rate-limited', () => __awaiter(void 0, void 0, void 0, function* () {
288
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
289
- initialSummary: utils.createInitialSummary(),
290
- overriddenTestsToTrigger: [],
291
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'aaa-aaa-aaa' }],
292
- }));
293
- jest.spyOn(batchUtils, 'runTests').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
294
- return ({
295
- batch_id: 'bid',
296
- locations: [],
297
- selective_rerun_rate_limited: true,
298
- });
299
- }));
300
- const apiHelper = {
301
- getBatch: () => ({ results: [] }),
302
- getTunnelPresignedURL: () => ({ url: 'url' }),
303
- pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
304
- triggerTests: () => fixtures_2.mockTestTriggerResponse,
305
- };
306
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
307
- yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'], selectiveRerun: true }));
308
- expect(fixtures_2.mockReporter.error).toHaveBeenCalledWith('The selective rerun feature was rate-limited. All tests will be re-run.\n\n');
309
- }));
310
- test('selective rerun defaults to undefined', () => __awaiter(void 0, void 0, void 0, function* () {
311
- jest.spyOn(testUtils, 'getTestsToTrigger').mockReturnValue(Promise.resolve({
312
- initialSummary: utils.createInitialSummary(),
313
- overriddenTestsToTrigger: [],
314
- tests: [{ options: { ci: { executionRule: interfaces_1.ExecutionRule.BLOCKING } }, public_id: 'aaa-aaa-aaa' }],
315
- }));
316
- const triggerTestsSpy = jest.fn(() => fixtures_2.mockTestTriggerResponse);
317
- const apiHelper = {
318
- getBatch: () => ({ results: [] }),
319
- getTunnelPresignedURL: () => ({ url: 'url' }),
320
- pollResults: () => [(0, fixtures_2.getApiResult)('1', (0, fixtures_2.getApiTest)())],
321
- triggerTests: triggerTestsSpy,
322
- };
323
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => apiHelper);
324
- yield runTests.executeTests(fixtures_2.mockReporter, Object.assign(Object.assign({}, fixtures_2.ciConfig), { publicIds: ['aaa-aaa-aaa'] }));
325
- expect(triggerTestsSpy).toHaveBeenCalledWith({
326
- tests: [],
327
- options: {
328
- batch_timeout: fixtures_2.ciConfig.batchTimeout,
329
- selective_rerun: undefined,
330
- },
331
- });
332
- }));
333
- });
334
- describe('executeWithDetails', () => {
335
- beforeEach(() => {
336
- jest.restoreAllMocks();
337
- jest.spyOn(api, 'getApiHelper').mockImplementation(() => ({
338
- getSyntheticsOrgSettings: () => ({
339
- onDemandConcurrencyCap: 1,
340
- }),
341
- }));
342
- jest.spyOn(runTests, 'executeTests').mockReturnValue(Promise.resolve({ results: [], summary: {} }));
343
- jest.spyOn(utils, 'renderResults').mockImplementation(jest.fn());
344
- });
345
- test('should call executeTests and renderResults', () => __awaiter(void 0, void 0, void 0, function* () {
346
- yield runTests.executeWithDetails({}, {});
347
- expect(runTests.executeTests).toHaveBeenCalled();
348
- expect(utils.renderResults).toHaveBeenCalled();
349
- }));
350
- test('should extend config', () => __awaiter(void 0, void 0, void 0, function* () {
351
- const runConfig = { apiKey: 'apiKey', appKey: 'appKey' };
352
- yield runTests.executeWithDetails(runConfig, {});
353
- expect(runTests.executeTests).toHaveBeenCalledWith(expect.anything(), expect.objectContaining(runConfig), undefined);
354
- }));
355
- test('should bypass files if suite is passed', () => __awaiter(void 0, void 0, void 0, function* () {
356
- const suites = [{ content: { tests: [] } }];
357
- yield runTests.executeWithDetails({}, { suites });
358
- expect(runTests.executeTests).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ files: [] }), suites);
359
- }));
360
- test('should return values returned by executeTests, and an exitCode', () => __awaiter(void 0, void 0, void 0, function* () {
361
- const returnValue = yield runTests.executeWithDetails({}, {});
362
- expect(returnValue.results).toBeDefined();
363
- expect(returnValue.summary).toBeDefined();
364
- expect(returnValue.exitCode).toBeDefined();
365
- }));
366
- describe('reporters', () => {
367
- beforeEach(() => {
368
- jest.spyOn(utils, 'getReporter').mockImplementation(jest.fn());
369
- });
370
- test('should use default reporter with empty config', () => __awaiter(void 0, void 0, void 0, function* () {
371
- yield runTests.executeWithDetails({}, {});
372
- expect(utils.getReporter).toHaveBeenCalledWith(expect.arrayContaining([expect.any(default_1.DefaultReporter)]));
373
- }));
374
- test('should use custom reporters', () => __awaiter(void 0, void 0, void 0, function* () {
375
- const CustomReporter = {};
376
- yield runTests.executeWithDetails({}, { reporters: ['junit', CustomReporter] });
377
- expect(utils.getReporter).toHaveBeenCalledWith(expect.arrayContaining([expect.any(junit_1.JUnitReporter), CustomReporter]));
378
- }));
379
- });
380
- });
381
- describe('execute', () => {
382
- beforeEach(() => {
383
- jest.restoreAllMocks();
384
- jest
385
- .spyOn(runTests, 'executeWithDetails')
386
- .mockReturnValue(Promise.resolve({ results: [], summary: {}, exitCode: 0 }));
387
- });
388
- test('should call executeWithDetails', () => __awaiter(void 0, void 0, void 0, function* () {
389
- yield runTests.execute({}, {});
390
- expect(runTests.executeWithDetails).toHaveBeenCalled();
391
- }));
392
- test('should return the exitCode returned by executeWithDetails', () => __awaiter(void 0, void 0, void 0, function* () {
393
- const returnValue = yield runTests.execute({}, {});
394
- expect(returnValue).toBe(0);
395
- }));
396
- });
397
- describe('getTriggerConfigs', () => {
398
- beforeEach(() => {
399
- jest.restoreAllMocks();
400
- });
401
- const startUrl = 'fakeUrl';
402
- const locations = ['aws:ap-northeast-1'];
403
- const conf1 = {
404
- tests: [{ testOverrides: { deviceIds: ['chrome.laptop_large'] }, id: 'abc-def-ghi' }],
405
- };
406
- const conf2 = {
407
- tests: [{ testOverrides: { startUrl: 'someOtherFakeUrl' }, id: 'jkl-mno-pqr' }],
408
- };
409
- const fakeSuites = [
410
- {
411
- content: conf1,
412
- name: 'Suite 1',
413
- },
414
- {
415
- content: conf2,
416
- name: 'Suite 2',
417
- },
418
- ];
419
- const fakeApi = {
420
- searchTests: () => ({
421
- tests: [
422
- {
423
- public_id: 'stu-vwx-yza',
424
- },
425
- ],
426
- }),
427
- };
428
- test('should extend global config and execute all tests from test config files when no clue what to run', () => __awaiter(void 0, void 0, void 0, function* () {
429
- const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
430
- const defaultTestOverrides = { locations, startUrl };
431
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides }), fixtures_2.mockReporter)).resolves.toEqual([
432
- {
433
- testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl, locations },
434
- id: 'abc-def-ghi',
435
- suite: 'Suite 1',
436
- },
437
- {
438
- testOverrides: { startUrl: 'someOtherFakeUrl', locations },
439
- id: 'jkl-mno-pqr',
440
- suite: 'Suite 2',
441
- },
442
- ]);
443
- expect(getSuitesMock).toHaveBeenCalledTimes(1);
444
- expect(getSuitesMock).toHaveBeenCalledWith('{,!(node_modules)/**/}*.synthetics.json', fixtures_2.mockReporter);
445
- }));
446
- test('should override and execute only publicIds that were defined in the global config', () => __awaiter(void 0, void 0, void 0, function* () {
447
- const getSuitesMock = jest.spyOn(utils, 'getSuites');
448
- const defaultTestOverrides = { locations, startUrl };
449
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, publicIds: ['abc-def-ghi', '123-456-789'] }), fixtures_2.mockReporter)).resolves.toEqual([
450
- {
451
- testOverrides: { startUrl, locations },
452
- id: 'abc-def-ghi',
453
- },
454
- {
455
- testOverrides: { startUrl, locations },
456
- id: '123-456-789',
457
- },
458
- ]);
459
- expect(getSuitesMock).toHaveBeenCalledTimes(0);
460
- }));
461
- test('should override and execute only publicIds that were defined in the global config and use given globs', () => __awaiter(void 0, void 0, void 0, function* () {
462
- const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
463
- const defaultTestOverrides = { locations, startUrl };
464
- const files = ['glob'];
465
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides,
466
- files, publicIds: ['abc-def-ghi'] }), fixtures_2.mockReporter)).resolves.toEqual([
467
- {
468
- testOverrides: { startUrl, locations, deviceIds: ['chrome.laptop_large'] },
469
- id: 'abc-def-ghi',
470
- suite: 'Suite 1',
471
- },
472
- ]);
473
- expect(getSuitesMock).toHaveBeenCalledTimes(1);
474
- expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
475
- }));
476
- test('should search tests and extend global config', () => __awaiter(void 0, void 0, void 0, function* () {
477
- const getSuitesMock = jest.spyOn(utils, 'getSuites');
478
- const defaultTestOverrides = { locations, startUrl };
479
- const searchQuery = 'fake search';
480
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
481
- {
482
- testOverrides: { locations, startUrl },
483
- id: 'stu-vwx-yza',
484
- suite: 'Query: fake search',
485
- },
486
- ]);
487
- expect(getSuitesMock).toHaveBeenCalledTimes(0);
488
- }));
489
- test('should not use testSearchQuery if global config has defined publicIds', () => __awaiter(void 0, void 0, void 0, function* () {
490
- const defaultTestOverrides = { startUrl };
491
- const searchQuery = 'fake search';
492
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, publicIds: ['abc-def-ghi'], testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
493
- {
494
- testOverrides: { startUrl },
495
- id: 'abc-def-ghi',
496
- },
497
- ]);
498
- }));
499
- test('should search tests with testSearchQuery and use given globs', () => __awaiter(void 0, void 0, void 0, function* () {
500
- const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
501
- const defaultTestOverrides = { startUrl };
502
- const searchQuery = 'fake search';
503
- const files = ['glob'];
504
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides,
505
- files, testSearchQuery: searchQuery }), fixtures_2.mockReporter)).resolves.toEqual([
506
- {
507
- testOverrides: { startUrl },
508
- id: 'stu-vwx-yza',
509
- suite: 'Query: fake search',
510
- },
511
- ]);
512
- expect(getSuitesMock).toHaveBeenCalledTimes(1);
513
- expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
514
- }));
515
- test('should use given globs to get tests list', () => __awaiter(void 0, void 0, void 0, function* () {
516
- const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(fakeSuites);
517
- const defaultTestOverrides = { startUrl };
518
- const files = ['new glob', 'another one'];
519
- yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter);
520
- expect(getSuitesMock).toHaveBeenCalledTimes(2);
521
- expect(getSuitesMock).toHaveBeenCalledWith('new glob', fixtures_2.mockReporter);
522
- expect(getSuitesMock).toHaveBeenCalledWith('another one', fixtures_2.mockReporter);
523
- }));
524
- test('should return tests from provided suites with overrides', () => __awaiter(void 0, void 0, void 0, function* () {
525
- const getSuitesMock = jest.spyOn(utils, 'getSuites');
526
- const defaultTestOverrides = { startUrl };
527
- const files = [];
528
- const tests = yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter, fakeSuites);
529
- expect(tests).toEqual([
530
- {
531
- testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl },
532
- id: conf1.tests[0].id,
533
- suite: fakeSuites[0].name,
534
- },
535
- { testOverrides: { startUrl: 'someOtherFakeUrl' }, id: conf2.tests[0].id, suite: fakeSuites[1].name },
536
- ]);
537
- expect(getSuitesMock).toHaveBeenCalledTimes(0);
538
- }));
539
- test('should merge getSuites and user provided suites', () => __awaiter(void 0, void 0, void 0, function* () {
540
- const userSuites = [fakeSuites[0]];
541
- const globSuites = [fakeSuites[1]];
542
- const getSuitesMock = jest.spyOn(utils, 'getSuites').mockResolvedValue(globSuites);
543
- const defaultTestOverrides = { startUrl };
544
- const files = ['glob'];
545
- const tests = yield runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides, files }), fixtures_2.mockReporter, userSuites);
546
- expect(tests).toEqual([
547
- {
548
- testOverrides: { deviceIds: ['chrome.laptop_large'], startUrl },
549
- id: conf1.tests[0].id,
550
- suite: fakeSuites[0].name,
551
- },
552
- { testOverrides: { startUrl: 'someOtherFakeUrl' }, id: conf2.tests[0].id, suite: fakeSuites[1].name },
553
- ]);
554
- expect(getSuitesMock).toHaveBeenCalledTimes(1);
555
- expect(getSuitesMock).toHaveBeenCalledWith('glob', fixtures_2.mockReporter);
556
- }));
557
- test('should handle test configurations with the same test ID correctly', () => __awaiter(void 0, void 0, void 0, function* () {
558
- const suite = {
559
- name: 'Suite with duplicate IDs',
560
- content: {
561
- tests: [
562
- {
563
- id: 'abc-abc-abc',
564
- testOverrides: {
565
- allowInsecureCertificates: true,
566
- basicAuth: { username: 'test', password: 'test' },
567
- body: '{"fakeContent":true}',
568
- bodyType: 'application/json',
569
- cookies: 'name1=value1;name2=value2;',
570
- setCookies: 'name1=value1 \n name2=value2; Secure',
571
- defaultStepTimeout: 15,
572
- deviceIds: ['chrome.laptop_large'],
573
- executionRule: interfaces_1.ExecutionRule.NON_BLOCKING,
574
- followRedirects: true,
575
- headers: { NEW_HEADER: 'NEW VALUE' },
576
- locations: ['aws:us-east-1'],
577
- mobileApplicationVersion: '01234567-8888-9999-abcd-efffffffffff',
578
- mobileApplicationVersionFilePath: 'path/to/application.apk',
579
- retry: { count: 2, interval: 300 },
580
- testTimeout: 300,
581
- variables: { MY_VARIABLE: 'new title' },
582
- },
583
- },
584
- {
585
- id: 'abc-abc-abc',
586
- testOverrides: {
587
- executionRule: interfaces_1.ExecutionRule.SKIPPED,
588
- },
589
- },
590
- ],
591
- },
592
- };
593
- jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
594
- const defaultTestOverrides = { locations: ['aws:us-east-1'], startUrl: 'fakeUrl' };
595
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { defaultTestOverrides }), fixtures_2.mockReporter)).resolves.toEqual([
596
- {
597
- testOverrides: {
598
- allowInsecureCertificates: true,
599
- basicAuth: { username: 'test', password: 'test' },
600
- body: '{"fakeContent":true}',
601
- bodyType: 'application/json',
602
- cookies: 'name1=value1;name2=value2;',
603
- setCookies: 'name1=value1 \n name2=value2; Secure',
604
- defaultStepTimeout: 15,
605
- deviceIds: ['chrome.laptop_large'],
606
- executionRule: 'non_blocking',
607
- followRedirects: true,
608
- headers: { NEW_HEADER: 'NEW VALUE' },
609
- locations: ['aws:us-east-1'],
610
- mobileApplicationVersion: '01234567-8888-9999-abcd-efffffffffff',
611
- mobileApplicationVersionFilePath: 'path/to/application.apk',
612
- retry: { count: 2, interval: 300 },
613
- testTimeout: 300,
614
- variables: { MY_VARIABLE: 'new title' },
615
- startUrl: 'fakeUrl',
616
- },
617
- id: 'abc-abc-abc',
618
- suite: 'Suite with duplicate IDs',
619
- },
620
- {
621
- testOverrides: {
622
- executionRule: 'skipped',
623
- startUrl: 'fakeUrl',
624
- locations: ['aws:us-east-1'],
625
- },
626
- id: 'abc-abc-abc',
627
- suite: 'Suite with duplicate IDs',
628
- },
629
- ]);
630
- }));
631
- test('should handle local test definitions', () => __awaiter(void 0, void 0, void 0, function* () {
632
- const localTestDefinition = (0, fixtures_2.getApiTest)('bbb-bbb-bbb');
633
- const suite = {
634
- name: 'Suite with local test definitions',
635
- content: {
636
- tests: [
637
- {
638
- id: 'aaa-aaa-aaa',
639
- testOverrides: {
640
- startUrl: 'fakeUrl',
641
- },
642
- },
643
- {
644
- localTestDefinition,
645
- testOverrides: {
646
- startUrl: 'fakeUrl',
647
- },
648
- },
649
- ],
650
- },
651
- };
652
- jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
653
- yield expect(runTests.getTriggerConfigs(fakeApi, fixtures_2.ciConfig, fixtures_2.mockReporter)).resolves.toEqual([
654
- {
655
- id: 'aaa-aaa-aaa',
656
- suite: 'Suite with local test definitions',
657
- testOverrides: { startUrl: 'fakeUrl' },
658
- },
659
- {
660
- localTestDefinition,
661
- suite: 'Suite with local test definitions',
662
- testOverrides: { startUrl: 'fakeUrl' },
663
- },
664
- ]);
665
- }));
666
- test('should handle local test definitions selected with publicIds', () => __awaiter(void 0, void 0, void 0, function* () {
667
- const localTestDefinition = (0, fixtures_2.getApiTest)('bbb-bbb-bbb');
668
- const suite = {
669
- name: 'Suite with local test definitions',
670
- content: {
671
- tests: [
672
- {
673
- id: 'aaa-aaa-aaa',
674
- testOverrides: {
675
- startUrl: 'fakeUrl',
676
- },
677
- },
678
- {
679
- localTestDefinition,
680
- testOverrides: {
681
- startUrl: 'fakeUrl',
682
- },
683
- },
684
- ],
685
- },
686
- };
687
- jest.spyOn(utils, 'getSuites').mockResolvedValue([suite]);
688
- yield expect(runTests.getTriggerConfigs(fakeApi, Object.assign(Object.assign({}, fixtures_2.ciConfig), { files: ['glob'], publicIds: ['bbb-bbb-bbb'] }), fixtures_2.mockReporter)).resolves.toEqual([
689
- {
690
- localTestDefinition,
691
- suite: 'Suite with local test definitions',
692
- testOverrides: { startUrl: 'fakeUrl' },
693
- },
694
- ]);
695
- }));
696
- });
697
- });
698
- //# sourceMappingURL=run-tests-lib.test.js.map