viberadar 0.3.212 → 0.3.214
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/server/index.d.ts.map +1 -1
- package/dist/server/index.js +29 -12
- package/dist/server/index.js.map +1 -1
- package/dist/ui/dashboard.html +98 -34
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAO7B,OAAO,EAAE,UAAU,EAA4H,MAAM,YAAY,CAAC;AAOlK,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AA0vED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAO7B,OAAO,EAAE,UAAU,EAA4H,MAAM,YAAY,CAAC;AAOlK,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB;AA0vED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAk2G1G"}
|
package/dist/server/index.js
CHANGED
|
@@ -2226,7 +2226,7 @@ function startServer({ data: initialData, port, projectRoot }) {
|
|
|
2226
2226
|
function redactLoadEnvVars(envVars) {
|
|
2227
2227
|
const out = {};
|
|
2228
2228
|
for (const key of Object.keys(envVars)) {
|
|
2229
|
-
out[key] = /token|secret|password|key/i.test(key) ? '***' : envVars[key];
|
|
2229
|
+
out[key] = /token|secret|password|key|account|credential|login/i.test(key) ? '***' : envVars[key];
|
|
2230
2230
|
}
|
|
2231
2231
|
return out;
|
|
2232
2232
|
}
|
|
@@ -2276,8 +2276,8 @@ function startServer({ data: initialData, port, projectRoot }) {
|
|
|
2276
2276
|
const dataDir = resolveLoadLocalPath(cfg.dataDir);
|
|
2277
2277
|
const resultDir = resolveLoadLocalPath(cfg.resultDir);
|
|
2278
2278
|
const executionMode = cfg.executionMode === 'script' ? 'script' : 'cli';
|
|
2279
|
-
const vusEnvName = sanitizeLoadEnvName(cfg.vusEnvName, '
|
|
2280
|
-
const durationEnvName = sanitizeLoadEnvName(cfg.durationEnvName, '
|
|
2279
|
+
const vusEnvName = sanitizeLoadEnvName(cfg.vusEnvName, 'LOAD_VUS');
|
|
2280
|
+
const durationEnvName = sanitizeLoadEnvName(cfg.durationEnvName, 'LOAD_DURATION');
|
|
2281
2281
|
const hasVus = cfg.vus !== undefined && cfg.vus !== null && String(cfg.vus).trim() !== '';
|
|
2282
2282
|
const hasDuration = cfg.duration !== undefined && cfg.duration !== null && String(cfg.duration).trim() !== '';
|
|
2283
2283
|
envVars.BASE_URL = baseUrl;
|
|
@@ -2298,10 +2298,25 @@ function startServer({ data: initialData, port, projectRoot }) {
|
|
|
2298
2298
|
envVars: redactLoadEnvVars(envVars),
|
|
2299
2299
|
};
|
|
2300
2300
|
if (executionMode === 'script') {
|
|
2301
|
-
if (hasVus && config.vus != null)
|
|
2302
|
-
|
|
2303
|
-
|
|
2301
|
+
if (hasVus && config.vus != null) {
|
|
2302
|
+
const vusValue = String(config.vus);
|
|
2303
|
+
envVars[vusEnvName] = vusValue;
|
|
2304
|
+
if (!envVars.LOAD_VUS)
|
|
2305
|
+
envVars.LOAD_VUS = vusValue;
|
|
2306
|
+
if (!envVars.SMOKE_VUS)
|
|
2307
|
+
envVars.SMOKE_VUS = vusValue;
|
|
2308
|
+
if (!envVars.AUTH_VUS)
|
|
2309
|
+
envVars.AUTH_VUS = vusValue;
|
|
2310
|
+
}
|
|
2311
|
+
if (hasDuration && config.duration) {
|
|
2304
2312
|
envVars[durationEnvName] = config.duration;
|
|
2313
|
+
if (!envVars.LOAD_DURATION)
|
|
2314
|
+
envVars.LOAD_DURATION = config.duration;
|
|
2315
|
+
if (!envVars.SMOKE_DURATION)
|
|
2316
|
+
envVars.SMOKE_DURATION = config.duration;
|
|
2317
|
+
if (!envVars.AUTH_DURATION)
|
|
2318
|
+
envVars.AUTH_DURATION = config.duration;
|
|
2319
|
+
}
|
|
2305
2320
|
config.envVars = redactLoadEnvVars(envVars);
|
|
2306
2321
|
}
|
|
2307
2322
|
return { config, envVars, dataDir, resultDir };
|
|
@@ -5136,8 +5151,10 @@ a{color:var(--blue)}
|
|
|
5136
5151
|
fileName,
|
|
5137
5152
|
baseUrl: typeof baseUrl === 'string' && baseUrl.trim() ? baseUrl.trim() : 'http://localhost:5000',
|
|
5138
5153
|
executionMode: executionMode === 'script' ? 'script' : 'cli',
|
|
5139
|
-
|
|
5140
|
-
|
|
5154
|
+
vus: vus !== undefined && vus !== null && String(vus).trim() !== '' ? normalizeLoadVus(vus) : undefined,
|
|
5155
|
+
duration: duration !== undefined && duration !== null && String(duration).trim() !== '' ? normalizeLoadDuration(duration) : undefined,
|
|
5156
|
+
vusEnvName: sanitizeLoadEnvName(vusEnvName, 'LOAD_VUS'),
|
|
5157
|
+
durationEnvName: sanitizeLoadEnvName(durationEnvName, 'LOAD_DURATION'),
|
|
5141
5158
|
dataDir: resolveLoadLocalPath(dataDir),
|
|
5142
5159
|
resultDir: resolveLoadLocalPath(resultDir),
|
|
5143
5160
|
};
|
|
@@ -5336,18 +5353,18 @@ a{color:var(--blue)}
|
|
|
5336
5353
|
broadcast('load-started', { runId, config: loadConfig });
|
|
5337
5354
|
res.writeHead(200, jsonH);
|
|
5338
5355
|
res.end(JSON.stringify({ ok: true, runId }));
|
|
5339
|
-
const
|
|
5356
|
+
const childEnv = { ...process.env };
|
|
5340
5357
|
for (const [k, v] of Object.entries(envVars)) {
|
|
5341
5358
|
if (k && v !== undefined && v !== '')
|
|
5342
|
-
|
|
5359
|
+
childEnv[k] = v;
|
|
5343
5360
|
}
|
|
5344
5361
|
const args = ['run'];
|
|
5345
5362
|
if (loadConfig.executionMode !== 'script') {
|
|
5346
5363
|
args.push('--vus', String(loadConfig.vus || 10), '--duration', loadConfig.duration || '30s');
|
|
5347
5364
|
}
|
|
5348
|
-
args.push(
|
|
5365
|
+
args.push('--summary-export', summaryPath, '--out', `json=${jsonOutPath}`, scriptPath);
|
|
5349
5366
|
loadProc = (0, child_process_1.spawn)('k6', args, {
|
|
5350
|
-
cwd: workDir, env:
|
|
5367
|
+
cwd: workDir, env: childEnv, shell: WIN, stdio: 'pipe',
|
|
5351
5368
|
});
|
|
5352
5369
|
const addLog = (line) => {
|
|
5353
5370
|
loadState.logs.push(line);
|