@datadog/datadog-ci 3.3.1 → 3.4.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.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js +2 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part1.test.js.map +1 -1
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js +4 -0
- package/dist/commands/lambda/__tests__/functions/instrument.part2.test.js.map +1 -1
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +3 -0
- package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +1 -1
- package/dist/commands/lambda/__tests__/instrument.test.js +7 -0
- package/dist/commands/lambda/__tests__/instrument.test.js.map +1 -1
- package/dist/commands/lambda/__tests__/uninstrument.test.js +3 -0
- package/dist/commands/lambda/__tests__/uninstrument.test.js.map +1 -1
- package/dist/commands/lambda/constants.d.ts +3 -0
- package/dist/commands/lambda/constants.js +5 -2
- package/dist/commands/lambda/constants.js.map +1 -1
- package/dist/commands/lambda/functions/instrument.js +10 -0
- package/dist/commands/lambda/functions/instrument.js.map +1 -1
- package/dist/commands/lambda/functions/uninstrument.js +3 -0
- package/dist/commands/lambda/functions/uninstrument.js.map +1 -1
- package/dist/commands/lambda/instrument.d.ts +1 -0
- package/dist/commands/lambda/instrument.js +5 -2
- package/dist/commands/lambda/instrument.js.map +1 -1
- package/dist/commands/lambda/interfaces.d.ts +3 -0
- package/dist/commands/react-native/__tests__/codepush.test.js +35 -0
- package/dist/commands/react-native/__tests__/codepush.test.js.map +1 -1
- package/dist/commands/react-native/__tests__/utils.test.js +42 -0
- package/dist/commands/react-native/__tests__/utils.test.js.map +1 -1
- package/dist/commands/react-native/codepush.js +7 -2
- package/dist/commands/react-native/codepush.js.map +1 -1
- package/dist/commands/react-native/utils.d.ts +1 -0
- package/dist/commands/react-native/utils.js +5 -1
- package/dist/commands/react-native/utils.js.map +1 -1
- package/dist/commands/sbom/__tests__/payload.test.js +31 -0
- package/dist/commands/sbom/__tests__/payload.test.js.map +1 -1
- package/dist/commands/sbom/__tests__/validation.test.js +4 -0
- package/dist/commands/sbom/__tests__/validation.test.js.map +1 -1
- package/dist/commands/sbom/constants.d.ts +1 -0
- package/dist/commands/sbom/constants.js +2 -1
- package/dist/commands/sbom/constants.js.map +1 -1
- package/dist/commands/sbom/payload.js +66 -0
- package/dist/commands/sbom/payload.js.map +1 -1
- package/dist/commands/sbom/types.d.ts +13 -0
- package/dist/commands/span/__tests__/span.test.d.ts +1 -0
- package/dist/commands/span/__tests__/span.test.js +108 -0
- package/dist/commands/span/__tests__/span.test.js.map +1 -0
- package/dist/commands/span/cli.d.ts +1 -0
- package/dist/commands/span/cli.js +5 -0
- package/dist/commands/span/cli.js.map +1 -0
- package/dist/commands/span/span.d.ts +10 -0
- package/dist/commands/span/span.js +112 -0
- package/dist/commands/span/span.js.map +1 -0
- package/dist/commands/synthetics/__tests__/build-and-test.test.js +63 -105
- package/dist/commands/synthetics/__tests__/build-and-test.test.js.map +1 -1
- package/dist/commands/synthetics/build-and-test.d.ts +20 -3
- package/dist/commands/synthetics/build-and-test.js +180 -66
- package/dist/commands/synthetics/build-and-test.js.map +1 -1
- package/dist/commands/synthetics/run-tests-command.js +5 -2
- package/dist/commands/synthetics/run-tests-command.js.map +1 -1
- package/dist/commands/synthetics/utils/internal.d.ts +0 -2
- package/dist/commands/synthetics/utils/internal.js +1 -15
- package/dist/commands/synthetics/utils/internal.js.map +1 -1
- package/dist/commands/trace/__tests__/trace.test.js +3 -100
- package/dist/commands/trace/__tests__/trace.test.js.map +1 -1
- package/dist/commands/trace/helper.d.ts +16 -0
- package/dist/commands/trace/helper.js +123 -0
- package/dist/commands/trace/helper.js.map +1 -0
- package/dist/commands/trace/test-utils.d.ts +1 -0
- package/dist/commands/trace/test-utils.js +119 -0
- package/dist/commands/trace/test-utils.js.map +1 -0
- package/dist/commands/trace/trace.d.ts +2 -12
- package/dist/commands/trace/trace.js +14 -93
- package/dist/commands/trace/trace.js.map +1 -1
- package/dist/helpers/__tests__/flare.test.js +2 -1
- package/dist/helpers/__tests__/flare.test.js.map +1 -1
- package/dist/helpers/flare.js +2 -1
- package/dist/helpers/flare.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"span.test.js","sourceRoot":"","sources":["../../../../src/commands/span/__tests__/span.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oCAAoC;AACpC,mCAAkC;AAElC,qDAA0C;AAE1C,kEAAqE;AAErE,uDAA0D;AAE1D,kCAAmC;AAEnC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,CAAO,SAAmB,EAAE,QAAiC,EAAE,EAAE;QAC9E,MAAM,GAAG,GAAG,IAAI,cAAG,EAAE,CAAA;QACrB,GAAG,CAAC,QAAQ,CAAC,kBAAW,CAAC,CAAA;QACzB,MAAM,OAAO,GAAG,IAAA,4BAAiB,GAAS,CAAA;QAC1C,OAAO,CAAC,GAAG,mBAAI,UAAU,EAAE,aAAa,IAAK,QAAQ,CAAC,CAAA;QACtD,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACzB,OAAO,CAAC,MAAM,GAAG,IAAI,oBAAW,EAAE,CAAA;QAClC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,EAAE,OAAO,CAAC,CAAA;QAEjF,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,CAAA;IACxB,CAAC,CAAA,CAAA;IAED,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,IAAI,CAAC,aAAa,EAAE,GAAS,EAAE;YAC7B,MAAM,GAAG,GAAG,EAAC,SAAS,EAAE,GAAG,EAAC,CAAA;YAC5B,MAAM,EAAC,OAAO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AAE;YACnC,MAAM,GAAG,GAAG,EAAC,SAAS,EAAE,GAAG,EAAC,CAAA;YAC5B,MAAM,EAAC,OAAO,EAAE,IAAI,EAAC,GAAG,MAAM,MAAM,CAClC,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,EACtG,GAAG,CACJ,CAAA;YACD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;YACxD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;QAC/D,CAAC,CAAA,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAA,gCAAmB,EAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AAC9E,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/commands/span/cli.ts"],"names":[],"mappings":";;AAAA,iCAAkC;AAElC,MAAM,CAAC,OAAO,GAAG,CAAC,kBAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomSpanCommand } from '../trace/helper';
|
|
2
|
+
export declare class SpanCommand extends CustomSpanCommand {
|
|
3
|
+
static paths: string[][];
|
|
4
|
+
static usage: import("clipanion").Usage;
|
|
5
|
+
private name;
|
|
6
|
+
private durationInMs;
|
|
7
|
+
private startTimeInMs;
|
|
8
|
+
private endTimeInMs;
|
|
9
|
+
execute(): Promise<number>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.SpanCommand = void 0;
|
|
36
|
+
const clipanion_1 = require("clipanion");
|
|
37
|
+
const validation = __importStar(require("../../helpers/validation"));
|
|
38
|
+
const helper_1 = require("../trace/helper");
|
|
39
|
+
class SpanCommand extends helper_1.CustomSpanCommand {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.name = clipanion_1.Option.String('--name');
|
|
43
|
+
this.durationInMs = clipanion_1.Option.String('--duration', {
|
|
44
|
+
validator: validation.isInteger(),
|
|
45
|
+
});
|
|
46
|
+
this.startTimeInMs = clipanion_1.Option.String('--start-time', {
|
|
47
|
+
validator: validation.isInteger(),
|
|
48
|
+
});
|
|
49
|
+
this.endTimeInMs = clipanion_1.Option.String('--end-time', {
|
|
50
|
+
validator: validation.isInteger(),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
execute() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
this.tryEnableFips();
|
|
56
|
+
if (!this.name) {
|
|
57
|
+
this.context.stdout.write(`The span name must be provided.\n`);
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
if ((this.startTimeInMs && !this.endTimeInMs) ||
|
|
61
|
+
(!this.startTimeInMs && this.endTimeInMs) ||
|
|
62
|
+
(this.durationInMs && (this.startTimeInMs || this.endTimeInMs))) {
|
|
63
|
+
this.context.stdout.write(`Either duration or start and end time must be provided.\n`);
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
if (this.startTimeInMs && this.endTimeInMs) {
|
|
67
|
+
this.durationInMs = this.endTimeInMs - this.startTimeInMs;
|
|
68
|
+
}
|
|
69
|
+
if (!this.durationInMs) {
|
|
70
|
+
this.context.stdout.write(`The span duration must be provided or start-time and end-time.\n`);
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
if (this.durationInMs < 0) {
|
|
74
|
+
this.context.stdout.write(`The span duration must be positive / end time must be after start time.\n`);
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
const endTime = this.endTimeInMs ? new Date(this.endTimeInMs) : new Date();
|
|
78
|
+
const startTime = new Date(endTime.getTime() - this.durationInMs);
|
|
79
|
+
return this.executeReportCustomSpan(this.generateSpanId(), startTime, endTime, {
|
|
80
|
+
name: this.name,
|
|
81
|
+
error_message: '',
|
|
82
|
+
exit_code: 0,
|
|
83
|
+
command: 'datadog-ci trace span',
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.SpanCommand = SpanCommand;
|
|
89
|
+
SpanCommand.paths = [['trace', 'span']];
|
|
90
|
+
SpanCommand.usage = clipanion_1.Command.Usage({
|
|
91
|
+
category: 'CI Visibility',
|
|
92
|
+
description: 'Report a custom span to Datadog with name, start / end time or duration, tags and measures.',
|
|
93
|
+
details: `
|
|
94
|
+
This command reports a span with custom name and custom duration to Datadog.\n
|
|
95
|
+
See README for details.
|
|
96
|
+
`,
|
|
97
|
+
examples: [
|
|
98
|
+
[
|
|
99
|
+
'Create span with name "Get Dependencies" and duration of 10s and report to Datadog',
|
|
100
|
+
'datadog-ci trace span --name "Get Dependencies" --duration 10000',
|
|
101
|
+
],
|
|
102
|
+
[
|
|
103
|
+
'Create span with name "Build" and duration of 10s using timestamps and report to Datadog',
|
|
104
|
+
'datadog-ci trace span --name "Build" --start-time 1744357891967 --end-time 1744357901967',
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
'Create span with name "Get Dependencies" and duration of 10s and report to Datadog with tags and measures',
|
|
108
|
+
'datadog-ci trace span --name "Get Dependencies" --duration 10000 --tags "dependency-set:notify" --measures "n-dependencies:42"',
|
|
109
|
+
],
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=span.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"span.js","sourceRoot":"","sources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CAqBjB"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -31,103 +8,84 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
9
|
});
|
|
33
10
|
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const http = __importStar(require("http"));
|
|
39
|
-
const axios_1 = __importDefault(require("axios"));
|
|
40
12
|
const build_and_test_1 = require("../build-and-test");
|
|
41
13
|
const fixtures_1 = require("./fixtures");
|
|
42
14
|
const NODE_COMMAND = process.execPath;
|
|
43
|
-
describe('build-and-test -
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
15
|
+
describe('build-and-test - buildAssets', () => {
|
|
16
|
+
const tearDowns = [];
|
|
17
|
+
afterEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
for (let tearDown; (tearDown = tearDowns.pop());) {
|
|
19
|
+
yield tearDown();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
// This httpClient function should be self-contained, as its body will be injected as a string in the build command.
|
|
23
|
+
const httpClient = () => {
|
|
24
|
+
const url = process.env.DATADOG_SYNTHETICS_REPORT_BUILD_URL;
|
|
25
|
+
if (!url) {
|
|
26
|
+
throw new Error('DATADOG_SYNTHETICS_REPORT_BUILD_URL is not set');
|
|
27
|
+
}
|
|
28
|
+
void fetch(url, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
},
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
outputDirectory: 'output-directory',
|
|
35
|
+
publicPath: 'prefix/',
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
};
|
|
48
39
|
test('alert when the build-plugin is not configured', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
40
|
// Given a build command without the build plugin configured
|
|
50
41
|
const MOCKED_BUILD_COMMAND_NOT_CONFIGURED = `${NODE_COMMAND} -e "console.log('build successful')"`;
|
|
51
42
|
// When calling spawnBuildPluginDevServer
|
|
52
|
-
const commandPromise = (0, build_and_test_1.
|
|
43
|
+
const commandPromise = (0, build_and_test_1.buildAssets)(MOCKED_BUILD_COMMAND_NOT_CONFIGURED, fixtures_1.mockReporter);
|
|
53
44
|
// Then it should throw when the command exits.
|
|
54
45
|
yield expect(commandPromise).rejects.toThrow(build_and_test_1.UnconfiguredBuildPluginError);
|
|
55
46
|
}));
|
|
56
|
-
test('
|
|
57
|
-
// Given a
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const httpDevServer = () => {
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
http
|
|
63
|
-
.createServer((_, res) => res
|
|
64
|
-
.writeHead(200, {
|
|
65
|
-
'Content-Type': 'application/json',
|
|
66
|
-
})
|
|
67
|
-
.end(JSON.stringify({
|
|
68
|
-
status: 'success',
|
|
69
|
-
publicPrefix: 'prefix2/',
|
|
70
|
-
})))
|
|
71
|
-
.listen(process.env.BUILD_PLUGINS_S8S_PORT);
|
|
72
|
-
}, 500);
|
|
73
|
-
};
|
|
74
|
-
const SERVER_IMPLEMENTATION = httpDevServer.toString().replace(/\n\s+/g, '');
|
|
75
|
-
const MOCKED_BUILD_COMMAND = `${NODE_COMMAND} -e "(${SERVER_IMPLEMENTATION})()"`;
|
|
47
|
+
test('advertise the right URL and returns the reported builds', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
// Given a build command which reports a build with a publicPath and an outputDirectory to the url advertised by DATADOG_SYNTHETICS_REPORT_BUILD_URL
|
|
49
|
+
const CLIENT_IMPLEMENTATION = httpClient.toString().replace(/\n\s+/g, '');
|
|
50
|
+
const MOCKED_BUILD_COMMAND = `${NODE_COMMAND} -e "(${CLIENT_IMPLEMENTATION})()"`;
|
|
76
51
|
// When calling spawnBuildPluginDevServer
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
yield command.stop();
|
|
88
|
-
}));
|
|
89
|
-
test('should wait for dev server even if the build fails', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
|
-
// Set up axios response sequence
|
|
91
|
-
jest
|
|
92
|
-
.spyOn(axios_1.default, 'get')
|
|
93
|
-
.mockRejectedValueOnce({ code: 'ECONNREFUSED' }) // First attempt: connection refused
|
|
94
|
-
.mockResolvedValueOnce({ data: { status: 'fail' } }) // Second attempt: build failed
|
|
95
|
-
.mockResolvedValueOnce({ data: { status: 'success', publicPrefix: 'prefix3/' } }); // Third attempt: success
|
|
96
|
-
// Setup isAxiosError for ECONNREFUSED error
|
|
97
|
-
jest.spyOn(axios_1.default, 'isAxiosError').mockImplementation((error) => {
|
|
98
|
-
return error && error.code === 'ECONNREFUSED';
|
|
99
|
-
});
|
|
100
|
-
// When calling spawnBuildPluginDevServer with any command
|
|
101
|
-
const MOCKED_BUILD_COMMAND = `${NODE_COMMAND} -e "setTimeout(() => {}, 100000)"`;
|
|
102
|
-
const command = yield (0, build_and_test_1.spawnBuildPluginDevServer)(MOCKED_BUILD_COMMAND, fixtures_1.mockReporter);
|
|
103
|
-
// Then it should wait until the build succeeds
|
|
104
|
-
expect(command.devServerUrl).toBe('http://localhost:4000');
|
|
105
|
-
expect(command.publicPrefix).toBe('prefix3/');
|
|
106
|
-
// Verify the axios GET was called multiple times
|
|
107
|
-
expect(axios_1.default.get).toHaveBeenCalledTimes(3);
|
|
108
|
-
// Stop the command at the end of the test.
|
|
109
|
-
yield command.stop();
|
|
52
|
+
const { builds, devServerUrl, stop } = yield (0, build_and_test_1.buildAssets)(MOCKED_BUILD_COMMAND, fixtures_1.mockReporter);
|
|
53
|
+
tearDowns.push(stop);
|
|
54
|
+
// Then it should return the devServerUrl and the path prefix.
|
|
55
|
+
expect(devServerUrl).toMatch(/\/_datadog-ci_\/build$/);
|
|
56
|
+
expect(builds).toEqual([
|
|
57
|
+
{
|
|
58
|
+
outputDirectory: 'output-directory',
|
|
59
|
+
publicPath: 'prefix/',
|
|
60
|
+
},
|
|
61
|
+
]);
|
|
110
62
|
}));
|
|
111
|
-
test('
|
|
112
|
-
//
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
63
|
+
test('rejects malformed builds', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
// Given the devServer to which to report builds
|
|
65
|
+
const CLIENT_IMPLEMENTATION = httpClient.toString().replace(/\n\s+/g, '');
|
|
66
|
+
const MOCKED_BUILD_COMMAND = `${NODE_COMMAND} -e "(${CLIENT_IMPLEMENTATION})()"`;
|
|
67
|
+
const { devServerUrl, stop } = yield (0, build_and_test_1.buildAssets)(MOCKED_BUILD_COMMAND, fixtures_1.mockReporter);
|
|
68
|
+
tearDowns.push(stop);
|
|
69
|
+
// When sending a malformed build
|
|
70
|
+
const correctPayload = {
|
|
71
|
+
method: 'POST',
|
|
72
|
+
headers: {
|
|
73
|
+
'Content-Type': 'application/json',
|
|
74
|
+
},
|
|
75
|
+
body: {
|
|
76
|
+
outputDirectory: 'output-directory',
|
|
77
|
+
publicPath: 'prefix/',
|
|
119
78
|
},
|
|
120
79
|
};
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
yield expect(commandPromise).rejects.toThrow('Dev server returned error: 500 Internal Server Error');
|
|
80
|
+
const [missingOutputDirectory, missingPublicPath] = yield Promise.all([
|
|
81
|
+
fetch(devServerUrl, Object.assign(Object.assign({}, correctPayload), { body: JSON.stringify(Object.assign(Object.assign({}, correctPayload.body), { outputDirectory: undefined })) })),
|
|
82
|
+
fetch(devServerUrl, Object.assign(Object.assign({}, correctPayload), { body: JSON.stringify(Object.assign(Object.assign({}, correctPayload.body), { publicPath: undefined })) })),
|
|
83
|
+
]);
|
|
84
|
+
// Then it should reject the malformed builds reported.
|
|
85
|
+
expect(missingOutputDirectory.status).toBe(500);
|
|
86
|
+
expect(yield missingOutputDirectory.text()).toBe(`Internal Server Error: ${build_and_test_1.MalformedBuildError.message}`);
|
|
87
|
+
expect(missingPublicPath.status).toBe(500);
|
|
88
|
+
expect(yield missingPublicPath.text()).toBe(`Internal Server Error: ${build_and_test_1.MalformedBuildError.message}`);
|
|
131
89
|
}));
|
|
132
90
|
});
|
|
133
91
|
//# sourceMappingURL=build-and-test.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-and-test.test.js","sourceRoot":"","sources":["../../../../src/commands/synthetics/__tests__/build-and-test.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-and-test.test.js","sourceRoot":"","sources":["../../../../src/commands/synthetics/__tests__/build-and-test.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sDAAgG;AAEhG,yCAAuC;AAEvC,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAA;AAErC,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,MAAM,SAAS,GAA4B,EAAE,CAAA;IAC7C,SAAS,CAAC,GAAS,EAAE;QACnB,KAAK,IAAI,QAAQ,EAAE,CAAC,QAAQ,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,GAAI;YACjD,MAAM,QAAQ,EAAE,CAAA;SACjB;IACH,CAAC,CAAA,CAAC,CAAA;IAEF,oHAAoH;IACpH,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAA;QAC3D,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;SAClE;QACD,KAAK,KAAK,CAAC,GAAG,EAAE;YACd,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,eAAe,EAAE,kBAAkB;gBACnC,UAAU,EAAE,SAAS;aACtB,CAAC;SACH,CAAC,C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@@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as http from 'http';
|
|
1
3
|
import { MainReporter } from './interfaces';
|
|
2
|
-
|
|
4
|
+
interface ReportedBuild {
|
|
5
|
+
outputDirectory: string;
|
|
6
|
+
publicPath: string;
|
|
7
|
+
}
|
|
3
8
|
export declare const UnconfiguredBuildPluginError: Error;
|
|
4
|
-
export declare const
|
|
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[];
|
|
5
22
|
devServerUrl: string;
|
|
6
|
-
publicPrefix: string;
|
|
7
23
|
stop: () => Promise<void>;
|
|
8
24
|
}>;
|
|
25
|
+
export {};
|