@alwaysmeticulous/cli 2.259.0 → 2.260.1

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 (119) hide show
  1. package/dist/{utils → command-utils}/sentry.utils.d.ts +1 -1
  2. package/dist/command-utils/sentry.utils.js.map +1 -0
  3. package/dist/commands/auth/index.d.ts +2 -0
  4. package/dist/commands/auth/index.js +14 -0
  5. package/dist/commands/auth/index.js.map +1 -0
  6. package/dist/commands/auth/logout.command.d.ts +2 -0
  7. package/dist/commands/auth/logout.command.js +17 -0
  8. package/dist/commands/auth/logout.command.js.map +1 -0
  9. package/dist/commands/auth/whoami.command.d.ts +2 -0
  10. package/dist/commands/auth/whoami.command.js +41 -0
  11. package/dist/commands/auth/whoami.command.js.map +1 -0
  12. package/dist/commands/ci/index.d.ts +2 -0
  13. package/dist/commands/ci/index.js +26 -0
  14. package/dist/commands/ci/index.js.map +1 -0
  15. package/dist/commands/ci/prepare.command.d.ts +15 -0
  16. package/dist/commands/{prepare-for-meticulous-tests/prepare-for-meticulous-tests.command.js → ci/prepare.command.js} +22 -31
  17. package/dist/commands/ci/prepare.command.js.map +1 -0
  18. package/dist/commands/ci/run-local.command.d.ts +23 -0
  19. package/dist/commands/{run-all-tests/run-all-tests.command.js → ci/run-local.command.js} +64 -63
  20. package/dist/commands/ci/run-local.command.js.map +1 -0
  21. package/dist/commands/ci/run.command.d.ts +22 -0
  22. package/dist/commands/{run-all-tests-in-cloud/run-all-tests-in-cloud.command.js → ci/run.command.js} +97 -111
  23. package/dist/commands/ci/run.command.js.map +1 -0
  24. package/dist/commands/ci/start-tunnel.command.d.ts +21 -0
  25. package/dist/commands/ci/start-tunnel.command.js +142 -0
  26. package/dist/commands/ci/start-tunnel.command.js.map +1 -0
  27. package/dist/commands/ci/upload-assets.command.d.ts +14 -0
  28. package/dist/commands/{upload-assets-and-execute-test-run-in-cloud/upload-assets-and-execute-test-run-in-cloud.command.js → ci/upload-assets.command.js} +46 -54
  29. package/dist/commands/ci/upload-assets.command.js.map +1 -0
  30. package/dist/commands/ci/upload-container.command.d.ts +15 -0
  31. package/dist/commands/{upload-container-and-execute-test-run-in-cloud/upload-container-and-execute-test-run-in-cloud.command.js → ci/upload-container.command.js} +53 -62
  32. package/dist/commands/ci/upload-container.command.js.map +1 -0
  33. package/dist/commands/deprecated-aliases.d.ts +2 -0
  34. package/dist/commands/deprecated-aliases.js +27 -0
  35. package/dist/commands/deprecated-aliases.js.map +1 -0
  36. package/dist/commands/download/index.d.ts +2 -0
  37. package/dist/commands/download/index.js +20 -0
  38. package/dist/commands/download/index.js.map +1 -0
  39. package/dist/commands/download/replay.command.d.ts +7 -0
  40. package/dist/commands/{download-replay/download-replay.command.js → download/replay.command.js} +17 -23
  41. package/dist/commands/download/replay.command.js.map +1 -0
  42. package/dist/commands/download/session.command.d.ts +7 -0
  43. package/dist/commands/download/session.command.js +32 -0
  44. package/dist/commands/download/session.command.js.map +1 -0
  45. package/dist/commands/download/test-run.command.d.ts +8 -0
  46. package/dist/commands/{download-test-run/download-test-run.command.js → download/test-run.command.js} +21 -21
  47. package/dist/commands/download/test-run.command.js.map +1 -0
  48. package/dist/commands/project/index.d.ts +2 -0
  49. package/dist/commands/project/index.js +13 -0
  50. package/dist/commands/project/index.js.map +1 -0
  51. package/dist/commands/project/show.command.d.ts +6 -0
  52. package/dist/commands/project/show.command.js +26 -0
  53. package/dist/commands/project/show.command.js.map +1 -0
  54. package/dist/commands/record/index.d.ts +2 -0
  55. package/dist/commands/record/index.js +18 -0
  56. package/dist/commands/record/index.js.map +1 -0
  57. package/dist/commands/record/login.command.d.ts +14 -0
  58. package/dist/commands/{record-login/record-login.command.js → record/login.command.js} +16 -31
  59. package/dist/commands/record/login.command.js.map +1 -0
  60. package/dist/commands/record/session.command.d.ts +17 -0
  61. package/dist/commands/record/{record.command.js → session.command.js} +16 -37
  62. package/dist/commands/record/session.command.js.map +1 -0
  63. package/dist/commands/{replay/utils/replay-debugger.ui.js → replay-debugger.ui.js} +2 -7
  64. package/dist/commands/replay-debugger.ui.js.map +1 -0
  65. package/dist/commands/replay.command.d.ts +25 -0
  66. package/dist/commands/{replay/replay.command.js → replay.command.js} +77 -82
  67. package/dist/commands/replay.command.js.map +1 -0
  68. package/dist/index.d.ts +4 -7
  69. package/dist/index.js +8 -14
  70. package/dist/index.js.map +1 -1
  71. package/dist/main.d.ts +1 -1
  72. package/dist/main.js +20 -33
  73. package/dist/main.js.map +1 -1
  74. package/package.json +5 -5
  75. package/dist/command-utils/command-builder.d.ts +0 -10
  76. package/dist/command-utils/command-builder.js +0 -20
  77. package/dist/command-utils/command-builder.js.map +0 -1
  78. package/dist/commands/download-replay/download-replay.command.d.ts +0 -10
  79. package/dist/commands/download-replay/download-replay.command.js.map +0 -1
  80. package/dist/commands/download-session/download-session.command.d.ts +0 -10
  81. package/dist/commands/download-session/download-session.command.js +0 -33
  82. package/dist/commands/download-session/download-session.command.js.map +0 -1
  83. package/dist/commands/download-test-run/download-test-run.command.d.ts +0 -17
  84. package/dist/commands/download-test-run/download-test-run.command.js.map +0 -1
  85. package/dist/commands/logout/logout.command.d.ts +0 -2
  86. package/dist/commands/logout/logout.command.js +0 -18
  87. package/dist/commands/logout/logout.command.js.map +0 -1
  88. package/dist/commands/prepare-for-meticulous-tests/prepare-for-meticulous-tests.command.d.ts +0 -22
  89. package/dist/commands/prepare-for-meticulous-tests/prepare-for-meticulous-tests.command.js.map +0 -1
  90. package/dist/commands/record/record.command.d.ts +0 -67
  91. package/dist/commands/record/record.command.js.map +0 -1
  92. package/dist/commands/record-login/record-login.command.d.ts +0 -56
  93. package/dist/commands/record-login/record-login.command.js.map +0 -1
  94. package/dist/commands/replay/replay.command.d.ts +0 -161
  95. package/dist/commands/replay/replay.command.js.map +0 -1
  96. package/dist/commands/replay/utils/replay-debugger.ui.js.map +0 -1
  97. package/dist/commands/run-all-tests/run-all-tests.command.d.ts +0 -140
  98. package/dist/commands/run-all-tests/run-all-tests.command.js.map +0 -1
  99. package/dist/commands/run-all-tests-in-cloud/run-all-tests-in-cloud.command.d.ts +0 -87
  100. package/dist/commands/run-all-tests-in-cloud/run-all-tests-in-cloud.command.js.map +0 -1
  101. package/dist/commands/show-project/show-project.command.d.ts +0 -6
  102. package/dist/commands/show-project/show-project.command.js +0 -27
  103. package/dist/commands/show-project/show-project.command.js.map +0 -1
  104. package/dist/commands/start-local-tunnel/start-local-tunnel.command.d.ts +0 -81
  105. package/dist/commands/start-local-tunnel/start-local-tunnel.command.js +0 -144
  106. package/dist/commands/start-local-tunnel/start-local-tunnel.command.js.map +0 -1
  107. package/dist/commands/upload-assets-and-execute-test-run-in-cloud/upload-assets-and-execute-test-run-in-cloud.command.d.ts +0 -46
  108. package/dist/commands/upload-assets-and-execute-test-run-in-cloud/upload-assets-and-execute-test-run-in-cloud.command.js.map +0 -1
  109. package/dist/commands/upload-container-and-execute-test-run-in-cloud/upload-container-and-execute-test-run-in-cloud.command.d.ts +0 -50
  110. package/dist/commands/upload-container-and-execute-test-run-in-cloud/upload-container-and-execute-test-run-in-cloud.command.js.map +0 -1
  111. package/dist/commands/whoami/whoami.command.d.ts +0 -2
  112. package/dist/commands/whoami/whoami.command.js +0 -42
  113. package/dist/commands/whoami/whoami.command.js.map +0 -1
  114. package/dist/utils/npm-set-script.utils.d.ts +0 -4
  115. package/dist/utils/npm-set-script.utils.js +0 -17
  116. package/dist/utils/npm-set-script.utils.js.map +0 -1
  117. package/dist/utils/sentry.utils.js.map +0 -1
  118. /package/dist/{utils → command-utils}/sentry.utils.js +0 -0
  119. /package/dist/commands/{replay/utils/replay-debugger.ui.d.ts → replay-debugger.ui.d.ts} +0 -0
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.runAllTestsInCloudCommand = void 0;
29
+ exports.ciRunCommand = void 0;
30
30
  const api_1 = require("@alwaysmeticulous/api");
31
31
  const client_1 = require("@alwaysmeticulous/client");
32
32
  const common_1 = require("@alwaysmeticulous/common");
@@ -35,11 +35,11 @@ const Sentry = __importStar(require("@sentry/node"));
35
35
  const chalk_1 = __importDefault(require("chalk"));
36
36
  const cli_progress_1 = __importDefault(require("cli-progress"));
37
37
  const ora_1 = __importDefault(require("ora"));
38
- const command_builder_1 = require("../../command-utils/command-builder");
39
38
  const common_options_1 = require("../../command-utils/common-options");
39
+ const sentry_utils_1 = require("../../command-utils/sentry.utils");
40
40
  const environment_utils_1 = require("../../utils/environment.utils");
41
41
  const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
42
- const prepare_for_meticulous_tests_command_1 = require("../prepare-for-meticulous-tests/prepare-for-meticulous-tests.command");
42
+ const prepare_command_1 = require("./prepare.command");
43
43
  const POLL_FOR_BASE_TEST_RUN_INTERVAL_MS = 10000;
44
44
  const POLL_FOR_BASE_TEST_RUN_MAX_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes
45
45
  const environmentToString = (environment) => {
@@ -48,7 +48,7 @@ const environmentToString = (environment) => {
48
48
  }
49
49
  return "cli-local";
50
50
  };
51
- const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHost, keepTunnelOpenSec, allowInvalidCert, proxyAllUrls, rewriteHostnameToAppUrl, enableDnsCache, http2Connections, silenceTunnelWorker, companionAssetsFolder, companionAssetsZip, companionAssetsRegex, hadPreparedForTests, triggerScript, postComment, redactPassword, }) => {
51
+ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHost, keepTunnelOpenSec, allowInvalidCert, proxyAllUrls, rewriteHostnameToAppUrl, http2Connections, silenceTunnelWorker, companionAssetsFolder, companionAssetsZip, companionAssetsRegex, hadPreparedForTests, triggerScript, postComment, redactPassword, }) => {
52
52
  const logger = (0, common_1.initLogger)();
53
53
  const commitSha = await (0, common_1.getCommitSha)(commitSha_);
54
54
  if (!!companionAssetsFolder && !!companionAssetsZip) {
@@ -69,14 +69,14 @@ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHo
69
69
  logger.error("You must provide an API token by using the --apiToken parameter");
70
70
  process.exit(1);
71
71
  }
72
+ // If we have a script to trigger a run, this signals that the user is not sure whether the base test run is available.
73
+ // In this case, we trigger the preparation for meticulous tests.
74
+ // Do this only if we did not prepare for the tests.
75
+ // Skip if METICULOUS_DISABLE_RECURSIVE_TRIGGER is set to prevent infinite recursion.
72
76
  if (!hadPreparedForTests &&
73
77
  triggerScript &&
74
78
  !process.env.METICULOUS_DISABLE_RECURSIVE_TRIGGER) {
75
- // If we have a script to trigger a run, this signals that the user is not sure whether the base test run is available.
76
- // In this case, we trigger the preparation for meticulous tests.
77
- // Do this only if we did not prepare for the tests.
78
- // Skip if METICULOUS_DISABLE_RECURSIVE_TRIGGER is set to prevent infinite recursion.
79
- await (0, prepare_for_meticulous_tests_command_1.prepareForMeticulousTests)({
79
+ await (0, prepare_command_1.prepareForMeticulousTests)({
80
80
  apiToken: apiToken_,
81
81
  headCommit: commitSha,
82
82
  triggerScript,
@@ -92,10 +92,10 @@ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHo
92
92
  let scheduledTestRunSpinner = (0, ora_1.default)("Starting test run execution").start();
93
93
  const progressBar = new cli_progress_1.default.SingleBar({
94
94
  format: `Test Run execution progress |${chalk_1.default.cyan("{bar}")}| {percentage}% || {value}/{total} tests executed`,
95
- // We want to still output progress even if not connected to a interactive tty since some CI runners
95
+ // We want to still output progress even if not connected to an interactive tty since some CI runners
96
96
  // such as CircleCI will timeout the process early if it hasn't outputted anything for a while.
97
97
  // You can test this by running:
98
- // `pnpm cli:dev run-all-tests-in-cloud --appUrl <your app URL> --commitSha <a valid commit SHA> 2>&1 | cat`
98
+ // `pnpm cli:dev ci run-with-tunnel --appUrl <your app URL> --commitSha <a valid commit SHA> 2>&1 | cat`
99
99
  noTTYOutput: true,
100
100
  notTTYSchedule: 30000,
101
101
  }, cli_progress_1.default.Presets.shades_classic);
@@ -104,13 +104,12 @@ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHo
104
104
  progressBar.stop();
105
105
  };
106
106
  const keepTunnelOpenPromise = keepTunnelOpenSec > 0 ? (0, common_1.defer)() : null;
107
- // Tunnel data set after within the onTunnelCreated callback below.
107
+ // Tunnel data set within the onTunnelCreated callback below.
108
108
  let lastPrintedStillSchedulingMessage = Date.now();
109
109
  let tunnelData = null;
110
110
  try {
111
111
  const environment = (0, environment_utils_1.getEnvironment)();
112
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
113
- const { testRun } = await (0, remote_replay_launcher_1.executeRemoteTestRun)({
112
+ await (0, remote_replay_launcher_1.executeRemoteTestRun)({
114
113
  apiToken: apiToken_,
115
114
  commitSha,
116
115
  appUrl,
@@ -175,7 +174,7 @@ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHo
175
174
  allowInvalidCert,
176
175
  proxyAllUrls,
177
176
  rewriteHostnameToAppUrl,
178
- enableDnsCache,
177
+ enableDnsCache: true,
179
178
  http2Connections,
180
179
  silenceTunnelWorker,
181
180
  ...(postComment ? { postComment } : {}),
@@ -204,8 +203,8 @@ const handler = async ({ apiToken, commitSha: commitSha_, appUrl, secureTunnelHo
204
203
  };
205
204
  /**
206
205
  * Waits for base run to be available, polling until found or timeout.
207
- * Timeout is set to 30 minutes, and after that we just proceed without a base.
208
- * Projects that are not hosted on Github are not currently supported.
206
+ * Timeout is set to 30 minutes; after that we proceed without a base.
207
+ * Non-GitHub-hosted projects are not currently supported.
209
208
  */
210
209
  const waitForBase = async ({ apiToken, commitSha, logger, }) => {
211
210
  const client = (0, client_1.createClient)({ apiToken });
@@ -223,10 +222,7 @@ const waitForBase = async ({ apiToken, commitSha, logger, }) => {
223
222
  const timeoutError = new Error(`Timed out after ${POLL_FOR_BASE_TEST_RUN_MAX_TIMEOUT_MS / 1000} seconds waiting for base test run`);
224
223
  logger.error(timeoutError.message);
225
224
  Sentry.captureException(timeoutError, {
226
- tags: {
227
- command: "run-all-tests-in-cloud",
228
- failureType: "base-test-run-timeout",
229
- },
225
+ tags: { command: "ci run-with-tunnel", failureType: "base-test-run-timeout" },
230
226
  extra: {
231
227
  commitSha,
232
228
  timeoutMs: POLL_FOR_BASE_TEST_RUN_MAX_TIMEOUT_MS,
@@ -236,7 +232,7 @@ const waitForBase = async ({ apiToken, commitSha, logger, }) => {
236
232
  // We proceed without base
237
233
  break;
238
234
  }
239
- if (lastTimeElapsed == 0 || timeElapsed - lastTimeElapsed >= 30000) {
235
+ if (lastTimeElapsed === 0 || timeElapsed - lastTimeElapsed >= 30000) {
240
236
  // Log at most once every 30 seconds
241
237
  logger.info(`Waiting for base test run to be created. Time elapsed: ${timeElapsed}ms`);
242
238
  lastTimeElapsed = timeElapsed;
@@ -252,10 +248,7 @@ const waitForBase = async ({ apiToken, commitSha, logger, }) => {
252
248
  Sentry.captureEvent({
253
249
  message: "Base test run found after waiting for it",
254
250
  level: "info",
255
- tags: {
256
- command: "run-all-tests-in-cloud",
257
- eventType: "base-test-run-found",
258
- },
251
+ tags: { command: "ci run-with-tunnel", eventType: "base-test-run-found" },
259
252
  extra: {
260
253
  commitSha,
261
254
  baseCommitSha: cloudReplayBaseTestRun.baseCommitSha,
@@ -266,89 +259,82 @@ const waitForBase = async ({ apiToken, commitSha, logger, }) => {
266
259
  }
267
260
  }
268
261
  };
269
- exports.runAllTestsInCloudCommand = (0, command_builder_1.buildCommand)("run-all-tests-in-cloud")
270
- .details({ describe: "Run all replay test cases remotely" })
271
- .options({
272
- apiToken: common_options_1.OPTIONS.apiToken,
273
- commitSha: common_options_1.OPTIONS.commitSha,
274
- appUrl: {
275
- demandOption: true,
276
- string: true,
277
- description: "The URL to execute the tests against. This parameter is required.",
278
- },
279
- keepTunnelOpenSec: {
280
- number: true,
281
- description: "Keep the tunnel open after test completion for the specified number of seconds. This is useful for debugging",
282
- default: 0,
283
- },
284
- secureTunnelHost: {
285
- string: true,
286
- description: "The host to use for the secure tunnel server.",
287
- },
288
- allowInvalidCert: {
289
- boolean: true,
290
- description: "Allow the tunnel to accept invalid certificates.",
291
- default: false,
292
- },
293
- proxyAllUrls: {
294
- boolean: true,
295
- description: "Allow all URLs to be proxied to rather than just the app URL.",
296
- default: false,
297
- },
298
- rewriteHostnameToAppUrl: {
299
- boolean: true,
300
- description: "Rewrite the hostname of any requests sent through the tunnel to the app URL.",
301
- default: false,
302
- },
303
- enableDnsCache: {
304
- boolean: true,
305
- description: "Enable DNS caching, this is recommended if the tunnel will be making requests to a non-localhost domain",
306
- default: false,
307
- },
308
- http2Connections: {
309
- number: true,
310
- description: "Number of HTTP2 connections to establish for multiplexing (defaults to number of CPU cores)",
262
+ exports.ciRunCommand = {
263
+ command: "run-with-tunnel",
264
+ describe: "Run all replay test cases in the cloud",
265
+ builder: {
266
+ apiToken: common_options_1.OPTIONS.apiToken,
267
+ commitSha: common_options_1.OPTIONS.commitSha,
268
+ appUrl: {
269
+ demandOption: true,
270
+ string: true,
271
+ description: "The URL to execute the tests against. This parameter is required.",
272
+ },
273
+ keepTunnelOpenSec: {
274
+ number: true,
275
+ description: "Keep the tunnel open after test completion for the specified number of seconds. Useful for debugging.",
276
+ default: 0,
277
+ },
278
+ secureTunnelHost: {
279
+ string: true,
280
+ description: "The host to use for the secure tunnel server.",
281
+ },
282
+ allowInvalidCert: {
283
+ boolean: true,
284
+ description: "Allow the tunnel to accept invalid certificates.",
285
+ default: false,
286
+ },
287
+ proxyAllUrls: {
288
+ boolean: true,
289
+ description: "Allow all URLs to be proxied rather than just the app URL.",
290
+ default: false,
291
+ },
292
+ rewriteHostnameToAppUrl: {
293
+ boolean: true,
294
+ description: "Rewrite the hostname of any requests sent through the tunnel to the app URL.",
295
+ default: false,
296
+ },
297
+ http2Connections: {
298
+ number: true,
299
+ description: "Number of HTTP2 connections to establish for multiplexing (defaults to number of CPU cores).",
300
+ },
301
+ silenceTunnelWorker: {
302
+ boolean: true,
303
+ description: "Suppress logs from tunnel worker processes.",
304
+ default: false,
305
+ },
306
+ companionAssetsFolder: {
307
+ string: true,
308
+ description: "The folder to serve the companion assets from.",
309
+ },
310
+ companionAssetsZip: {
311
+ string: true,
312
+ description: "The zip file to serve the companion assets from.",
313
+ },
314
+ companionAssetsRegex: {
315
+ string: true,
316
+ description: "The regex to match the companion assets.",
317
+ },
318
+ hadPreparedForTests: {
319
+ boolean: true,
320
+ description: "Enable if you called `meticulous ci prepare` before running this command.",
321
+ default: false,
322
+ },
323
+ triggerScript: {
324
+ string: true,
325
+ description: "Path to script that triggers the generation of a Meticulous test run on a specific commit in case base test run is not available. The script will be called with the commit SHA as an argument.",
326
+ },
327
+ postComment: {
328
+ boolean: true,
329
+ description: "Post comments on the pull request, even if comments are still disabled for the project.",
330
+ default: false,
331
+ },
332
+ redactPassword: {
333
+ boolean: true,
334
+ description: "Redact the tunnel password from log output.",
335
+ default: false,
336
+ },
311
337
  },
312
- silenceTunnelWorker: {
313
- boolean: true,
314
- description: "Suppress logs from tunnel worker processes",
315
- default: false,
316
- },
317
- companionAssetsFolder: {
318
- string: true,
319
- description: "The folder to serve the companion assets from.",
320
- default: undefined,
321
- },
322
- companionAssetsZip: {
323
- string: true,
324
- description: "The zip file to serve the companion assets from.",
325
- default: undefined,
326
- },
327
- companionAssetsRegex: {
328
- string: true,
329
- description: "The regex to match the companion assets.",
330
- default: undefined,
331
- },
332
- hadPreparedForTests: {
333
- boolean: true,
334
- description: "Enable in case you called `prepare-for-meticulous-tests` before running this command.",
335
- default: false,
336
- },
337
- triggerScript: {
338
- string: true,
339
- description: "Path to script that triggers the generation of a Meticulous test run on a specific commit in case base test run is not available. The script will be called with the commit SHA as an argument.",
340
- default: undefined,
341
- },
342
- postComment: {
343
- boolean: true,
344
- description: "Post comments on the pull request, even if comments are still disabled for the project.",
345
- default: false,
346
- },
347
- redactPassword: {
348
- boolean: true,
349
- description: "Redact the tunnel password from log output.",
350
- default: false,
351
- },
352
- })
353
- .handler(handler);
354
- //# sourceMappingURL=run-all-tests-in-cloud.command.js.map
338
+ handler: (0, sentry_utils_1.wrapHandler)(handler),
339
+ };
340
+ //# sourceMappingURL=run.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.command.js","sourceRoot":"","sources":["../../../src/commands/ci/run.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyD;AACzD,qDAKkC;AAClC,qDAA2E;AAC3E,qFAGkD;AAClD,qDAAuC;AACvC,kDAA0B;AAC1B,gEAAuC;AAEvC,8CAAsB;AAEtB,uEAA6D;AAC7D,mEAA+D;AAC/D,qEAA4E;AAC5E,mFAG8C;AAC9C,uDAA8D;AAE9D,MAAM,kCAAkC,GAAG,KAAM,CAAC;AAClD,MAAM,qCAAqC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAsB3E,MAAM,mBAAmB,GAAG,CAAC,WAAwB,EAAU,EAAE;IAC/D,IAAI,WAAW,CAAC,IAAI,EAAE;QACpB,OAAO,UAAU,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;KACxC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,EAAE,EACrB,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,cAAc,GACN,EAAiB,EAAE;IAC3B,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;IAC5B,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,CAAC,CAAC,qBAAqB,IAAI,CAAC,CAAC,kBAAkB,EAAE;QACnD,MAAM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,OAAO,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { CommandModule } from "yargs";
2
+ interface Options {
3
+ apiToken: string | undefined;
4
+ port: number;
5
+ host: string | undefined;
6
+ subdomain: string | undefined;
7
+ localHost: string;
8
+ localHttps: boolean;
9
+ localCert: string | undefined;
10
+ localKey: string | undefined;
11
+ localCa: string | undefined;
12
+ allowInvalidCert: boolean;
13
+ proxyAllUrls: boolean;
14
+ rewriteHostnameToAppUrl: boolean;
15
+ enableDnsCache: boolean;
16
+ silenceTunnelWorker: boolean;
17
+ printRequests: boolean;
18
+ http2Connections: number | undefined;
19
+ }
20
+ export declare const ciStartTunnelCommand: CommandModule<unknown, Options>;
21
+ export {};
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ciStartTunnelCommand = void 0;
4
+ const client_1 = require("@alwaysmeticulous/client");
5
+ const common_1 = require("@alwaysmeticulous/common");
6
+ const tunnels_client_1 = require("@alwaysmeticulous/tunnels-client");
7
+ const sentry_utils_1 = require("../../command-utils/sentry.utils");
8
+ const handler = async (argv) => {
9
+ const logger = (0, common_1.initLogger)();
10
+ const apiToken = (0, client_1.getApiToken)(argv.apiToken);
11
+ if (!apiToken) {
12
+ logger.error("You must provide an API token by using the --apiToken parameter");
13
+ process.exit(1);
14
+ }
15
+ const tunnelClosedCallback = (0, common_1.defer)();
16
+ const tunnel = await (0, tunnels_client_1.localtunnel)({
17
+ logger,
18
+ apiToken,
19
+ port: argv.port,
20
+ ...(argv.host ? { host: argv.host } : {}),
21
+ ...(argv.subdomain ? { subdomain: argv.subdomain } : {}),
22
+ localHost: argv.localHost,
23
+ localHttps: argv.localHttps,
24
+ localCert: argv.localCert,
25
+ localKey: argv.localKey,
26
+ localCa: argv.localCa,
27
+ allowInvalidCert: argv.allowInvalidCert,
28
+ proxyAllUrls: argv.proxyAllUrls,
29
+ rewriteHostnameToAppUrl: argv.rewriteHostnameToAppUrl,
30
+ enableDnsCache: argv.enableDnsCache,
31
+ http2Connections: argv.http2Connections,
32
+ silenceTunnelWorker: argv.silenceTunnelWorker,
33
+ }).catch((err) => {
34
+ throw err;
35
+ });
36
+ tunnel.on("error", (err) => {
37
+ tunnel.close();
38
+ logger.error(err);
39
+ throw err;
40
+ });
41
+ tunnel.on("close", async () => {
42
+ tunnelClosedCallback.resolve(null);
43
+ });
44
+ logger.info(`Your url is: ${tunnel.url} \nuser: ${tunnel.basicAuthUser}, password: ${tunnel.basicAuthPassword}`);
45
+ if (argv.printRequests) {
46
+ tunnel.on("request", (info) => {
47
+ logger.info(new Date().toString(), info.method, info.path);
48
+ });
49
+ }
50
+ process.on("SIGINT", () => {
51
+ logger.info("\nClosing tunnel...");
52
+ tunnel.close();
53
+ });
54
+ await tunnelClosedCallback.promise;
55
+ };
56
+ exports.ciStartTunnelCommand = {
57
+ command: "start-tunnel",
58
+ describe: common_1.IS_METICULOUS_SUPER_USER
59
+ ? "Expose a local service via Meticulous' secure tunnels service"
60
+ : false,
61
+ builder: {
62
+ apiToken: {
63
+ string: true,
64
+ description: "Meticulous API token",
65
+ },
66
+ port: {
67
+ alias: "p",
68
+ describe: "Internal HTTP server port",
69
+ demandOption: true,
70
+ number: true,
71
+ },
72
+ host: {
73
+ alias: "h",
74
+ describe: "Upstream server providing forwarding",
75
+ string: true,
76
+ },
77
+ subdomain: {
78
+ alias: "s",
79
+ describe: "Request this subdomain",
80
+ string: true,
81
+ },
82
+ localHost: {
83
+ alias: "l",
84
+ describe: "Tunnel traffic to this host instead of localhost, override Host header to this host",
85
+ default: "localhost",
86
+ string: true,
87
+ },
88
+ localHttps: {
89
+ describe: "Tunnel traffic to a local HTTPS server",
90
+ boolean: true,
91
+ default: false,
92
+ },
93
+ localCert: {
94
+ describe: "Path to certificate PEM file for local HTTPS server",
95
+ string: true,
96
+ },
97
+ localKey: {
98
+ describe: "Path to certificate key file for local HTTPS server",
99
+ string: true,
100
+ },
101
+ localCa: {
102
+ describe: "Path to certificate authority file for self-signed certificates",
103
+ string: true,
104
+ },
105
+ allowInvalidCert: {
106
+ describe: "Disable certificate checks for your local HTTPS server (ignore cert/key/ca options)",
107
+ boolean: true,
108
+ default: false,
109
+ },
110
+ proxyAllUrls: {
111
+ describe: "Allow any URL to be proxied rather than just the local host",
112
+ boolean: true,
113
+ default: false,
114
+ },
115
+ rewriteHostnameToAppUrl: {
116
+ boolean: true,
117
+ description: "Rewrite the hostname of any requests sent through the tunnel to the app URL.",
118
+ default: false,
119
+ },
120
+ enableDnsCache: {
121
+ describe: "Enable DNS caching, this is recommended if the tunnel will be making requests to a non-localhost domain",
122
+ boolean: true,
123
+ default: false,
124
+ },
125
+ printRequests: {
126
+ describe: "Print basic request info",
127
+ boolean: true,
128
+ default: false,
129
+ },
130
+ http2Connections: {
131
+ describe: "Number of HTTP2 connections to establish for multiplexing (defaults to number of CPU cores)",
132
+ number: true,
133
+ },
134
+ silenceTunnelWorker: {
135
+ describe: "Suppress logs from tunnel worker processes",
136
+ boolean: true,
137
+ default: false,
138
+ },
139
+ },
140
+ handler: (0, sentry_utils_1.wrapHandler)(handler),
141
+ };
142
+ //# sourceMappingURL=start-tunnel.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start-tunnel.command.js","sourceRoot":"","sources":["../../../src/commands/ci/start-tunnel.command.ts"],"names":[],"mappings":";;;AAAA,qDAAuD;AACvD,qDAIkC;AAClC,qEAG0C;AAE1C,mEAA+D;AAqB/D,MAAM,OAAO,GAAG,KAAK,EAAE,IAAa,EAAiB,EAAE;IACrD,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;IAE5B,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,CAAC,KAAK,CACV,iEAAiE,CAClE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,MAAM,o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vF,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,IAAI;SACb;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,wCAAwC;YAClD,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,qDAAqD;YAC/D,MAAM,EAAE,IAAI;SACb;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,qDAAqD;YAC/D,MAAM,EAAE,IAAI;SACb;QACD,OAAO,EAAE;YACP,QAAQ,EACN,iEAAiE;YACnE,MAAM,EAAE,IAAI;SACb;QACD,gBAAgB,EAAE;YAChB,QAAQ,EACN,qFAAqF;YACvF,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,6DAA6D;YACvE,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;QACD,uBAAuB,EAAE;YACvB,OAAO,EAAE,IAAI;YACb,WAAW,EACT,8EAA8E;YAChF,OAAO,EAAE,KAAK;SACf;QACD,cAAc,EAAE;YACd,QAAQ,EACN,yGAAyG;YAC3G,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,0BAA0B;YACpC,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;QACD,gBAAgB,EAAE;YAChB,QAAQ,EACN,6FAA6F;YAC/F,MAAM,EAAE,IAAI;SACb;QACD,mBAAmB,EAAE;YACnB,QAAQ,EAAE,4CAA4C;YACtD,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;KACF;IACD,OAAO,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { CommandModule } from "yargs";
2
+ interface Options {
3
+ apiToken?: string | undefined;
4
+ commitSha?: string | undefined;
5
+ baseSha?: string | undefined;
6
+ repoDirectory?: string | undefined;
7
+ appDirectory?: string | undefined;
8
+ appZip?: string | undefined;
9
+ rewrites?: string;
10
+ waitForBase: boolean;
11
+ waitForTestRunToComplete: boolean;
12
+ }
13
+ export declare const ciUploadAssetsCommand: CommandModule<unknown, Options>;
14
+ export {};
@@ -23,13 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.uploadAssetsAndExecuteTestRunInCloudCommand = void 0;
26
+ exports.ciUploadAssetsCommand = void 0;
27
27
  const client_1 = require("@alwaysmeticulous/client");
28
28
  const common_1 = require("@alwaysmeticulous/common");
29
29
  const remote_replay_launcher_1 = require("@alwaysmeticulous/remote-replay-launcher");
30
30
  const Sentry = __importStar(require("@sentry/node"));
31
- const command_builder_1 = require("../../command-utils/command-builder");
32
31
  const common_options_1 = require("../../command-utils/common-options");
32
+ const sentry_utils_1 = require("../../command-utils/sentry.utils");
33
33
  const out_of_date_client_error_1 = require("../../utils/out-of-date-client-error");
34
34
  const POLL_INTERVAL_MS = 10000;
35
35
  const handler = async ({ apiToken, commitSha: commitSha_, baseSha: baseSha_, repoDirectory, appDirectory, appZip, rewrites, waitForBase, waitForTestRunToComplete, }) => {
@@ -45,9 +45,9 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseSha: baseSha_, rep
45
45
  logger.error("No commit sha found, you must be in a git repository or provide one with --commitSha");
46
46
  process.exit(1);
47
47
  }
48
- const baseSha = baseSha_ || (repoDirectory
49
- ? await (0, common_1.getLocalBaseSha)(gitOpts)
50
- : undefined) || undefined;
48
+ const baseSha = baseSha_ ||
49
+ (repoDirectory ? await (0, common_1.getLocalBaseSha)(gitOpts) : undefined) ||
50
+ undefined;
51
51
  if (baseSha && baseSha === commitSha) {
52
52
  logger.info("Base SHA equals head SHA — nothing to test.");
53
53
  return;
@@ -58,9 +58,7 @@ const handler = async ({ apiToken, commitSha: commitSha_, baseSha: baseSha_, rep
58
58
  }
59
59
  Sentry.captureMessage("Received upload assets request", {
60
60
  level: "debug",
61
- extra: {
62
- commitSha,
63
- },
61
+ extra: { commitSha },
64
62
  });
65
63
  let testRunId = null;
66
64
  try {
@@ -129,51 +127,45 @@ const parseRewrites = (rewritesString) => {
129
127
  }
130
128
  return parsedRewrites;
131
129
  };
132
- exports.uploadAssetsAndExecuteTestRunInCloudCommand = (0, command_builder_1.buildCommand)("upload-assets-and-execute-test-run-in-cloud")
133
- .details({
130
+ exports.ciUploadAssetsCommand = {
131
+ command: "upload-assets",
134
132
  describe: "Upload build artifacts to Meticulous, potentially triggering a test run",
135
- })
136
- .options({
137
- apiToken: common_options_1.OPTIONS.apiToken,
138
- commitSha: common_options_1.OPTIONS.commitSha,
139
- baseSha: {
140
- demandOption: false,
141
- string: true,
142
- description: "The base commit SHA to compare against. If not provided, inferred from --repoDirectory via merge-base with origin/main.",
143
- },
144
- repoDirectory: {
145
- demandOption: false,
146
- string: true,
147
- description: "The path to the git repository to use for auto-detecting --commitSha and the base SHA.",
148
- },
149
- appDirectory: {
150
- demandOption: false,
151
- string: true,
152
- description: "The directory containing the application's static assets. Either this or --appZip must be provided.",
153
- },
154
- appZip: {
155
- demandOption: false,
156
- string: true,
157
- description: "The zip file containing the application's static assets. Either this or --appDirectory must be provided.",
158
- },
159
- rewrites: {
160
- string: true,
161
- default: "[]",
162
- description: "URL rewrite rules. This string should be a valid JSON array in the format described at https://github.com/vercel/serve-handler?tab=readme-ov-file#rewrites-array." +
163
- ' Note: if no rules are passed, or an empty list is passed, we default to the rewrite rule \'{ source: "**", destination: "/index.html" }\'.',
164
- },
165
- waitForBase: {
166
- demandOption: false,
167
- boolean: true,
168
- default: true,
169
- description: "If true, the launcher will try to wait for a base test run to be created before triggering a test run. If that is not found, it will trigger a test run without waiting for a base test run.",
170
- },
171
- waitForTestRunToComplete: {
172
- demandOption: false,
173
- boolean: true,
174
- default: false,
175
- description: "If true, block and wait until the triggered test run is complete, then report results. Implies --waitForBase.",
133
+ builder: {
134
+ apiToken: common_options_1.OPTIONS.apiToken,
135
+ commitSha: common_options_1.OPTIONS.commitSha,
136
+ baseSha: {
137
+ string: true,
138
+ description: "The base commit SHA to compare against. If not provided, inferred from --repoDirectory via merge-base with origin/main.",
139
+ },
140
+ repoDirectory: {
141
+ string: true,
142
+ description: "The path to the git repository to use for auto-detecting --commitSha and the base SHA.",
143
+ },
144
+ appDirectory: {
145
+ string: true,
146
+ description: "The directory containing the application's static assets. Either this or --appZip must be provided.",
147
+ },
148
+ appZip: {
149
+ string: true,
150
+ description: "The zip file containing the application's static assets. Either this or --appDirectory must be provided.",
151
+ },
152
+ rewrites: {
153
+ string: true,
154
+ default: "[]",
155
+ description: "URL rewrite rules. This string should be a valid JSON array in the format described at https://github.com/vercel/serve-handler?tab=readme-ov-file#rewrites-array." +
156
+ " Note: if no rules are passed, or an empty list is passed, we default to the rewrite rule '{ source: \"**\", destination: \"/index.html\" }'.",
157
+ },
158
+ waitForBase: {
159
+ boolean: true,
160
+ default: true,
161
+ description: "If true, the launcher will try to wait for a base test run to be created before triggering a test run.",
162
+ },
163
+ waitForTestRunToComplete: {
164
+ boolean: true,
165
+ default: false,
166
+ description: "If true, block and wait until the triggered test run is complete, then report results. Implies --waitForBase.",
167
+ },
176
168
  },
177
- })
178
- .handler(handler);
179
- //# sourceMappingURL=upload-assets-and-execute-test-run-in-cloud.command.js.map
169
+ handler: (0, sentry_utils_1.wrapHandler)(handler),
170
+ };
171
+ //# sourceMappingURL=upload-assets.command.js.map