@milaboratories/pl-drivers 1.12.10 → 1.12.12
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-drivers",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.12",
|
|
4
4
|
"description": "Drivers and a low-level clients for log streaming, downloading and uploading files from and to pl",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@milaboratories/pl-client": "3.1.1",
|
|
34
34
|
"@milaboratories/pl-model-common": "1.31.2",
|
|
35
35
|
"@milaboratories/ts-helpers": "1.8.1",
|
|
36
|
-
"@milaboratories/pl-tree": "1.9.
|
|
36
|
+
"@milaboratories/pl-tree": "1.9.10"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/decompress": "^4.2.7",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vitest": "^4.1.3",
|
|
46
46
|
"@milaboratories/build-configs": "2.0.0",
|
|
47
47
|
"@milaboratories/test-helpers": "1.2.1",
|
|
48
|
-
"@milaboratories/ts-builder": "1.3.
|
|
48
|
+
"@milaboratories/ts-builder": "1.3.2",
|
|
49
49
|
"@milaboratories/ts-configs": "1.2.3"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
package/src/drivers/logs.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
1
|
+
import { expect, test, vi } from "vitest";
|
|
2
2
|
import { Computable } from "@milaboratories/computable";
|
|
3
3
|
import type {
|
|
4
4
|
AnyFieldRef,
|
|
@@ -28,6 +28,12 @@ const downloadDriverOps = {
|
|
|
28
28
|
rangesCacheMaxSizeBytes: 1024,
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
const useDocker = process.env.PL_TEST_USE_DOCKER === "true";
|
|
32
|
+
|
|
33
|
+
vi.setConfig({
|
|
34
|
+
testTimeout: 90000,
|
|
35
|
+
});
|
|
36
|
+
|
|
31
37
|
test("should get all logs", async () => {
|
|
32
38
|
await TestHelpers.withTempRoot(async (client) => {
|
|
33
39
|
const logger = new ConsoleLoggerAdapter();
|
|
@@ -50,7 +56,7 @@ test("should get all logs", async () => {
|
|
|
50
56
|
);
|
|
51
57
|
const logs = new LogsDriver(logger, logsStream, download);
|
|
52
58
|
|
|
53
|
-
await createRunCommandWithStdoutStream(client, "
|
|
59
|
+
await createRunCommandWithStdoutStream(client, "sh", ["-c", "echo 1; sleep 1; echo 2"]);
|
|
54
60
|
|
|
55
61
|
const c = Computable.make((ctx) => {
|
|
56
62
|
const streamManager = ctx.accessor(tree.entry()).node().traverse("result")?.persist();
|
|
@@ -109,7 +115,7 @@ test("should get last line with a prefix", async () => {
|
|
|
109
115
|
|
|
110
116
|
expect(await c.getValue()).toBeUndefined();
|
|
111
117
|
|
|
112
|
-
await createRunCommandWithStdoutStream(client, "
|
|
118
|
+
await createRunCommandWithStdoutStream(client, "sh", [
|
|
113
119
|
"-c",
|
|
114
120
|
"echo PREFIX1; echo PREFIX2; echo 3; sleep 0.1; echo PREFIX4",
|
|
115
121
|
]);
|
|
@@ -162,7 +168,7 @@ test("should get log smart object and get log lines from that", async () => {
|
|
|
162
168
|
return logs.getLogHandle(streamManager, ctx);
|
|
163
169
|
});
|
|
164
170
|
|
|
165
|
-
await createRunCommandWithStdoutStream(client, "
|
|
171
|
+
await createRunCommandWithStdoutStream(client, "sh", ["-c", "echo 1; sleep 1; echo 2"]);
|
|
166
172
|
|
|
167
173
|
let handle = await c.getValue();
|
|
168
174
|
|
|
@@ -261,12 +267,15 @@ function createRunCommand(
|
|
|
261
267
|
value: arg,
|
|
262
268
|
};
|
|
263
269
|
});
|
|
264
|
-
const optsData = {
|
|
270
|
+
const optsData: Record<string, unknown> = {
|
|
265
271
|
errorLines: 200,
|
|
266
272
|
redirectStdout: "logs.txt",
|
|
267
273
|
redirectStderr: "logs.txt",
|
|
268
274
|
envs: [],
|
|
269
275
|
};
|
|
276
|
+
if (useDocker) {
|
|
277
|
+
optsData.dockerImageTag = "busybox";
|
|
278
|
+
}
|
|
270
279
|
|
|
271
280
|
const runCmdId = tx.createEphemeral({ name: "RunCommand/executor", version: "2" });
|
|
272
281
|
|