@plune-ai/playwright 0.2.2 → 0.2.3
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/README.md +1 -1
- package/dist/index.cjs +18 -7
- package/dist/index.js +18 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ fills in what you left out. Anything set in the config file wins.
|
|
|
52
52
|
| `PLUNE_PROCEED` | the job closes the run itself, later |
|
|
53
53
|
| `PLUNE_BATCH_SIZE` | results per request (default 100, max 500) |
|
|
54
54
|
| `PLUNE_FALLBACK` | where unsent batches are written |
|
|
55
|
-
| `PLUNE_RUN_TITLE` | what to call the run in the list |
|
|
55
|
+
| `PLUNE_RUN_TITLE` | what to call the run in the list (default: `<directory> · 2026-09-15 15:26 · ci`) |
|
|
56
56
|
| `PLUNE_ENV` | where it ran — `staging`, `prod`, a preview name |
|
|
57
57
|
| `PLUNE_LABELS` | comma-separated marks: `smoke,nightly` |
|
|
58
58
|
| `PLUNE_CREATE` | offer tests Plune has no case for to the review queue |
|
package/dist/index.cjs
CHANGED
|
@@ -40,8 +40,9 @@ var import_crypto = require("crypto");
|
|
|
40
40
|
var import_fs = require("fs");
|
|
41
41
|
var import_os = require("os");
|
|
42
42
|
var import_path = require("path");
|
|
43
|
-
var fs = __toESM(require("fs"), 1);
|
|
44
43
|
var path = __toESM(require("path"), 1);
|
|
44
|
+
var fs = __toESM(require("fs"), 1);
|
|
45
|
+
var path2 = __toESM(require("path"), 1);
|
|
45
46
|
var import_crypto2 = require("crypto");
|
|
46
47
|
var DEFAULT_API_URL = "https://beta-api.plune.ai";
|
|
47
48
|
function resolveApiUrl(explicit) {
|
|
@@ -88,7 +89,7 @@ function createClient(opts) {
|
|
|
88
89
|
const wait = opts.wait ?? sleep;
|
|
89
90
|
const base = opts.apiUrl.replace(/\/+$/, "");
|
|
90
91
|
const scrub = (text) => opts.token === "" ? text : text.split(opts.token).join("***");
|
|
91
|
-
async function send(method,
|
|
92
|
+
async function send(method, path3, body) {
|
|
92
93
|
let last = {
|
|
93
94
|
kind: "unavailable",
|
|
94
95
|
status: null,
|
|
@@ -97,7 +98,7 @@ function createClient(opts) {
|
|
|
97
98
|
for (let attempt = 0; attempt <= RETRY_DELAYS_MS.length; attempt += 1) {
|
|
98
99
|
let res;
|
|
99
100
|
try {
|
|
100
|
-
res = await doFetch(`${base}${
|
|
101
|
+
res = await doFetch(`${base}${path3}`, {
|
|
101
102
|
method,
|
|
102
103
|
headers: { "content-type": "application/json", authorization: `Bearer ${opts.token}` },
|
|
103
104
|
// A DELETE carries none. Sending `"undefined"` as a body is what a naive
|
|
@@ -125,8 +126,8 @@ function createClient(opts) {
|
|
|
125
126
|
return { ok: false, ...last };
|
|
126
127
|
}
|
|
127
128
|
return {
|
|
128
|
-
post: (
|
|
129
|
-
del: (
|
|
129
|
+
post: (path3, body) => send("POST", path3, body),
|
|
130
|
+
del: (path3) => send("DELETE", path3)
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
133
|
var UNSUPPORTED_VARS = ["PLUNE_GROUP"];
|
|
@@ -181,9 +182,15 @@ function readEnv(env = process.env) {
|
|
|
181
182
|
ignored: UNSUPPORTED_VARS.filter((name) => value(env, name) !== void 0)
|
|
182
183
|
};
|
|
183
184
|
}
|
|
184
|
-
|
|
185
|
+
function defaultRunTitle(env = process.env, now = /* @__PURE__ */ new Date(), cwd = process.cwd()) {
|
|
186
|
+
const two = (n) => String(n).padStart(2, "0");
|
|
187
|
+
const stamp = `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())} ${two(now.getHours())}:${two(now.getMinutes())}`;
|
|
188
|
+
const where = flag(env, "CI") || flag(env, "GITHUB_ACTIONS") ? "ci" : "local";
|
|
189
|
+
return `${path.basename(cwd)} \xB7 ${stamp} \xB7 ${where}`;
|
|
190
|
+
}
|
|
191
|
+
var DEFAULT_FALLBACK_PATH = path2.join(".plune", "pending-results.jsonl");
|
|
185
192
|
function appendBatch(file, batch) {
|
|
186
|
-
fs.mkdirSync(
|
|
193
|
+
fs.mkdirSync(path2.dirname(file), { recursive: true });
|
|
187
194
|
const line = {
|
|
188
195
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
189
196
|
runId: batch.runId,
|
|
@@ -322,6 +329,10 @@ async function startRun(passed, declared) {
|
|
|
322
329
|
...externalKey !== null ? { externalKey } : {},
|
|
323
330
|
...cfg.meta !== void 0 ? { meta: cfg.meta } : {},
|
|
324
331
|
...configuration !== void 0 ? { configuration } : {},
|
|
332
|
+
// Named even when nobody named it — the list has to read without opening a row. Only what
|
|
333
|
+
// the caller DESCRIBED goes to `warnIfDropped` below: a title this side invented is not one
|
|
334
|
+
// a person will miss, and a deployment older than the field must not be nagged on every run.
|
|
335
|
+
title: defaultRunTitle(),
|
|
325
336
|
...described
|
|
326
337
|
});
|
|
327
338
|
if (start.ok) {
|
package/dist/index.js
CHANGED
|
@@ -6,8 +6,9 @@ import { createHash } from "crypto";
|
|
|
6
6
|
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
7
7
|
import { homedir } from "os";
|
|
8
8
|
import { dirname, join } from "path";
|
|
9
|
-
import * as fs from "fs";
|
|
10
9
|
import * as path from "path";
|
|
10
|
+
import * as fs from "fs";
|
|
11
|
+
import * as path2 from "path";
|
|
11
12
|
import { createHash as createHash2 } from "crypto";
|
|
12
13
|
var DEFAULT_API_URL = "https://beta-api.plune.ai";
|
|
13
14
|
function resolveApiUrl(explicit) {
|
|
@@ -54,7 +55,7 @@ function createClient(opts) {
|
|
|
54
55
|
const wait = opts.wait ?? sleep;
|
|
55
56
|
const base = opts.apiUrl.replace(/\/+$/, "");
|
|
56
57
|
const scrub = (text) => opts.token === "" ? text : text.split(opts.token).join("***");
|
|
57
|
-
async function send(method,
|
|
58
|
+
async function send(method, path3, body) {
|
|
58
59
|
let last = {
|
|
59
60
|
kind: "unavailable",
|
|
60
61
|
status: null,
|
|
@@ -63,7 +64,7 @@ function createClient(opts) {
|
|
|
63
64
|
for (let attempt = 0; attempt <= RETRY_DELAYS_MS.length; attempt += 1) {
|
|
64
65
|
let res;
|
|
65
66
|
try {
|
|
66
|
-
res = await doFetch(`${base}${
|
|
67
|
+
res = await doFetch(`${base}${path3}`, {
|
|
67
68
|
method,
|
|
68
69
|
headers: { "content-type": "application/json", authorization: `Bearer ${opts.token}` },
|
|
69
70
|
// A DELETE carries none. Sending `"undefined"` as a body is what a naive
|
|
@@ -91,8 +92,8 @@ function createClient(opts) {
|
|
|
91
92
|
return { ok: false, ...last };
|
|
92
93
|
}
|
|
93
94
|
return {
|
|
94
|
-
post: (
|
|
95
|
-
del: (
|
|
95
|
+
post: (path3, body) => send("POST", path3, body),
|
|
96
|
+
del: (path3) => send("DELETE", path3)
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
99
|
var UNSUPPORTED_VARS = ["PLUNE_GROUP"];
|
|
@@ -147,9 +148,15 @@ function readEnv(env = process.env) {
|
|
|
147
148
|
ignored: UNSUPPORTED_VARS.filter((name) => value(env, name) !== void 0)
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
|
-
|
|
151
|
+
function defaultRunTitle(env = process.env, now = /* @__PURE__ */ new Date(), cwd = process.cwd()) {
|
|
152
|
+
const two = (n) => String(n).padStart(2, "0");
|
|
153
|
+
const stamp = `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())} ${two(now.getHours())}:${two(now.getMinutes())}`;
|
|
154
|
+
const where = flag(env, "CI") || flag(env, "GITHUB_ACTIONS") ? "ci" : "local";
|
|
155
|
+
return `${path.basename(cwd)} \xB7 ${stamp} \xB7 ${where}`;
|
|
156
|
+
}
|
|
157
|
+
var DEFAULT_FALLBACK_PATH = path2.join(".plune", "pending-results.jsonl");
|
|
151
158
|
function appendBatch(file, batch) {
|
|
152
|
-
fs.mkdirSync(
|
|
159
|
+
fs.mkdirSync(path2.dirname(file), { recursive: true });
|
|
153
160
|
const line = {
|
|
154
161
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
155
162
|
runId: batch.runId,
|
|
@@ -288,6 +295,10 @@ async function startRun(passed, declared) {
|
|
|
288
295
|
...externalKey !== null ? { externalKey } : {},
|
|
289
296
|
...cfg.meta !== void 0 ? { meta: cfg.meta } : {},
|
|
290
297
|
...configuration !== void 0 ? { configuration } : {},
|
|
298
|
+
// Named even when nobody named it — the list has to read without opening a row. Only what
|
|
299
|
+
// the caller DESCRIBED goes to `warnIfDropped` below: a title this side invented is not one
|
|
300
|
+
// a person will miss, and a deployment older than the field must not be nagged on every run.
|
|
301
|
+
title: defaultRunTitle(),
|
|
291
302
|
...described
|
|
292
303
|
});
|
|
293
304
|
if (start.ok) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plune-ai/playwright",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Report Playwright results to Plune — a reporter and, later, a test importer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playwright",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"tsup": "^8.0.0",
|
|
39
39
|
"typescript": "^5.4.0",
|
|
40
40
|
"vitest": "^1.6.0",
|
|
41
|
-
"@plune-ai/cli": "0.
|
|
41
|
+
"@plune-ai/cli": "0.11.0"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|