testcontainers 8.7.0 → 8.7.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.
- package/dist/bound-ports.js +1 -1
- package/dist/docker/docker-client.js +3 -3
- package/dist/docker/functions/container/attach-container.js +1 -1
- package/dist/docker/functions/container/container-logs.js +1 -1
- package/dist/docker/functions/container/create-container.js +3 -3
- package/dist/docker/functions/container/get-container.js +1 -1
- package/dist/docker/functions/image/build-image.js +4 -4
- package/dist/docker/functions/image/image-exists.js +1 -1
- package/dist/docker/functions/image/pull-image.js +1 -1
- package/dist/docker/functions/network/create-network.js +1 -1
- package/dist/docker/functions/run-in-container.js +4 -4
- package/dist/docker/pull-stream-parser.js +1 -1
- package/dist/docker-compose/functions/docker-compose-down.js +1 -1
- package/dist/docker-compose/functions/docker-compose-stop.js +1 -1
- package/dist/docker-compose/functions/docker-compose-up.js +3 -3
- package/dist/docker-compose-environment/docker-compose-environment.js +7 -7
- package/dist/docker-compose-environment/started-docker-compose-environment.js +2 -2
- package/dist/docker-compose-environment/stopped-docker-compose-environment.js +1 -1
- package/dist/generic-container/generic-container-builder.js +4 -4
- package/dist/generic-container/generic-container.js +15 -15
- package/dist/generic-container/started-generic-container.js +4 -4
- package/dist/log-system-diagnostics.js +2 -2
- package/dist/logger.js +1 -1
- package/dist/modules/kafka/kafka-container.d.ts +0 -1
- package/dist/modules/kafka/kafka-container.js +2 -3
- package/dist/network.js +2 -2
- package/dist/port-check.js +1 -1
- package/dist/port-forwarder.js +1 -1
- package/dist/port-generator.js +1 -1
- package/dist/reaper.js +1 -1
- package/dist/registry-auth-locator/credential-provider.js +2 -2
- package/dist/registry-auth-locator/index.js +1 -1
- package/dist/testcontainers-properties-file.js +4 -4
- package/dist/wait-strategy.js +3 -3
- package/package.json +20 -20
package/dist/bound-ports.js
CHANGED
|
@@ -21,7 +21,7 @@ class BoundPorts {
|
|
|
21
21
|
}
|
|
22
22
|
filter(ports) {
|
|
23
23
|
const boundPorts = new BoundPorts();
|
|
24
|
-
const containerPorts = ports.map((port) => port_1.getContainerPort(port));
|
|
24
|
+
const containerPorts = ports.map((port) => (0, port_1.getContainerPort)(port));
|
|
25
25
|
for (const [internalPort, hostPort] of this.iterator()) {
|
|
26
26
|
if (containerPorts.includes(internalPort)) {
|
|
27
27
|
boundPorts.setBinding(internalPort, hostPort);
|
|
@@ -35,7 +35,7 @@ const getDockerClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
35
35
|
if (yield isDockerDaemonReachable(dockerode)) {
|
|
36
36
|
const host = yield resolveHost(dockerode, uri);
|
|
37
37
|
logger_1.log.info(`Using Docker client strategy: ${strategy.getName()}, Docker host: ${host}`);
|
|
38
|
-
log_system_diagnostics_1.logSystemDiagnostics();
|
|
38
|
+
(0, log_system_diagnostics_1.logSystemDiagnostics)();
|
|
39
39
|
return { host, dockerode };
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
@@ -148,6 +148,6 @@ const findGateway = (dockerode) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
148
148
|
const inspectResult = yield dockerode.getNetwork("bridge").inspect();
|
|
149
149
|
return (_c = (_b = (_a = inspectResult === null || inspectResult === void 0 ? void 0 : inspectResult.IPAM) === null || _a === void 0 ? void 0 : _a.Config) === null || _b === void 0 ? void 0 : _b.find((config) => config.Gateway !== undefined)) === null || _c === void 0 ? void 0 : _c.Gateway;
|
|
150
150
|
});
|
|
151
|
-
const findDefaultGateway = (dockerode) => __awaiter(void 0, void 0, void 0, function* () { return run_in_container_1.runInContainer(dockerode, "alpine:3.14", ["sh", "-c", "ip route|awk '/default/ { print $3 }'"]); });
|
|
152
|
-
const isInContainer = () => fs_1.existsSync("/.dockerenv");
|
|
151
|
+
const findDefaultGateway = (dockerode) => __awaiter(void 0, void 0, void 0, function* () { return (0, run_in_container_1.runInContainer)(dockerode, "alpine:3.14", ["sh", "-c", "ip route|awk '/default/ { print $3 }'"]); });
|
|
152
|
+
const isInContainer = () => (0, fs_1.existsSync)("/.dockerenv");
|
|
153
153
|
exports.dockerClient = getDockerClient();
|
|
@@ -15,7 +15,7 @@ const logger_1 = require("../../../logger");
|
|
|
15
15
|
const attachContainer = (container) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
try {
|
|
17
17
|
const stream = (yield container.attach({ stream: true, stdout: true, stderr: true }));
|
|
18
|
-
return demux_stream_1.demuxStream(stream);
|
|
18
|
+
return (0, demux_stream_1.demuxStream)(stream);
|
|
19
19
|
}
|
|
20
20
|
catch (err) {
|
|
21
21
|
logger_1.log.error(`Failed to attach to container ${container.id}: ${err}`);
|
|
@@ -21,7 +21,7 @@ const containerLogs = (container) => __awaiter(void 0, void 0, void 0, function*
|
|
|
21
21
|
};
|
|
22
22
|
const stream = (yield container.logs(options));
|
|
23
23
|
stream.socket.unref();
|
|
24
|
-
return demux_stream_1.demuxStream(stream);
|
|
24
|
+
return (0, demux_stream_1.demuxStream)(stream);
|
|
25
25
|
}
|
|
26
26
|
catch (err) {
|
|
27
27
|
logger_1.log.error(`Failed to get container logs: ${err}`);
|
|
@@ -25,7 +25,7 @@ const createContainer = (options) => __awaiter(void 0, void 0, void 0, function*
|
|
|
25
25
|
Env: getEnv(options.env),
|
|
26
26
|
ExposedPorts: getExposedPorts(options.exposedPorts),
|
|
27
27
|
Cmd: options.cmd,
|
|
28
|
-
Labels: create_labels_1.createLabels(options.reusable, options.imageName, options.labels),
|
|
28
|
+
Labels: (0, create_labels_1.createLabels)(options.reusable, options.imageName, options.labels),
|
|
29
29
|
// @ts-ignore
|
|
30
30
|
Healthcheck: getHealthCheck(options.healthCheck),
|
|
31
31
|
HostConfig: {
|
|
@@ -51,7 +51,7 @@ const getEnv = (env) => Object.entries(env).reduce((dockerodeEnvironment, [key,
|
|
|
51
51
|
const getExposedPorts = (exposedPorts) => {
|
|
52
52
|
const dockerodeExposedPorts = {};
|
|
53
53
|
for (const exposedPort of exposedPorts) {
|
|
54
|
-
dockerodeExposedPorts[port_1.getContainerPort(exposedPort).toString()] = {};
|
|
54
|
+
dockerodeExposedPorts[(0, port_1.getContainerPort)(exposedPort).toString()] = {};
|
|
55
55
|
}
|
|
56
56
|
return dockerodeExposedPorts;
|
|
57
57
|
};
|
|
@@ -61,7 +61,7 @@ const getExtraHosts = (extraHosts) => {
|
|
|
61
61
|
const getPortBindings = (exposedPorts) => {
|
|
62
62
|
const dockerodePortBindings = {};
|
|
63
63
|
for (const exposedPort of exposedPorts) {
|
|
64
|
-
if (port_1.hasHostBinding(exposedPort)) {
|
|
64
|
+
if ((0, port_1.hasHostBinding)(exposedPort)) {
|
|
65
65
|
dockerodePortBindings[exposedPort.container] = [{ HostPort: exposedPort.host.toString() }];
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
@@ -38,7 +38,7 @@ const getContainerByHash = (hash) => __awaiter(void 0, void 0, void 0, function*
|
|
|
38
38
|
return undefined;
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
return yield exports.getContainerById(containers[0].Id);
|
|
41
|
+
return yield (0, exports.getContainerById)(containers[0].Id);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
catch (err) {
|
|
@@ -42,11 +42,11 @@ const buildImage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
42
42
|
dockerfile: options.dockerfileName,
|
|
43
43
|
buildargs: options.buildArgs,
|
|
44
44
|
t: options.imageName.toString(),
|
|
45
|
-
labels: create_labels_1.createLabels(false, options.imageName),
|
|
45
|
+
labels: (0, create_labels_1.createLabels)(false, options.imageName),
|
|
46
46
|
registryconfig: options.registryConfig,
|
|
47
47
|
pull: options.pullPolicy.shouldPull() ? "any" : undefined,
|
|
48
48
|
})
|
|
49
|
-
.then((stream) => byline_1.default(stream))
|
|
49
|
+
.then((stream) => (0, byline_1.default)(stream))
|
|
50
50
|
.then((stream) => {
|
|
51
51
|
stream.setEncoding("utf-8");
|
|
52
52
|
stream.on("data", (line) => logger_1.log.trace(`${options.imageName.toString()}: ${line}`));
|
|
@@ -61,10 +61,10 @@ const buildImage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
61
61
|
exports.buildImage = buildImage;
|
|
62
62
|
const createIsDockerIgnoredFunction = (context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
63
|
const dockerIgnoreFilePath = path_1.default.join(context, ".dockerignore");
|
|
64
|
-
if (!fs_1.existsSync(dockerIgnoreFilePath)) {
|
|
64
|
+
if (!(0, fs_1.existsSync)(dockerIgnoreFilePath)) {
|
|
65
65
|
return () => false;
|
|
66
66
|
}
|
|
67
|
-
const instance = dockerignore_1.default({ ignorecase: false });
|
|
67
|
+
const instance = (0, dockerignore_1.default)({ ignorecase: false });
|
|
68
68
|
const dockerIgnorePatterns = yield fs_1.promises.readFile(dockerIgnoreFilePath, { encoding: "utf-8" });
|
|
69
69
|
instance.add(dockerIgnorePatterns);
|
|
70
70
|
const filter = instance.createFilter();
|
|
@@ -12,6 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.imageExists = void 0;
|
|
13
13
|
const list_images_1 = require("./list-images");
|
|
14
14
|
const imageExists = (imageName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (yield list_images_1.listImages()).some((image) => image.equals(imageName));
|
|
15
|
+
return (yield (0, list_images_1.listImages)()).some((image) => image.equals(imageName));
|
|
16
16
|
});
|
|
17
17
|
exports.imageExists = imageExists;
|
|
@@ -16,7 +16,7 @@ const docker_client_1 = require("../../docker-client");
|
|
|
16
16
|
const image_exists_1 = require("./image-exists");
|
|
17
17
|
const pullImage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
18
|
try {
|
|
19
|
-
if ((yield image_exists_1.imageExists(options.imageName)) && !options.force) {
|
|
19
|
+
if ((yield (0, image_exists_1.imageExists)(options.imageName)) && !options.force) {
|
|
20
20
|
logger_1.log.debug(`Not pulling image as it already exists: ${options.imageName}`);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
@@ -26,7 +26,7 @@ const createNetwork = (options) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
26
26
|
Ingress: options.ingress,
|
|
27
27
|
EnableIPv6: options.enableIPv6,
|
|
28
28
|
Options: options.options,
|
|
29
|
-
Labels: Object.assign(Object.assign({}, options.labels), create_labels_1.createLabels(false)),
|
|
29
|
+
Labels: Object.assign(Object.assign({}, options.labels), (0, create_labels_1.createLabels)(false)),
|
|
30
30
|
});
|
|
31
31
|
return network.id;
|
|
32
32
|
}
|
|
@@ -19,14 +19,14 @@ const inspect_container_1 = require("./container/inspect-container");
|
|
|
19
19
|
const runInContainer = (dockerode, image, command) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
try {
|
|
21
21
|
const imageName = docker_image_name_1.DockerImageName.fromString(image);
|
|
22
|
-
yield pull_image_1.pullImage({ imageName, force: false });
|
|
22
|
+
yield (0, pull_image_1.pullImage)({ imageName, force: false });
|
|
23
23
|
logger_1.log.debug(`Creating container: ${image} with command: ${command.join(" ")}`);
|
|
24
24
|
const container = yield dockerode.createContainer({ Image: image, Cmd: command, HostConfig: { AutoRemove: true } });
|
|
25
25
|
logger_1.log.debug(`Attaching to container: ${container.id}`);
|
|
26
|
-
const stream = yield attach_container_1.attachContainer(container);
|
|
26
|
+
const stream = yield (0, attach_container_1.attachContainer)(container);
|
|
27
27
|
const promise = new Promise((resolve) => {
|
|
28
28
|
const interval = setInterval(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
const inspect = yield inspect_container_1.inspectContainer(container);
|
|
29
|
+
const inspect = yield (0, inspect_container_1.inspectContainer)(container);
|
|
30
30
|
if (inspect.state.status === "exited") {
|
|
31
31
|
clearInterval(interval);
|
|
32
32
|
stream.destroy();
|
|
@@ -40,7 +40,7 @@ const runInContainer = (dockerode, image, command) => __awaiter(void 0, void 0,
|
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
42
|
logger_1.log.debug(`Starting container: ${container.id}`);
|
|
43
|
-
yield start_container_1.startContainer(container);
|
|
43
|
+
yield (0, start_container_1.startContainer)(container);
|
|
44
44
|
logger_1.log.debug(`Waiting for container output: ${container.id}`);
|
|
45
45
|
const output = yield promise;
|
|
46
46
|
if (output.length === 0) {
|
|
@@ -14,7 +14,7 @@ class PullStreamParser {
|
|
|
14
14
|
const messagesById = new Map();
|
|
15
15
|
const statusesById = new Map();
|
|
16
16
|
return new Promise((resolve) => {
|
|
17
|
-
byline_1.default(stream).on("data", (line) => {
|
|
17
|
+
(0, byline_1.default)(stream).on("data", (line) => {
|
|
18
18
|
try {
|
|
19
19
|
const json = JSON.parse(line);
|
|
20
20
|
const { id, status } = json;
|
|
@@ -16,7 +16,7 @@ const docker_compose_1 = require("../docker-compose");
|
|
|
16
16
|
const dockerComposeDown = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
logger_1.log.info(`Downing DockerCompose environment`);
|
|
18
18
|
try {
|
|
19
|
-
yield docker_compose_1.down(Object.assign(Object.assign({}, default_docker_compose_options_1.defaultDockerComposeOptions(options)), { commandOptions: ["-v"] }));
|
|
19
|
+
yield (0, docker_compose_1.down)(Object.assign(Object.assign({}, (0, default_docker_compose_options_1.defaultDockerComposeOptions)(options)), { commandOptions: ["-v"] }));
|
|
20
20
|
logger_1.log.info(`Downed DockerCompose environment`);
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
|
@@ -16,7 +16,7 @@ const default_docker_compose_options_1 = require("../default-docker-compose-opti
|
|
|
16
16
|
const dockerComposeStop = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
logger_1.log.info(`Stopping DockerCompose environment`);
|
|
18
18
|
try {
|
|
19
|
-
yield docker_compose_1.stop(default_docker_compose_options_1.defaultDockerComposeOptions(options));
|
|
19
|
+
yield (0, docker_compose_1.stop)((0, default_docker_compose_options_1.defaultDockerComposeOptions)(options));
|
|
20
20
|
logger_1.log.info(`Stopped DockerCompose environment`);
|
|
21
21
|
}
|
|
22
22
|
catch (err) {
|
|
@@ -18,10 +18,10 @@ const dockerComposeUp = (options, services) => __awaiter(void 0, void 0, void 0,
|
|
|
18
18
|
logger_1.log.info(`Upping DockerCompose environment`);
|
|
19
19
|
try {
|
|
20
20
|
if (services) {
|
|
21
|
-
yield docker_compose_1.upMany(services, default_docker_compose_options_1.defaultDockerComposeOptions(options));
|
|
21
|
+
yield (0, docker_compose_1.upMany)(services, (0, default_docker_compose_options_1.defaultDockerComposeOptions)(options));
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
yield docker_compose_1.upAll(default_docker_compose_options_1.defaultDockerComposeOptions(options));
|
|
24
|
+
yield (0, docker_compose_1.upAll)((0, default_docker_compose_options_1.defaultDockerComposeOptions)(options));
|
|
25
25
|
}
|
|
26
26
|
logger_1.log.info(`Upped DockerCompose environment`);
|
|
27
27
|
}
|
|
@@ -29,7 +29,7 @@ const dockerComposeUp = (options, services) => __awaiter(void 0, void 0, void 0,
|
|
|
29
29
|
const errorMessage = err.err || err.message || err;
|
|
30
30
|
logger_1.log.error(`Failed to up DockerCompose environment: ${errorMessage}`);
|
|
31
31
|
try {
|
|
32
|
-
yield docker_compose_down_1.dockerComposeDown(options);
|
|
32
|
+
yield (0, docker_compose_down_1.dockerComposeDown)(options);
|
|
33
33
|
}
|
|
34
34
|
catch (_a) {
|
|
35
35
|
logger_1.log.warn(`Failed to down DockerCompose environment after failed up`);
|
|
@@ -89,20 +89,20 @@ class DockerComposeEnvironment {
|
|
|
89
89
|
composeOptions.push("--env-file", this.envFile);
|
|
90
90
|
}
|
|
91
91
|
this.profiles.forEach((profile) => composeOptions.push("--profile", profile));
|
|
92
|
-
yield docker_compose_up_1.dockerComposeUp(Object.assign(Object.assign({}, options), { commandOptions, composeOptions, env: this.env }), services);
|
|
93
|
-
const startedContainers = (yield list_containers_1.listContainers()).filter((container) => container.Labels["com.docker.compose.project"] === this.projectName);
|
|
92
|
+
yield (0, docker_compose_up_1.dockerComposeUp)(Object.assign(Object.assign({}, options), { commandOptions, composeOptions, env: this.env }), services);
|
|
93
|
+
const startedContainers = (yield (0, list_containers_1.listContainers)()).filter((container) => container.Labels["com.docker.compose.project"] === this.projectName);
|
|
94
94
|
const startedContainerNames = startedContainers.reduce((containerNames, startedContainer) => [
|
|
95
95
|
...containerNames,
|
|
96
96
|
startedContainer.Names.join(", "),
|
|
97
97
|
], []);
|
|
98
98
|
logger_1.log.info(`Started the following containers: ${startedContainerNames.join(", ")}`);
|
|
99
99
|
const startedGenericContainers = (yield Promise.all(startedContainers.map((startedContainer) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
const container = yield get_container_1.getContainerById(startedContainer.Id);
|
|
101
|
-
const containerName = container_name_resolver_1.resolveContainerName(this.projectName, startedContainer.Names[0]);
|
|
102
|
-
(yield container_logs_1.containerLogs(container))
|
|
100
|
+
const container = yield (0, get_container_1.getContainerById)(startedContainer.Id);
|
|
101
|
+
const containerName = (0, container_name_resolver_1.resolveContainerName)(this.projectName, startedContainer.Names[0]);
|
|
102
|
+
(yield (0, container_logs_1.containerLogs)(container))
|
|
103
103
|
.on("data", (data) => logger_1.containerLog.trace(`${containerName}: ${data}`))
|
|
104
104
|
.on("err", (data) => logger_1.containerLog.error(`${containerName}: ${data}`));
|
|
105
|
-
const inspectResult = yield inspect_container_1.inspectContainer(container);
|
|
105
|
+
const inspectResult = yield (0, inspect_container_1.inspectContainer)(container);
|
|
106
106
|
const boundPorts = bound_ports_1.BoundPorts.fromInspectResult(inspectResult);
|
|
107
107
|
try {
|
|
108
108
|
logger_1.log.info(`Waiting for container ${containerName} to be ready`);
|
|
@@ -112,7 +112,7 @@ class DockerComposeEnvironment {
|
|
|
112
112
|
catch (err) {
|
|
113
113
|
logger_1.log.error(`Container ${containerName} failed to be ready: ${err}`);
|
|
114
114
|
try {
|
|
115
|
-
yield docker_compose_down_1.dockerComposeDown(options);
|
|
115
|
+
yield (0, docker_compose_down_1.dockerComposeDown)(options);
|
|
116
116
|
}
|
|
117
117
|
catch (_a) {
|
|
118
118
|
logger_1.log.warn(`Failed to stop DockerCompose environment after failed up`);
|
|
@@ -22,13 +22,13 @@ class StartedDockerComposeEnvironment {
|
|
|
22
22
|
}
|
|
23
23
|
stop() {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
yield docker_compose_stop_1.dockerComposeStop(this.options);
|
|
25
|
+
yield (0, docker_compose_stop_1.dockerComposeStop)(this.options);
|
|
26
26
|
return new stopped_docker_compose_environment_1.StoppedDockerComposeEnvironment(this.options);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
down() {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
yield docker_compose_down_1.dockerComposeDown(this.options);
|
|
31
|
+
yield (0, docker_compose_down_1.dockerComposeDown)(this.options);
|
|
32
32
|
return new downed_docker_compose_environment_1.DownedDockerComposeEnvironment();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -18,7 +18,7 @@ class StoppedDockerComposeEnvironment {
|
|
|
18
18
|
}
|
|
19
19
|
down() {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
yield docker_compose_down_1.dockerComposeDown(this.options);
|
|
21
|
+
yield (0, docker_compose_down_1.dockerComposeDown)(this.options);
|
|
22
22
|
return new downed_docker_compose_environment_1.DownedDockerComposeEnvironment();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -46,9 +46,9 @@ class GenericContainerBuilder {
|
|
|
46
46
|
yield reaper_1.ReaperInstance.getInstance();
|
|
47
47
|
const dockerfile = path_1.default.resolve(this.context, this.dockerfileName);
|
|
48
48
|
logger_1.log.debug(`Preparing to build Dockerfile: ${dockerfile}`);
|
|
49
|
-
const imageNames = yield dockerfile_parser_1.getDockerfileImages(dockerfile);
|
|
49
|
+
const imageNames = yield (0, dockerfile_parser_1.getDockerfileImages)(dockerfile);
|
|
50
50
|
const registryConfig = yield this.getRegistryConfig(imageNames);
|
|
51
|
-
yield build_image_1.buildImage({
|
|
51
|
+
yield (0, build_image_1.buildImage)({
|
|
52
52
|
imageName: imageName,
|
|
53
53
|
context: this.context,
|
|
54
54
|
dockerfileName: this.dockerfileName,
|
|
@@ -57,7 +57,7 @@ class GenericContainerBuilder {
|
|
|
57
57
|
registryConfig,
|
|
58
58
|
});
|
|
59
59
|
const container = new generic_container_1.GenericContainer(imageName.toString());
|
|
60
|
-
if (!(yield image_exists_1.imageExists(imageName))) {
|
|
60
|
+
if (!(yield (0, image_exists_1.imageExists)(imageName))) {
|
|
61
61
|
throw new Error("Failed to build image");
|
|
62
62
|
}
|
|
63
63
|
return Promise.resolve(container);
|
|
@@ -67,7 +67,7 @@ class GenericContainerBuilder {
|
|
|
67
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
68
|
const authConfigs = [];
|
|
69
69
|
yield Promise.all(imageNames.map((imageName) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const authConfig = yield registry_auth_locator_1.getAuthConfig(imageName.registry);
|
|
70
|
+
const authConfig = yield (0, registry_auth_locator_1.getAuthConfig)(imageName.registry);
|
|
71
71
|
if (authConfig !== undefined) {
|
|
72
72
|
authConfigs.push(authConfig);
|
|
73
73
|
}
|
|
@@ -61,10 +61,10 @@ class GenericContainer {
|
|
|
61
61
|
}
|
|
62
62
|
start() {
|
|
63
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
yield pull_image_1.pullImage({
|
|
64
|
+
yield (0, pull_image_1.pullImage)({
|
|
65
65
|
imageName: this.imageName,
|
|
66
66
|
force: this.pullPolicy.shouldPull(),
|
|
67
|
-
authConfig: yield registry_auth_locator_1.getAuthConfig(this.imageName.registry),
|
|
67
|
+
authConfig: yield (0, registry_auth_locator_1.getAuthConfig)(this.imageName.registry),
|
|
68
68
|
});
|
|
69
69
|
if (!this.imageName.isReaper()) {
|
|
70
70
|
yield reaper_1.ReaperInstance.getInstance();
|
|
@@ -96,10 +96,10 @@ class GenericContainer {
|
|
|
96
96
|
user: this.user,
|
|
97
97
|
};
|
|
98
98
|
if (this.reuse) {
|
|
99
|
-
const containerHash = hash_1.hash(JSON.stringify(createContainerOptions));
|
|
99
|
+
const containerHash = (0, hash_1.hash)(JSON.stringify(createContainerOptions));
|
|
100
100
|
createContainerOptions.labels = { [labels_1.LABEL_CONTAINER_HASH]: containerHash };
|
|
101
101
|
logger_1.log.debug(`Container reuse has been enabled, hash: ${containerHash}`);
|
|
102
|
-
const container = yield get_container_1.getContainerByHash(containerHash);
|
|
102
|
+
const container = yield (0, get_container_1.getContainerByHash)(containerHash);
|
|
103
103
|
if (container !== undefined) {
|
|
104
104
|
logger_1.log.debug(`Found container to reuse with hash: ${containerHash}`);
|
|
105
105
|
return this.reuseContainer(container);
|
|
@@ -116,7 +116,7 @@ class GenericContainer {
|
|
|
116
116
|
}
|
|
117
117
|
reuseContainer(startedContainer) {
|
|
118
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
const inspectResult = yield inspect_container_1.inspectContainer(startedContainer);
|
|
119
|
+
const inspectResult = yield (0, inspect_container_1.inspectContainer)(startedContainer);
|
|
120
120
|
const boundPorts = bound_ports_1.BoundPorts.fromInspectResult(inspectResult).filter(this.ports);
|
|
121
121
|
yield this.waitForContainer(startedContainer, boundPorts);
|
|
122
122
|
return new started_generic_container_1.StartedGenericContainer(startedContainer, (yield docker_client_1.dockerClient).host, inspectResult, boundPorts, inspectResult.name);
|
|
@@ -124,13 +124,13 @@ class GenericContainer {
|
|
|
124
124
|
}
|
|
125
125
|
startContainer(createContainerOptions) {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
const container = yield create_container_1.createContainer(createContainerOptions);
|
|
127
|
+
const container = yield (0, create_container_1.createContainer)(createContainerOptions);
|
|
128
128
|
if (!this.imageName.isHelperContainer() && port_forwarder_1.PortForwarderInstance.isRunning()) {
|
|
129
129
|
const portForwarder = yield port_forwarder_1.PortForwarderInstance.getInstance();
|
|
130
130
|
const portForwarderNetworkId = portForwarder.getNetworkId();
|
|
131
131
|
const excludedNetworks = [portForwarderNetworkId, "none", "host"];
|
|
132
132
|
if (!this.networkMode || !excludedNetworks.includes(this.networkMode)) {
|
|
133
|
-
yield connect_network_1.connectNetwork({
|
|
133
|
+
yield (0, connect_network_1.connectNetwork)({
|
|
134
134
|
containerId: container.id,
|
|
135
135
|
networkId: portForwarderNetworkId,
|
|
136
136
|
networkAliases: [],
|
|
@@ -138,7 +138,7 @@ class GenericContainer {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
if (this.networkMode && this.networkAliases.length > 0) {
|
|
141
|
-
yield connect_network_1.connectNetwork({
|
|
141
|
+
yield (0, connect_network_1.connectNetwork)({
|
|
142
142
|
containerId: container.id,
|
|
143
143
|
networkId: this.networkMode,
|
|
144
144
|
networkAliases: this.networkAliases,
|
|
@@ -146,14 +146,14 @@ class GenericContainer {
|
|
|
146
146
|
}
|
|
147
147
|
if (this.tarToCopy) {
|
|
148
148
|
yield this.tarToCopy.finalize();
|
|
149
|
-
yield put_container_archive_1.putContainerArchive({ container, stream: this.tarToCopy, containerPath: "/" });
|
|
149
|
+
yield (0, put_container_archive_1.putContainerArchive)({ container, stream: this.tarToCopy, containerPath: "/" });
|
|
150
150
|
}
|
|
151
151
|
logger_1.log.info(`Starting container ${this.imageName} with ID: ${container.id}`);
|
|
152
|
-
yield start_container_1.startContainer(container);
|
|
153
|
-
(yield container_logs_1.containerLogs(container))
|
|
152
|
+
yield (0, start_container_1.startContainer)(container);
|
|
153
|
+
(yield (0, container_logs_1.containerLogs)(container))
|
|
154
154
|
.on("data", (data) => logger_1.containerLog.trace(`${container.id}: ${data.trim()}`))
|
|
155
155
|
.on("err", (data) => logger_1.containerLog.error(`${container.id}: ${data.trim()}`));
|
|
156
|
-
const inspectResult = yield inspect_container_1.inspectContainer(container);
|
|
156
|
+
const inspectResult = yield (0, inspect_container_1.inspectContainer)(container);
|
|
157
157
|
const boundPorts = bound_ports_1.BoundPorts.fromInspectResult(inspectResult).filter(this.ports);
|
|
158
158
|
yield this.waitForContainer(container, boundPorts);
|
|
159
159
|
const startedContainer = new started_generic_container_1.StartedGenericContainer(container, (yield docker_client_1.dockerClient).host, inspectResult, boundPorts, inspectResult.name);
|
|
@@ -253,7 +253,7 @@ class GenericContainer {
|
|
|
253
253
|
}
|
|
254
254
|
getTarToCopy() {
|
|
255
255
|
if (!this.tarToCopy) {
|
|
256
|
-
this.tarToCopy = archiver_1.default("tar");
|
|
256
|
+
this.tarToCopy = (0, archiver_1.default)("tar");
|
|
257
257
|
}
|
|
258
258
|
return this.tarToCopy;
|
|
259
259
|
}
|
|
@@ -268,8 +268,8 @@ class GenericContainer {
|
|
|
268
268
|
catch (err) {
|
|
269
269
|
logger_1.log.error(`Container failed to be ready: ${err}`);
|
|
270
270
|
try {
|
|
271
|
-
yield stop_container_1.stopContainer(container, { timeout: 0 });
|
|
272
|
-
yield remove_container_1.removeContainer(container, { removeVolumes: true });
|
|
271
|
+
yield (0, stop_container_1.stopContainer)(container, { timeout: 0 });
|
|
272
|
+
yield (0, remove_container_1.removeContainer)(container, { removeVolumes: true });
|
|
273
273
|
}
|
|
274
274
|
catch (stopErr) {
|
|
275
275
|
logger_1.log.error(`Failed to stop container after it failed to be ready: ${stopErr}`);
|
|
@@ -33,8 +33,8 @@ class StartedGenericContainer {
|
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
logger_1.log.info(`Stopping container with ID: ${this.container.id}`);
|
|
35
35
|
const resolvedOptions = Object.assign({ timeout: 0, removeVolumes: true }, options);
|
|
36
|
-
yield stop_container_1.stopContainer(this.container, { timeout: resolvedOptions.timeout });
|
|
37
|
-
yield remove_container_1.removeContainer(this.container, { removeVolumes: resolvedOptions.removeVolumes });
|
|
36
|
+
yield (0, stop_container_1.stopContainer)(this.container, { timeout: resolvedOptions.timeout });
|
|
37
|
+
yield (0, remove_container_1.removeContainer)(this.container, { removeVolumes: resolvedOptions.removeVolumes });
|
|
38
38
|
return new stopped_generic_container_1.StoppedGenericContainer();
|
|
39
39
|
});
|
|
40
40
|
}
|
|
@@ -63,10 +63,10 @@ class StartedGenericContainer {
|
|
|
63
63
|
return this.inspectResult.networkSettings[networkName].ipAddress;
|
|
64
64
|
}
|
|
65
65
|
exec(command) {
|
|
66
|
-
return exec_container_1.execContainer(this.container, command);
|
|
66
|
+
return (0, exec_container_1.execContainer)(this.container, command);
|
|
67
67
|
}
|
|
68
68
|
logs() {
|
|
69
|
-
return container_logs_1.containerLogs(this.container);
|
|
69
|
+
return (0, container_logs_1.containerLogs)(this.container);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
exports.StartedGenericContainer = StartedGenericContainer;
|
|
@@ -16,7 +16,7 @@ const get_info_1 = require("./docker/functions/get-info");
|
|
|
16
16
|
const logSystemDiagnostics = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
const info = {
|
|
18
18
|
node: getNodeInfo(),
|
|
19
|
-
docker: yield get_info_1.getDockerInfo(),
|
|
19
|
+
docker: yield (0, get_info_1.getDockerInfo)(),
|
|
20
20
|
dockerCompose: yield getDockerComposeInfo(),
|
|
21
21
|
};
|
|
22
22
|
logger_1.log.debug(`System diagnostics: ${JSON.stringify(info)}`);
|
|
@@ -32,7 +32,7 @@ const getNodeInfo = () => {
|
|
|
32
32
|
const getDockerComposeInfo = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
33
|
try {
|
|
34
34
|
return {
|
|
35
|
-
version: (yield docker_compose_1.version()).data.version,
|
|
35
|
+
version: (yield (0, docker_compose_1.version)()).data.version,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
catch (err) {
|
package/dist/logger.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.containerLog = exports.log = exports.FakeLogger = void 0;
|
|
|
7
7
|
const debug_1 = __importDefault(require("debug"));
|
|
8
8
|
class DebugLogger {
|
|
9
9
|
constructor(namespace) {
|
|
10
|
-
this.logger = debug_1.default(namespace);
|
|
10
|
+
this.logger = (0, debug_1.default)(namespace);
|
|
11
11
|
}
|
|
12
12
|
trace(message) {
|
|
13
13
|
this.logger(`TRACE ${message}`);
|
|
@@ -8,7 +8,6 @@ import { InspectResult } from "../../docker/functions/container/inspect-containe
|
|
|
8
8
|
export declare const KAFKA_IMAGE = "confluentinc/cp-kafka:5.5.4";
|
|
9
9
|
export declare class KafkaContainer extends GenericContainer {
|
|
10
10
|
private readonly uuid;
|
|
11
|
-
private readonly portGenerator;
|
|
12
11
|
private isZooKeeperProvided;
|
|
13
12
|
private zooKeeperHost?;
|
|
14
13
|
private zooKeeperPort?;
|
|
@@ -13,16 +13,15 @@ exports.StartedKafkaContainer = exports.KafkaContainer = exports.KAFKA_IMAGE = v
|
|
|
13
13
|
const generic_container_1 = require("../../generic-container/generic-container");
|
|
14
14
|
const uuid_1 = require("../../uuid");
|
|
15
15
|
const abstract_started_container_1 = require("../abstract-started-container");
|
|
16
|
-
const port_generator_1 = require("../../port-generator");
|
|
17
16
|
const docker_client_1 = require("../../docker/docker-client");
|
|
18
17
|
const KAFKA_PORT = 9093;
|
|
19
18
|
const KAFKA_BROKER_PORT = 9092;
|
|
19
|
+
const DEFAULT_ZOOKEEPER_PORT = 2181;
|
|
20
20
|
exports.KAFKA_IMAGE = "confluentinc/cp-kafka:5.5.4";
|
|
21
21
|
class KafkaContainer extends generic_container_1.GenericContainer {
|
|
22
22
|
constructor(image = exports.KAFKA_IMAGE) {
|
|
23
23
|
super(image);
|
|
24
24
|
this.uuid = new uuid_1.RandomUuid();
|
|
25
|
-
this.portGenerator = new port_generator_1.RandomUniquePortGenerator();
|
|
26
25
|
this.isZooKeeperProvided = false;
|
|
27
26
|
this.withExposedPorts(KAFKA_PORT)
|
|
28
27
|
.withStartupTimeout(180000)
|
|
@@ -53,7 +52,7 @@ class KafkaContainer extends generic_container_1.GenericContainer {
|
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
54
|
this.zooKeeperHost = this.uuid.nextUuid();
|
|
56
|
-
this.zooKeeperPort =
|
|
55
|
+
this.zooKeeperPort = DEFAULT_ZOOKEEPER_PORT;
|
|
57
56
|
this.addExposedPorts(this.zooKeeperPort);
|
|
58
57
|
this.withEnv("KAFKA_ZOOKEEPER_CONNECT", `localhost:${this.zooKeeperPort}`);
|
|
59
58
|
command += "echo 'clientPort=" + this.zooKeeperPort + "' > zookeeper.properties\n";
|
package/dist/network.js
CHANGED
|
@@ -22,7 +22,7 @@ class Network {
|
|
|
22
22
|
start() {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
yield reaper_1.ReaperInstance.getInstance();
|
|
25
|
-
const id = yield create_network_1.createNetwork(this.createNetworkOptions);
|
|
25
|
+
const id = yield (0, create_network_1.createNetwork)(this.createNetworkOptions);
|
|
26
26
|
logger_1.log.info(`Started network with ID: ${id}`);
|
|
27
27
|
return new StartedNetwork(id, this.createNetworkOptions);
|
|
28
28
|
});
|
|
@@ -43,7 +43,7 @@ class StartedNetwork {
|
|
|
43
43
|
stop() {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
logger_1.log.info(`Stopping network with ID: ${this.id}`);
|
|
46
|
-
yield remove_network_1.removeNetwork(this.id);
|
|
46
|
+
yield (0, remove_network_1.removeNetwork)(this.id);
|
|
47
47
|
return new StoppedNetwork();
|
|
48
48
|
});
|
|
49
49
|
}
|
package/dist/port-check.js
CHANGED
|
@@ -49,7 +49,7 @@ class InternalPortCheck {
|
|
|
49
49
|
["/bin/sh", "-c", `nc -vz -w 1 localhost ${port}`],
|
|
50
50
|
["/bin/bash", "-c", `</dev/tcp/localhost/${port}`],
|
|
51
51
|
];
|
|
52
|
-
const commandResults = yield Promise.all(commands.map((command) => exec_container_1.execContainer(this.container, command)));
|
|
52
|
+
const commandResults = yield Promise.all(commands.map((command) => (0, exec_container_1.execContainer)(this.container, command)));
|
|
53
53
|
return commandResults.some((result) => result.exitCode === 0);
|
|
54
54
|
});
|
|
55
55
|
}
|
package/dist/port-forwarder.js
CHANGED
|
@@ -69,7 +69,7 @@ class PortForwarderInstance {
|
|
|
69
69
|
const host = (yield docker_client_1.dockerClient).host;
|
|
70
70
|
const port = container.getMappedPort(22);
|
|
71
71
|
logger_1.log.debug(`Connecting to Port Forwarder on ${host}:${port}`);
|
|
72
|
-
const connection = yield ssh_remote_port_forward_1.createSshConnection({ host, port, username, password });
|
|
72
|
+
const connection = yield (0, ssh_remote_port_forward_1.createSshConnection)({ host, port, username, password });
|
|
73
73
|
connection.unref();
|
|
74
74
|
return new PortForwarder(connection, container);
|
|
75
75
|
});
|
package/dist/port-generator.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.FixedPortGenerator = exports.RandomUniquePortGenerator = void 0;
|
|
|
16
16
|
const get_port_1 = __importDefault(require("get-port"));
|
|
17
17
|
class RandomPortGenerator {
|
|
18
18
|
generatePort() {
|
|
19
|
-
return get_port_1.default({ port: this.randomBetweenInclusive(10000, 65535) });
|
|
19
|
+
return (0, get_port_1.default)({ port: this.randomBetweenInclusive(10000, 65535) });
|
|
20
20
|
}
|
|
21
21
|
randomBetweenInclusive(min, max) {
|
|
22
22
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
package/dist/reaper.js
CHANGED
|
@@ -109,7 +109,7 @@ class ReaperInstance {
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
return new Promise((resolve) => {
|
|
112
|
-
socket.connect(port_1.getContainerPort(port), host, () => {
|
|
112
|
+
socket.connect((0, port_1.getContainerPort)(port), host, () => {
|
|
113
113
|
logger_1.log.debug(`Connected to Reaper ${containerId}`);
|
|
114
114
|
socket.write(`label=${labels_1.LABEL_SESSION_ID}=${session_id_1.sessionId}\r\n`);
|
|
115
115
|
const reaper = new RealReaper(startedContainer, socket);
|
|
@@ -38,7 +38,7 @@ class CredentialProvider {
|
|
|
38
38
|
}
|
|
39
39
|
listCredentials(providerName) {
|
|
40
40
|
return new Promise((resolve, reject) => {
|
|
41
|
-
child_process_1.exec(`${providerName} list`, (err, stdout) => {
|
|
41
|
+
(0, child_process_1.exec)(`${providerName} list`, (err, stdout) => {
|
|
42
42
|
if (err) {
|
|
43
43
|
logger_1.log.error("An error occurred listing credentials");
|
|
44
44
|
return reject(err);
|
|
@@ -55,7 +55,7 @@ class CredentialProvider {
|
|
|
55
55
|
}
|
|
56
56
|
runCredentialProvider(registry, providerName) {
|
|
57
57
|
return new Promise((resolve) => {
|
|
58
|
-
const sink = child_process_1.spawn(providerName, ["get"]);
|
|
58
|
+
const sink = (0, child_process_1.spawn)(providerName, ["get"]);
|
|
59
59
|
const chunks = [];
|
|
60
60
|
sink.stdout.on("data", (chunk) => chunks.push(chunk));
|
|
61
61
|
sink.on("close", (code) => {
|
|
@@ -24,7 +24,7 @@ const DEFAULT_REGISTRY = "https://index.docker.io/v1/";
|
|
|
24
24
|
const dockerConfigLocation = process.env.DOCKER_CONFIG || `${os_1.default.homedir()}/.docker`;
|
|
25
25
|
const dockerConfigFile = path_1.default.resolve(dockerConfigLocation, "config.json");
|
|
26
26
|
const readDockerConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
if (!fs_1.existsSync(dockerConfigFile)) {
|
|
27
|
+
if (!(0, fs_1.existsSync)(dockerConfigFile)) {
|
|
28
28
|
return Promise.resolve({});
|
|
29
29
|
}
|
|
30
30
|
const buffer = yield fs_1.promises.readFile(dockerConfigFile);
|
|
@@ -8,11 +8,11 @@ const logger_1 = require("./logger");
|
|
|
8
8
|
const os_1 = require("os");
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
const properties_reader_1 = __importDefault(require("properties-reader"));
|
|
11
|
-
const file = path_1.default.resolve(os_1.homedir(), ".testcontainers.properties");
|
|
12
|
-
if (fs_1.existsSync(file)) {
|
|
11
|
+
const file = path_1.default.resolve((0, os_1.homedir)(), ".testcontainers.properties");
|
|
12
|
+
if ((0, fs_1.existsSync)(file)) {
|
|
13
13
|
logger_1.log.debug("Found .testcontainers.properties file");
|
|
14
|
-
const string = fs_1.readFileSync(file, { encoding: "utf-8" });
|
|
15
|
-
const properties = properties_reader_1.default("").read(string);
|
|
14
|
+
const string = (0, fs_1.readFileSync)(file, { encoding: "utf-8" });
|
|
15
|
+
const properties = (0, properties_reader_1.default)("").read(string);
|
|
16
16
|
const host = properties.get("docker.host");
|
|
17
17
|
if (host !== null) {
|
|
18
18
|
logger_1.log.debug(`Setting DOCKER_HOST to ${host}`);
|
package/dist/wait-strategy.js
CHANGED
|
@@ -75,7 +75,7 @@ class LogWaitStrategy extends AbstractWaitStrategy {
|
|
|
75
75
|
waitUntilReady(container) {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
logger_1.log.debug(`Waiting for log message "${this.message}"`);
|
|
78
|
-
const stream = yield container_logs_1.containerLogs(container);
|
|
78
|
+
const stream = yield (0, container_logs_1.containerLogs)(container);
|
|
79
79
|
return new Promise((resolve, reject) => {
|
|
80
80
|
const startupTimeout = this.startupTimeout;
|
|
81
81
|
const timeout = setTimeout(() => {
|
|
@@ -98,7 +98,7 @@ class LogWaitStrategy extends AbstractWaitStrategy {
|
|
|
98
98
|
resolve();
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
byline_1.default(stream)
|
|
101
|
+
(0, byline_1.default)(stream)
|
|
102
102
|
.on("data", lineProcessor)
|
|
103
103
|
.on("err", lineProcessor)
|
|
104
104
|
.on("end", () => {
|
|
@@ -116,7 +116,7 @@ class HealthCheckWaitStrategy extends AbstractWaitStrategy {
|
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
logger_1.log.debug(`Waiting for health check`);
|
|
118
118
|
const retryStrategy = new retry_strategy_1.IntervalRetryStrategy(100);
|
|
119
|
-
const status = yield retryStrategy.retryUntil(() => __awaiter(this, void 0, void 0, function* () { return (yield inspect_container_1.inspectContainer(container)).healthCheckStatus; }), (healthCheckStatus) => healthCheckStatus === "healthy" || healthCheckStatus === "unhealthy", () => {
|
|
119
|
+
const status = yield retryStrategy.retryUntil(() => __awaiter(this, void 0, void 0, function* () { return (yield (0, inspect_container_1.inspectContainer)(container)).healthCheckStatus; }), (healthCheckStatus) => healthCheckStatus === "healthy" || healthCheckStatus === "unhealthy", () => {
|
|
120
120
|
const timeout = this.startupTimeout;
|
|
121
121
|
throw new Error(`Health check not healthy after ${timeout}ms for ${container.id}`);
|
|
122
122
|
}, this.startupTimeout);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testcontainers",
|
|
3
3
|
"author": "Cristian Greco",
|
|
4
|
-
"version": "8.7.
|
|
4
|
+
"version": "8.7.1",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"types": "dist/index",
|
|
7
7
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@balena/dockerignore": "^1.0.2",
|
|
36
|
-
"@types/archiver": "^5.
|
|
37
|
-
"@types/dockerode": "^3.
|
|
36
|
+
"@types/archiver": "^5.3.1",
|
|
37
|
+
"@types/dockerode": "^3.3.8",
|
|
38
38
|
"archiver": "^5.3.0",
|
|
39
39
|
"byline": "^5.0.0",
|
|
40
40
|
"debug": "^4.3.4",
|
|
@@ -46,34 +46,34 @@
|
|
|
46
46
|
"tar-fs": "^2.1.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@elastic/elasticsearch": "^7.
|
|
49
|
+
"@elastic/elasticsearch": "^7.17.0",
|
|
50
50
|
"@types/byline": "^4.2.33",
|
|
51
51
|
"@types/debug": "4.1.7",
|
|
52
|
-
"@types/jest": "^27.
|
|
53
|
-
"@types/node": "^
|
|
54
|
-
"@types/node-fetch": "^2.
|
|
52
|
+
"@types/jest": "^27.4.1",
|
|
53
|
+
"@types/node": "^17.0.23",
|
|
54
|
+
"@types/node-fetch": "^2.6.1",
|
|
55
55
|
"@types/pg": "^8.6.5",
|
|
56
56
|
"@types/properties-reader": "^2.1.1",
|
|
57
57
|
"@types/tar-fs": "^2.0.1",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
59
|
-
"@typescript-eslint/parser": "^
|
|
60
|
-
"arangojs": "^7.
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
|
59
|
+
"@typescript-eslint/parser": "^5.19.0",
|
|
60
|
+
"arangojs": "^7.7.0",
|
|
61
61
|
"cross-env": "^7.0.3",
|
|
62
|
-
"eslint": "^
|
|
63
|
-
"eslint-config-prettier": "^8.
|
|
62
|
+
"eslint": "^8.13.0",
|
|
63
|
+
"eslint-config-prettier": "^8.5.0",
|
|
64
64
|
"husky": "^7.0.4",
|
|
65
|
-
"jest": "^27.
|
|
66
|
-
"kafkajs": "^1.
|
|
67
|
-
"lint-staged": "^
|
|
65
|
+
"jest": "^27.5.1",
|
|
66
|
+
"kafkajs": "^1.16.0",
|
|
67
|
+
"lint-staged": "^12.3.7",
|
|
68
68
|
"mysql2": "^2.3.3",
|
|
69
|
-
"neo4j-driver": "^4.
|
|
69
|
+
"neo4j-driver": "^4.4.5",
|
|
70
70
|
"node-fetch": "^2.6.7",
|
|
71
71
|
"pg": "^8.7.3",
|
|
72
|
-
"prettier": "^2.
|
|
72
|
+
"prettier": "^2.6.2",
|
|
73
73
|
"rimraf": "^3.0.2",
|
|
74
|
-
"ts-jest": "^27.
|
|
75
|
-
"ts-node": "^10.
|
|
76
|
-
"typescript": "^4.3
|
|
74
|
+
"ts-jest": "^27.1.4",
|
|
75
|
+
"ts-node": "^10.7.0",
|
|
76
|
+
"typescript": "^4.6.3",
|
|
77
77
|
"wait-for-expect": "^3.0.2"
|
|
78
78
|
},
|
|
79
79
|
"lint-staged": {
|