@datadog/datadog-ci-plugin-synthetics 3.21.0 → 3.21.2

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 (82) hide show
  1. package/dist/api.d.ts +52 -0
  2. package/dist/api.js +333 -0
  3. package/dist/api.js.map +1 -0
  4. package/dist/batch.d.ts +9 -0
  5. package/dist/batch.js +325 -0
  6. package/dist/batch.js.map +1 -0
  7. package/dist/build-and-test.d.ts +25 -0
  8. package/dist/build-and-test.js +196 -0
  9. package/dist/build-and-test.js.map +1 -0
  10. package/dist/commands/deploy-tests.d.ts +19 -0
  11. package/dist/commands/deploy-tests.js +125 -0
  12. package/dist/commands/deploy-tests.js.map +1 -0
  13. package/dist/commands/import-tests.d.ts +19 -0
  14. package/dist/commands/import-tests.js +118 -0
  15. package/dist/commands/import-tests.js.map +1 -0
  16. package/dist/commands/run-tests.d.ts +19 -0
  17. package/dist/commands/run-tests.js +308 -0
  18. package/dist/commands/run-tests.js.map +1 -0
  19. package/dist/commands/upload-application.d.ts +18 -0
  20. package/dist/commands/upload-application.js +138 -0
  21. package/dist/commands/upload-application.js.map +1 -0
  22. package/dist/deploy-tests-lib.d.ts +2 -0
  23. package/dist/deploy-tests-lib.js +96 -0
  24. package/dist/deploy-tests-lib.js.map +1 -0
  25. package/dist/errors.d.ts +18 -0
  26. package/dist/errors.js +30 -0
  27. package/dist/errors.js.map +1 -0
  28. package/dist/import-tests-lib.d.ts +2 -0
  29. package/dist/import-tests-lib.js +71 -0
  30. package/dist/import-tests-lib.js.map +1 -0
  31. package/dist/index.d.ts +7 -0
  32. package/dist/index.js +44 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/interfaces.d.ts +739 -0
  35. package/dist/interfaces.js +27 -0
  36. package/dist/interfaces.js.map +1 -0
  37. package/dist/local-test-definition.d.ts +2 -0
  38. package/dist/local-test-definition.js +16 -0
  39. package/dist/local-test-definition.js.map +1 -0
  40. package/dist/mobile.d.ts +28 -0
  41. package/dist/mobile.js +275 -0
  42. package/dist/mobile.js.map +1 -0
  43. package/dist/multilocator.d.ts +2 -0
  44. package/dist/multilocator.js +88 -0
  45. package/dist/multilocator.js.map +1 -0
  46. package/dist/reporters/constants.d.ts +6 -0
  47. package/dist/reporters/constants.js +14 -0
  48. package/dist/reporters/constants.js.map +1 -0
  49. package/dist/reporters/default.d.ts +31 -0
  50. package/dist/reporters/default.js +416 -0
  51. package/dist/reporters/default.js.map +1 -0
  52. package/dist/reporters/junit.d.ts +100 -0
  53. package/dist/reporters/junit.js +425 -0
  54. package/dist/reporters/junit.js.map +1 -0
  55. package/dist/reporters/mobile/app-upload.d.ts +15 -0
  56. package/dist/reporters/mobile/app-upload.js +54 -0
  57. package/dist/reporters/mobile/app-upload.js.map +1 -0
  58. package/dist/run-tests-lib.d.ts +21 -0
  59. package/dist/run-tests-lib.js +247 -0
  60. package/dist/run-tests-lib.js.map +1 -0
  61. package/dist/test.d.ts +30 -0
  62. package/dist/test.js +204 -0
  63. package/dist/test.js.map +1 -0
  64. package/dist/tunnel/crypto.d.ts +6 -0
  65. package/dist/tunnel/crypto.js +48 -0
  66. package/dist/tunnel/crypto.js.map +1 -0
  67. package/dist/tunnel/index.d.ts +1 -0
  68. package/dist/tunnel/index.js +6 -0
  69. package/dist/tunnel/index.js.map +1 -0
  70. package/dist/tunnel/tunnel.d.ts +49 -0
  71. package/dist/tunnel/tunnel.js +329 -0
  72. package/dist/tunnel/tunnel.js.map +1 -0
  73. package/dist/tunnel/websocket.d.ts +39 -0
  74. package/dist/tunnel/websocket.js +154 -0
  75. package/dist/tunnel/websocket.js.map +1 -0
  76. package/dist/utils/internal.d.ts +56 -0
  77. package/dist/utils/internal.js +313 -0
  78. package/dist/utils/internal.js.map +1 -0
  79. package/dist/utils/public.d.ts +76 -0
  80. package/dist/utils/public.js +509 -0
  81. package/dist/utils/public.js.map +1 -0
  82. package/package.json +9 -3
package/dist/batch.js ADDED
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.reportReceivedResults = exports.getResultsToReport = exports.waitForResults = exports.runTests = exports.DEFAULT_BATCH_TIMEOUT = void 0;
16
+ const chalk_1 = __importDefault(require("chalk"));
17
+ const deep_extend_1 = __importDefault(require("deep-extend"));
18
+ const api_1 = require("./api");
19
+ const errors_1 = require("./errors");
20
+ const internal_1 = require("./utils/internal");
21
+ const public_1 = require("./utils/public");
22
+ exports.DEFAULT_BATCH_TIMEOUT = 30 * 60 * 1000;
23
+ const POLLING_INTERVAL = 5000; // In ms
24
+ const runTests = (api, testsToTrigger, reporter, metadata, failOnMissingTests, selectiveRerun, batchTimeout = exports.DEFAULT_BATCH_TIMEOUT) => __awaiter(void 0, void 0, void 0, function* () {
25
+ var _a;
26
+ const payload = {
27
+ tests: testsToTrigger,
28
+ metadata,
29
+ options: {
30
+ batch_timeout: batchTimeout,
31
+ selective_rerun: selectiveRerun,
32
+ },
33
+ };
34
+ try {
35
+ const response = yield api.triggerTests(payload);
36
+ return {
37
+ batchId: response.batch_id,
38
+ locations: response.locations,
39
+ selectiveRerunRateLimited: response.selective_rerun_rate_limited,
40
+ testsNotAuthorized: new Set(),
41
+ };
42
+ }
43
+ catch (e) {
44
+ const errorMessage = (0, api_1.formatBackendErrors)(e);
45
+ const unauthorizedTestPublicIds = (0, api_1.extractUnauthorizedTestPublicIds)(e);
46
+ if (unauthorizedTestPublicIds === null || unauthorizedTestPublicIds === void 0 ? void 0 : unauthorizedTestPublicIds.size) {
47
+ // Abort if `failOnMissingTests` is true.
48
+ if (failOnMissingTests) {
49
+ reporter.error(`${chalk_1.default.red.bold('Some tests were not authorized to be triggered. Aborting due to `failOnMissingTests: true`.')}\n Error: ${errorMessage}\n\n`);
50
+ const testsNotAuthorizedListStr = chalk_1.default.gray([...unauthorizedTestPublicIds].join(', '));
51
+ throw new errors_1.CiError('UNAUTHORIZED_TESTS', testsNotAuthorizedListStr);
52
+ }
53
+ // Retry without unauthorized tests.
54
+ reporter.error(`${chalk_1.default.red.bold('Some tests were not authorized to be triggered, retrying without them…')}\n Error: ${errorMessage}\n\n`);
55
+ const newTestsToTrigger = testsToTrigger.filter((t) => !unauthorizedTestPublicIds.has((0, internal_1.getPublicIdOrPlaceholder)(t)));
56
+ const trigger = yield (0, exports.runTests)(api, newTestsToTrigger, reporter, metadata, failOnMissingTests, selectiveRerun, batchTimeout);
57
+ return Object.assign(Object.assign({}, trigger), { testsNotAuthorized: new Set([...unauthorizedTestPublicIds, ...trigger.testsNotAuthorized]) });
58
+ }
59
+ // Rewrite error message
60
+ const testIds = testsToTrigger.map((t) => (0, internal_1.getPublicIdOrPlaceholder)(t)).join(',');
61
+ throw new api_1.EndpointError(`[${testIds}] Failed to trigger tests: ${errorMessage}\n`, (_a = e.response) === null || _a === void 0 ? void 0 : _a.status);
62
+ }
63
+ });
64
+ exports.runTests = runTests;
65
+ const waitForResults = (api, trigger, tests, options, reporter, tunnel) => __awaiter(void 0, void 0, void 0, function* () {
66
+ let isTunnelConnected = true;
67
+ if (tunnel) {
68
+ tunnel
69
+ .keepAlive()
70
+ .then(() => (isTunnelConnected = false))
71
+ .catch(() => (isTunnelConnected = false));
72
+ }
73
+ reporter.testsWait(tests, (0, public_1.getAppBaseURL)(options), trigger.batchId);
74
+ const locationNames = trigger.locations.reduce((mapping, location) => {
75
+ mapping[location.name] = location.display_name;
76
+ return mapping;
77
+ }, {});
78
+ const getLocation = (dcId, test) => {
79
+ const hasTunnel = !!tunnel && (0, public_1.isTestSupportedByTunnel)(test);
80
+ return hasTunnel ? 'Tunneled' : locationNames[dcId] || dcId;
81
+ };
82
+ const resultDisplayInfo = {
83
+ getLocation,
84
+ options,
85
+ tests,
86
+ };
87
+ const results = yield waitForBatchToFinish(api, trigger.batchId, options.batchTimeout, resultDisplayInfo, reporter);
88
+ if (tunnel && !isTunnelConnected) {
89
+ reporter.error('The tunnel was closed during execution, this may have affected the results.\n');
90
+ }
91
+ return results;
92
+ });
93
+ exports.waitForResults = waitForResults;
94
+ const waitForBatchToFinish = (api, batchId, batchTimeout, resultDisplayInfo, reporter) => __awaiter(void 0, void 0, void 0, function* () {
95
+ const safeDeadline = Date.now() + batchTimeout + 12 * POLLING_INTERVAL;
96
+ const emittedResultIds = new Set();
97
+ const backupPollResultMap = new Map();
98
+ let oldIncompleteResultIds = new Set();
99
+ while (true) {
100
+ const batch = yield getBatch(api, batchId);
101
+ const safeDeadlineReached = Date.now() >= safeDeadline;
102
+ // The backend is expected to handle the time out of the batch by eventually changing its status to `failed`.
103
+ // But `safeDeadlineReached` is a safety in case it fails to do that on time.
104
+ const shouldContinuePolling = batch.status === 'in_progress' && !safeDeadlineReached;
105
+ const newlyReceivedResults = (0, exports.reportReceivedResults)(batch, emittedResultIds, reporter);
106
+ const resultIdsToFetch = getResultIdsToFetch(shouldContinuePolling, batch, newlyReceivedResults, oldIncompleteResultIds);
107
+ const { pollResultMap, incompleteResultIds } = yield getPollResultMap(api, resultIdsToFetch, backupPollResultMap);
108
+ const resultsToReport = (0, exports.getResultsToReport)(shouldContinuePolling, batch, newlyReceivedResults, emittedResultIds, oldIncompleteResultIds, incompleteResultIds, reporter);
109
+ reportResults(batchId, resultsToReport, pollResultMap, resultDisplayInfo, safeDeadlineReached, reporter);
110
+ oldIncompleteResultIds = incompleteResultIds;
111
+ if (safeDeadlineReached) {
112
+ throw new errors_1.BatchTimeoutRunawayError();
113
+ }
114
+ if (!shouldContinuePolling) {
115
+ return batch.results.map((r) => getResultFromBatch(r, pollResultMap, resultDisplayInfo));
116
+ }
117
+ reportWaitingTests(batchId, batch, resultDisplayInfo, reporter);
118
+ yield (0, internal_1.wait)(POLLING_INTERVAL);
119
+ }
120
+ });
121
+ const getResultIdsToFetch = (shouldContinuePolling, batch, newlyReceivedResults, oldIncompleteResultIds) => {
122
+ // For the last iteration, the full up-to-date data has to be fetched to compute the return value of `waitForResults()`.
123
+ if (!shouldContinuePolling) {
124
+ return getResultIds(batch.results);
125
+ }
126
+ return getResultIds(newlyReceivedResults).concat(...oldIncompleteResultIds);
127
+ };
128
+ const getResultsToReport = (shouldContinuePolling, batch, newlyReceivedResults, emittedResultIds, oldIncompleteResultIds, incompleteResultIds, reporter) => {
129
+ const newlyCompleteResults = excludeSkipped(batch.results).filter((r) => oldIncompleteResultIds.has(r.result_id) && !incompleteResultIds.has(r.result_id));
130
+ const resultsToReport = newlyReceivedResults
131
+ .filter((r) => (0, internal_1.isResultInBatchSkippedBySelectiveRerun)(r) || !isResidualResult(r, emittedResultIds, incompleteResultIds))
132
+ .concat(newlyCompleteResults);
133
+ if (shouldContinuePolling) {
134
+ return resultsToReport;
135
+ }
136
+ // Results that we failed to report for some reason are finally reported as "residues".
137
+ const residualResults = excludeSkipped(batch.results).filter((r) => isResidualResult(r, emittedResultIds, incompleteResultIds));
138
+ const errors = [];
139
+ for (const result of residualResults) {
140
+ if (!result.timed_out) {
141
+ errors.push(`The information for result ${result.result_id} of test ${result.test_public_id} was incomplete at the end of the batch.`);
142
+ }
143
+ }
144
+ if (errors.length > 0) {
145
+ reporter.error(errors.join('\n') + '\n\n');
146
+ }
147
+ return resultsToReport.concat(residualResults);
148
+ };
149
+ exports.getResultsToReport = getResultsToReport;
150
+ const reportReceivedResults = (batch, emittedResultIds, reporter) => {
151
+ const receivedResults = [];
152
+ for (const [index, result] of batch.results.entries()) {
153
+ // Skipped results are only reported by `resultReceived()`, then they are excluded everywhere with `excludeSkipped()`.
154
+ const resultId = result.status === 'skipped' ? `skipped-${index}` : result.result_id;
155
+ // The result is reported if it has a final status, or if it's a non-final result.
156
+ if ((result.status !== 'in_progress' || (0, internal_1.isNonFinalResult)(result)) && !emittedResultIds.has(resultId)) {
157
+ emittedResultIds.add(resultId);
158
+ reporter.resultReceived(result);
159
+ receivedResults.push(result);
160
+ }
161
+ }
162
+ return receivedResults;
163
+ };
164
+ exports.reportReceivedResults = reportReceivedResults;
165
+ const reportResults = (batchId, results, pollResultMap, resultDisplayInfo, safeDeadlineReached, reporter) => {
166
+ const baseUrl = (0, public_1.getAppBaseURL)(resultDisplayInfo.options);
167
+ for (const result of results) {
168
+ reporter.resultEnd(getResultFromBatch(result, pollResultMap, resultDisplayInfo, safeDeadlineReached), baseUrl, batchId);
169
+ }
170
+ };
171
+ const reportWaitingTests = (batchId, batch, resultDisplayInfo, reporter) => {
172
+ const baseUrl = (0, public_1.getAppBaseURL)(resultDisplayInfo.options);
173
+ const { tests } = resultDisplayInfo;
174
+ const inProgressPublicIds = new Set();
175
+ const skippedBySelectiveRerunPublicIds = new Set();
176
+ for (const result of batch.results) {
177
+ if (result.status === 'in_progress') {
178
+ inProgressPublicIds.add(result.test_public_id);
179
+ }
180
+ if ((0, internal_1.isResultInBatchSkippedBySelectiveRerun)(result)) {
181
+ skippedBySelectiveRerunPublicIds.add(result.test_public_id);
182
+ }
183
+ }
184
+ const remainingTests = [];
185
+ let skippedCount = 0;
186
+ for (const test of tests) {
187
+ if (inProgressPublicIds.has(test.public_id)) {
188
+ remainingTests.push(test);
189
+ }
190
+ if (skippedBySelectiveRerunPublicIds.has(test.public_id)) {
191
+ skippedCount++;
192
+ }
193
+ }
194
+ reporter.testsWait(remainingTests, baseUrl, batchId, skippedCount);
195
+ };
196
+ const getResultFromBatch = (resultInBatch, pollResultMap, resultDisplayInfo, safeDeadlineReached = false) => {
197
+ var _a, _b, _c;
198
+ const { tests } = resultDisplayInfo;
199
+ const test = getTestByPublicId(resultInBatch.test_public_id, tests);
200
+ const hasTimedOut = (_a = resultInBatch.timed_out) !== null && _a !== void 0 ? _a : safeDeadlineReached;
201
+ const timedOutRetry = (0, internal_1.isTimedOutRetry)(resultInBatch.retries, resultInBatch.max_retries, resultInBatch.timed_out);
202
+ if ((0, internal_1.isResultInBatchSkippedBySelectiveRerun)(resultInBatch)) {
203
+ return {
204
+ executionRule: resultInBatch.execution_rule,
205
+ passed: true,
206
+ resultId: (0, internal_1.getResultIdOrLinkedResultId)(resultInBatch),
207
+ selectiveRerun: resultInBatch.selective_rerun,
208
+ test,
209
+ timedOut: hasTimedOut,
210
+ };
211
+ }
212
+ const pollResult = pollResultMap.get(resultInBatch.result_id);
213
+ const isUnhealthy = (_c = (_b = pollResult === null || pollResult === void 0 ? void 0 : pollResult.result) === null || _b === void 0 ? void 0 : _b.unhealthy) !== null && _c !== void 0 ? _c : false;
214
+ if (!(pollResult === null || pollResult === void 0 ? void 0 : pollResult.result)) {
215
+ return createResult(resultInBatch, pollResult, test, hasTimedOut, isUnhealthy, resultDisplayInfo);
216
+ }
217
+ if (safeDeadlineReached) {
218
+ pollResult.result.failure = new errors_1.BatchTimeoutRunawayError().toJson();
219
+ pollResult.result.status = 'failed';
220
+ }
221
+ else if (timedOutRetry) {
222
+ pollResult.result.failure = { code: 'TIMEOUT', message: 'The batch timed out before receiving the retry.' };
223
+ pollResult.result.status = 'failed';
224
+ }
225
+ else if (hasTimedOut) {
226
+ pollResult.result.failure = { code: 'TIMEOUT', message: 'The batch timed out before receiving the result.' };
227
+ pollResult.result.status = 'failed';
228
+ }
229
+ return createResult(resultInBatch, pollResult, test, hasTimedOut, isUnhealthy, resultDisplayInfo);
230
+ };
231
+ const createResult = (resultInBatch, pollResult, test, hasTimedOut, isUnhealthy, { getLocation, options }) => {
232
+ var _a, _b;
233
+ return {
234
+ device: pollResult === null || pollResult === void 0 ? void 0 : pollResult.device,
235
+ duration: resultInBatch.duration,
236
+ executionRule: resultInBatch.execution_rule,
237
+ initialResultId: resultInBatch.initial_result_id,
238
+ isNonFinal: (0, internal_1.isNonFinalResult)(resultInBatch),
239
+ location: getLocation(resultInBatch.location, test),
240
+ passed: (0, internal_1.hasResultPassed)(resultInBatch, isUnhealthy, hasTimedOut, options),
241
+ result: pollResult === null || pollResult === void 0 ? void 0 : pollResult.result,
242
+ resultId: (0, internal_1.getResultIdOrLinkedResultId)(resultInBatch),
243
+ retries: resultInBatch.retries || 0,
244
+ maxRetries: resultInBatch.max_retries || 0,
245
+ selectiveRerun: resultInBatch.selective_rerun,
246
+ test: (0, deep_extend_1.default)({}, test, pollResult === null || pollResult === void 0 ? void 0 : pollResult.test),
247
+ timedOut: hasTimedOut,
248
+ timestamp: (_b = (_a = pollResult === null || pollResult === void 0 ? void 0 : pollResult.result) === null || _a === void 0 ? void 0 : _a.finished_at) !== null && _b !== void 0 ? _b : Date.now(),
249
+ };
250
+ };
251
+ const getBatch = (api, batchId) => __awaiter(void 0, void 0, void 0, function* () {
252
+ var _b;
253
+ try {
254
+ const batch = yield api.getBatch(batchId);
255
+ return batch;
256
+ }
257
+ catch (e) {
258
+ throw new api_1.EndpointError(`Failed to get batch: ${(0, api_1.formatBackendErrors)(e)}\n`, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status);
259
+ }
260
+ });
261
+ /**
262
+ * Returns fresh poll results, or reads the backup map in case of 404.
263
+ */
264
+ const getPollResultMap = (api, resultIds, backupPollResultMap) => __awaiter(void 0, void 0, void 0, function* () {
265
+ var _c;
266
+ const pollResultMap = new Map();
267
+ const incompleteResultIds = new Set();
268
+ try {
269
+ const pollResults = yield api.pollResults(resultIds);
270
+ pollResults.forEach((r) => {
271
+ // Server results can take some time to arrive. During this time,
272
+ // the endpoint returns a partial result with only `test_type` and `result.id` set.
273
+ // We keep the `PollResult` but remove the `ServerResult` to avoid reporting incomplete data.
274
+ if (r.result && !('finished_at' in r.result)) {
275
+ incompleteResultIds.add(r.resultID);
276
+ delete r.result;
277
+ }
278
+ pollResultMap.set(r.resultID, r);
279
+ backupPollResultMap.set(r.resultID, r);
280
+ });
281
+ return { pollResultMap, incompleteResultIds };
282
+ }
283
+ catch (e) {
284
+ if ((0, api_1.getErrorHttpStatus)(e) === 404) {
285
+ // If some results have latency and retries were not enough, the whole request fails with "Test results not found".
286
+ // In that case, we mark results IDs that were never polled before as incomplete so they are fetched in the next polling cycles.
287
+ resultIds.forEach((resultId) => {
288
+ const backupPollResult = backupPollResultMap.get(resultId);
289
+ if (backupPollResult) {
290
+ pollResultMap.set(resultId, backupPollResult);
291
+ }
292
+ else {
293
+ incompleteResultIds.add(resultId);
294
+ }
295
+ });
296
+ return { pollResultMap, incompleteResultIds };
297
+ }
298
+ throw new api_1.EndpointError(`Failed to poll results: ${(0, api_1.formatBackendErrors)(e)}\n`, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status);
299
+ }
300
+ });
301
+ /**
302
+ * A residual result is either:
303
+ * - Still incomplete (from the poll results POV): report it with incomplete data and a warning.
304
+ * - Still in progress (from the batch POV): it was never emitted.
305
+ * - A timed out retry.
306
+ */
307
+ const isResidualResult = (result, emittedResultIds, incompleteResultIds) => {
308
+ if (incompleteResultIds.has(result.result_id)) {
309
+ // The poll results endpoint returned an incomplete result: report it with incomplete data and a warning.
310
+ return true;
311
+ }
312
+ if (!emittedResultIds.has(result.result_id)) {
313
+ // Was never emitted, which means the batch never set a final status for it.
314
+ return true;
315
+ }
316
+ if (emittedResultIds.has(result.result_id) && (0, internal_1.isTimedOutRetry)(result.retries, result.max_retries, result.timed_out)) {
317
+ // The result ID was already emitted but it used to be non-final result, and it's now a timed out retry.
318
+ return true;
319
+ }
320
+ return false;
321
+ };
322
+ const getTestByPublicId = (id, tests) => tests.find((t) => t.public_id === id);
323
+ const getResultIds = (results) => excludeSkipped(results).map((r) => r.result_id);
324
+ const excludeSkipped = (results) => results.filter((r) => !(0, internal_1.isResultInBatchSkippedBySelectiveRerun)(r));
325
+ //# sourceMappingURL=batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../src/batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAAyB;AACzB,8DAAoC;AAEpC,+BAMc;AACd,qCAA0D;AAiB1D,+CAQyB;AACzB,2CAAqE;AAExD,QAAA,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEnD,MAAM,gBAAgB,GAAG,IAAI,CAAA,CAAC,QAAQ;AAE/B,MAAM,QAAQ,GAAG,CACtB,GAAc,EACd,cAA6B,EAC7B,QAAsB,EACtB,QAAmB,EACnB,kBAA4B,EAC5B,cAAwB,EACxB,YAAY,GAAG,6BAAqB,EACd,EAAE;;IACxB,MAAM,OAAO,GAAY;QACvB,KAAK,EAAE,cAAc;QACrB,QAAQ;QACR,OAAO,EAAE;YACP,aAAa,EAAE,YAAY;YAC3B,eAAe,EAAE,cAAc;SAChC;KACF,CAAA;IAED,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QAEhD,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,QAAQ;YAC1B,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,yBAAyB,EAAE,QAAQ,CAAC,4BAA4B;YAChE,kBAAkB,EAAE,IAAI,GAAG,EAAE;SAC9B,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,YAAY,GAAG,IAAA,yBAAmB,EAAC,CAAC,CAAC,CAAA;QAC3C,MAAM,yBAAyB,GAAG,IAAA,sCAAgC,EAAC,CAAC,CAAC,CAAA;QAErE,IAAI,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAE,IAAI,EAAE;YACnC,yCAAyC;YACzC,IAAI,kBAAkB,EAAE;gBACtB,QAAQ,CAAC,KAAK,CACZ,GAAG,eAAK,CAAC,GAAG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M,cAAc,GAAG,CAAC,OAAwB,EAAE,EAAE,CAClD,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAA0B,EAAE,CAAC,CAAC,IAAA,iDAAsC,EAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ import http from 'http';
3
+ import { MainReporter } from './interfaces';
4
+ interface ReportedBuild {
5
+ outputDirectory: string;
6
+ publicPath: string;
7
+ }
8
+ export declare const UnconfiguredBuildPluginError: Error;
9
+ export declare const MalformedBuildError: Error;
10
+ declare const routeVerbs: readonly ["get", "post", "put", "patch", "delete"];
11
+ type RouteVerb = (typeof routeVerbs)[number];
12
+ export type Routes = Record<string, {
13
+ [key in RouteVerb]?: (req: http.IncomingMessage, res: http.ServerResponse) => Promise<void>;
14
+ }>;
15
+ export type RequestHandlerOptions = {
16
+ builds: ReportedBuild[];
17
+ root?: string;
18
+ routes?: Routes;
19
+ };
20
+ export declare const buildAssets: (buildCommand: string, reporter: MainReporter) => Promise<{
21
+ builds: ReportedBuild[];
22
+ devServerUrl: string;
23
+ stop: () => Promise<void>;
24
+ }>;
25
+ export {};
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.buildAssets = exports.MalformedBuildError = exports.UnconfiguredBuildPluginError = void 0;
16
+ const child_process_1 = require("child_process");
17
+ const events_1 = require("events");
18
+ const fs_1 = require("fs");
19
+ const http_1 = __importDefault(require("http"));
20
+ const upath_1 = __importDefault(require("upath"));
21
+ const REPORT_BUILD_PATHNAME = '/_datadog-ci_/build';
22
+ exports.UnconfiguredBuildPluginError = new Error(`
23
+ We couldn't detect the Datadog Build plugins within your build. Did you add it?
24
+ If not, you can learn more about it here: https://github.com/DataDog/build-plugins#readme
25
+ `);
26
+ exports.MalformedBuildError = new Error(`Invalid payload. Expected payload is {"outputDirectory": string, "publicPath": string}`);
27
+ const MIME_TYPES = {
28
+ default: 'application/octet-stream',
29
+ html: 'text/html; charset=UTF-8',
30
+ js: 'application/javascript',
31
+ css: 'text/css',
32
+ png: 'image/png',
33
+ jpg: 'image/jpg',
34
+ gif: 'image/gif',
35
+ ico: 'image/x-icon',
36
+ svg: 'image/svg+xml',
37
+ };
38
+ const isMIMEType = (mime) => {
39
+ return Object.keys(MIME_TYPES).includes(mime);
40
+ };
41
+ const routeVerbs = ['get', 'post', 'put', 'patch', 'delete'];
42
+ const isRouteVerb = (verb) => {
43
+ return routeVerbs.includes(verb);
44
+ };
45
+ const fileExists = (filePath) => __awaiter(void 0, void 0, void 0, function* () {
46
+ try {
47
+ yield fs_1.promises.access(filePath);
48
+ return true;
49
+ }
50
+ catch (_a) {
51
+ return false;
52
+ }
53
+ });
54
+ const prepareFile = (root = process.cwd(), builds, requestUrl) => __awaiter(void 0, void 0, void 0, function* () {
55
+ const staticPath = upath_1.default.isAbsolute(root) ? root : upath_1.default.resolve(process.cwd(), root);
56
+ for (const build of builds) {
57
+ if (requestUrl.startsWith(build.publicPath)) {
58
+ const url = new URL(requestUrl, 'http://127.0.0.1');
59
+ const filePath = upath_1.default.join(upath_1.default.resolve(staticPath, build.outputDirectory), // absolute path to the assets directory
60
+ upath_1.default.relative(build.publicPath, url.pathname), // relative path to the file
61
+ url.pathname.endsWith('/') ? 'index.html' : '' // add index.html if the path ends with a slash
62
+ );
63
+ // Verify path is within the intended directory
64
+ const directDescendant = filePath.startsWith(upath_1.default.resolve(staticPath, build.outputDirectory));
65
+ // Check if the file exists (only if it's withing the intended directory)
66
+ const found = directDescendant && (yield fileExists(filePath));
67
+ if (directDescendant && found) {
68
+ return {
69
+ found: true,
70
+ ext: upath_1.default.extname(filePath).substring(1).toLowerCase(),
71
+ content: yield fs_1.promises.readFile(filePath, { encoding: 'utf-8' }),
72
+ };
73
+ }
74
+ }
75
+ }
76
+ return {
77
+ found: false,
78
+ };
79
+ });
80
+ const getRequestHandler = ({ builds, root, routes }) => (req, res) => __awaiter(void 0, void 0, void 0, function* () {
81
+ var _b, _c;
82
+ try {
83
+ // Handle routes.
84
+ const route = routes === null || routes === void 0 ? void 0 : routes[req.url || '/'];
85
+ if (route) {
86
+ const verb = (_c = (_b = req.method) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== null && _c !== void 0 ? _c : '';
87
+ if (isRouteVerb(verb)) {
88
+ const handler = route[verb];
89
+ if (handler) {
90
+ yield handler(req, res);
91
+ return;
92
+ }
93
+ }
94
+ }
95
+ // Fallback to files.
96
+ const file = yield prepareFile(root, builds, req.url || '/');
97
+ if (file.found) {
98
+ const mimeType = isMIMEType(file.ext) ? MIME_TYPES[file.ext] : MIME_TYPES.default;
99
+ res.writeHead(200, { 'Content-Type': mimeType });
100
+ res.end(file.content);
101
+ return;
102
+ }
103
+ res.writeHead(404);
104
+ res.end();
105
+ }
106
+ catch (error) {
107
+ const errorMessage = error instanceof Error ? error.message : String(error);
108
+ res.writeHead(500, { 'Content-Type': MIME_TYPES.html });
109
+ res.end(`Internal Server Error: ${errorMessage}`);
110
+ }
111
+ });
112
+ const getRequestBody = (req) => __awaiter(void 0, void 0, void 0, function* () {
113
+ const chunks = [];
114
+ req.on('data', (chunk) => chunks.push(chunk));
115
+ yield (0, events_1.once)(req, 'end');
116
+ return chunks.join('');
117
+ });
118
+ const getReportedBuild = (payload) => {
119
+ const reportedBuild = JSON.parse(payload);
120
+ if ('outputDirectory' in reportedBuild &&
121
+ typeof reportedBuild.outputDirectory === 'string' &&
122
+ 'publicPath' in reportedBuild &&
123
+ typeof reportedBuild.publicPath === 'string') {
124
+ return reportedBuild;
125
+ }
126
+ throw exports.MalformedBuildError;
127
+ };
128
+ const spawnDevServer = () => __awaiter(void 0, void 0, void 0, function* () {
129
+ const builds = [];
130
+ const requestHandler = getRequestHandler({
131
+ builds,
132
+ root: process.cwd(),
133
+ routes: {
134
+ [REPORT_BUILD_PATHNAME]: {
135
+ post: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
136
+ const body = yield getRequestBody(req);
137
+ const reportedBuild = getReportedBuild(body);
138
+ builds.push(reportedBuild);
139
+ res.end();
140
+ }),
141
+ },
142
+ },
143
+ });
144
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
145
+ const server = http_1.default.createServer(requestHandler);
146
+ server.listen();
147
+ yield (0, events_1.once)(server, 'listening');
148
+ return { builds, server, url: getBuildReportUrl(server) };
149
+ });
150
+ const buildAssets = (buildCommand, reporter) => __awaiter(void 0, void 0, void 0, function* () {
151
+ var _d, _e, _f, _g;
152
+ const { builds, server, url } = yield spawnDevServer();
153
+ // Spawn the build command process with the BUILD_PLUGINS_S8S_PORT environment variable.
154
+ const buildCommandProcess = (0, child_process_1.spawn)(buildCommand, [], {
155
+ env: Object.assign({ DATADOG_SYNTHETICS_REPORT_BUILD_URL: url }, process.env),
156
+ shell: (_e = (_d = process.env.SHELL) !== null && _d !== void 0 ? _d : process.env.ComSpec) !== null && _e !== void 0 ? _e : true,
157
+ });
158
+ (_f = buildCommandProcess.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
159
+ (_g = buildCommandProcess.stderr) === null || _g === void 0 ? void 0 : _g.pipe(process.stderr);
160
+ // Wait for the build command to finish
161
+ yield (0, events_1.once)(buildCommandProcess, 'close');
162
+ if (builds.length === 0) {
163
+ yield stopDevServer(server);
164
+ throw exports.UnconfiguredBuildPluginError;
165
+ }
166
+ // Once the build server is ready, return its URL with the advertised public prefix to run the tests against it.
167
+ return {
168
+ builds,
169
+ devServerUrl: url,
170
+ stop: () => __awaiter(void 0, void 0, void 0, function* () { return stopDevServer(server); }),
171
+ };
172
+ });
173
+ exports.buildAssets = buildAssets;
174
+ const getBuildReportUrl = (server) => {
175
+ var _a;
176
+ // net.Server can be listening on a named pipe, in which case the address is a string
177
+ // or not listening yet, in which case the address is null, which we cast to the 'undefined' string
178
+ // to meet the same condition as if it was a named pipe, and throw.
179
+ const serverAddress = (_a = server.address()) !== null && _a !== void 0 ? _a : 'undefined';
180
+ if (typeof serverAddress === 'string') {
181
+ throw new Error('Server address is not valid');
182
+ }
183
+ const url = new URL(serverAddress.family === 'IPv6'
184
+ ? `http://[${serverAddress.address}]:${serverAddress.port}`
185
+ : `http://${serverAddress.address}:${serverAddress.port}`);
186
+ url.pathname = REPORT_BUILD_PATHNAME;
187
+ return url.href;
188
+ };
189
+ const stopDevServer = (server) => __awaiter(void 0, void 0, void 0, function* () {
190
+ if (server.listening) {
191
+ const serverClosed = (0, events_1.once)(server, 'close');
192
+ server.close();
193
+ yield serverClosed;
194
+ }
195
+ });
196
+ //# sourceMappingURL=build-and-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-and-test.js","sourceRoot":"","sources":["../src/build-and-test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,mCAA2B;AAC3B,2BAAiC;AACjC,gDAAuB;AAEvB,kDAAyB;AASzB,MAAM,qBAAqB,GAAG,qBAAqB,CAAA;AAEtC,QAAA,4BAA4B,GAAG,IAAI,KAAK,CAAC;;;CAGrD,CAAC,CAAA;AAEW,QAAA,mBAAmB,GAAG,IAAI,KAAK,CAC1C,wFAAwF,CACzF,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,0BAA0B;IACnC,IAAI,EAAE,0BAA0B;IAChC,EAAE,EAAE,wBAAwB;IAC5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WAAW,eAoCvB;AAED,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAU,EAAE;;IACxD,qFAAqF;IACrF,mGAAmG;IACnG,mEAAmE;IACnE,MAAM,aAAa,GAAG,MAAA,MAAM,CAAC,OAAO,EAAE,mCAAI,WAAW,CAAA;IACrD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;KAC/C;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,aAAa,CAAC,MAAM,KAAK,MAAM;QAC7B,CAAC,CAAC,WAAW,aAAa,CAAC,OAAO,KAAK,aAAa,CAAC,IAAI,EAAE;QAC3D,CAAC,CAAC,UAAU,aAAa,CAAC,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,CAC5D,CAAA;IAED,GAAG,CAAC,QAAQ,GAAG,qBAAqB,CAAA;IAEpC,OAAO,GAAG,CAAC,IAAI,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,CAAO,MAAmB,EAAE,EAAE;IAClD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,MAAM,YAAY,GAAG,IAAA,aAAI,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC1C,MAAM,CAAC,KAAK,EAAE,CAAA;QACd,MAAM,YAAY,CAAA;KACnB;AACH,CAAC,CAAA,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { DeployTestsCommand } from '@datadog/datadog-ci-base/commands/synthetics/deploy-tests-command';
2
+ import { Logger } from '@datadog/datadog-ci-base/helpers/logger';
3
+ import { DeployTestsCommandConfig, MainReporter } from '../interfaces';
4
+ import { RecursivePartial } from '../utils/internal';
5
+ export declare class PluginCommand extends DeployTestsCommand {
6
+ protected reporter: MainReporter;
7
+ protected config: DeployTestsCommandConfig;
8
+ protected fipsConfig: {
9
+ fips: boolean;
10
+ fipsIgnoreError: boolean;
11
+ };
12
+ protected logger: Logger;
13
+ static getDefaultConfig(): DeployTestsCommandConfig;
14
+ protected setup(): Promise<void>;
15
+ protected resolveConfig(): Promise<void>;
16
+ execute(): Promise<1 | 0>;
17
+ protected resolveConfigFromEnv(): RecursivePartial<DeployTestsCommandConfig>;
18
+ protected resolveConfigFromCli(): RecursivePartial<DeployTestsCommandConfig>;
19
+ }