Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 147734870b | |||
| 36b1ae3992 |
@@ -385,11 +385,13 @@ test('createMemoryV2Runtime selects pgvector only when pool and embedding are co
|
||||
assert.equal(memory.getStatus().selectedBackend, 'pgvector');
|
||||
assert.equal(result.source, 'pgvector');
|
||||
assert.deepEqual(result.semanticMemories, ['semantic memory']);
|
||||
assert.equal(queries.length, 1);
|
||||
assert.equal(queries[0].options.connectionString, 'postgresql://local/memory');
|
||||
assert.equal(queries[0].options.max, 2);
|
||||
assert.match(queries[0].sql, /recent_candidates/);
|
||||
assert.deepEqual(queries[0].params, ['u1', '[0.1,0.2,0.3]', 50]);
|
||||
assert.equal(queries.length, 2);
|
||||
const semanticQuery = queries.find((entry) => /recent_candidates/.test(entry.sql));
|
||||
assert.ok(semanticQuery);
|
||||
assert.equal(semanticQuery.options.connectionString, 'postgresql://local/memory');
|
||||
assert.equal(semanticQuery.options.max, 2);
|
||||
assert.match(semanticQuery.sql, /recent_candidates/);
|
||||
assert.deepEqual(semanticQuery.params, ['u1', '[0.1,0.2,0.3]', 50]);
|
||||
|
||||
await memory.close();
|
||||
assert.equal(poolEnded, true);
|
||||
|
||||
@@ -54,6 +54,7 @@ const CRITICAL_IMPACT_RULES = Object.freeze([
|
||||
|
||||
const NON_RUNTIME_PATHS = Object.freeze([
|
||||
/^(?:AGENTS|README|CHANGELOG)\.md$/i,
|
||||
/^ops\/README\.md$/i,
|
||||
/^\.runtime\//i,
|
||||
/^docs\//i,
|
||||
/^\.cursor\//i,
|
||||
@@ -70,6 +71,7 @@ const IMPACT_RULES = Object.freeze([
|
||||
{ groups: ['DATA'], pattern: /(?:page-data|dataset|page-policy)/i },
|
||||
{ groups: ['WX'], pattern: /(?:wechat|weixin|wx-)/i },
|
||||
{ groups: ['BILL'], pattern: /(?:billing|payment|charge|balance|subscription)/i },
|
||||
{ groups: ['BILL'], pattern: /(?:^admin-(?:bootstrap|routes)\.mjs$)/i },
|
||||
{ groups: ['PLAZA'], pattern: /(?:^|\/)plaza/i },
|
||||
{ groups: ['SCHED'], pattern: /(?:schedule|scheduler|reminder|cron)/i },
|
||||
{ groups: ['SEARCH'], pattern: /(?:search|weather|market|news-provider)/i },
|
||||
|
||||
@@ -11,6 +11,7 @@ const runId = `browser-${new Date().toISOString().replace(/[-:.TZ]/g, '').slice(
|
||||
const stack = await createLocalGateStack({ root, runId, port: 19082 });
|
||||
const checks = [];
|
||||
const consoleErrors = [];
|
||||
const forbiddenResponses = [];
|
||||
let browser;
|
||||
|
||||
function record(id, passed, detail) {
|
||||
@@ -50,6 +51,9 @@ try {
|
||||
if (message.type() === 'error') consoleErrors.push(message.text());
|
||||
});
|
||||
page.on('pageerror', (error) => consoleErrors.push(error.message));
|
||||
page.on('response', (response) => {
|
||||
if (response.status() === 403) forbiddenResponses.push(response.url());
|
||||
});
|
||||
|
||||
await page.goto(stack.baseUrl, { waitUntil: 'networkidle' });
|
||||
await page.getByPlaceholder('用户名').fill(username);
|
||||
@@ -118,7 +122,6 @@ try {
|
||||
`<!doctype html><html lang="zh-CN"><head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="description" content="Release gate browser flow">
|
||||
<meta name="mindspace-cover" content='{"tag":"测试","subtitle":"浏览器流程"}'>
|
||||
<title>浏览器流程页面</title>
|
||||
<style>body{margin:0;font:16px system-ui}.wrap{max-width:720px;margin:auto;padding:20px}
|
||||
label,input,button,a{display:block;margin:10px 0;max-width:100%}</style></head><body>
|
||||
@@ -188,6 +191,9 @@ const result=await response.json();document.querySelector('#result').textContent
|
||||
);
|
||||
|
||||
await page.goto(publicUrl, { waitUntil: 'domcontentloaded' });
|
||||
consoleErrors.splice(0);
|
||||
forbiddenResponses.splice(0);
|
||||
await page.waitForTimeout(250);
|
||||
const accessibility = await page.evaluate(() => {
|
||||
const interactive = [...document.querySelectorAll('button,input,a')];
|
||||
const named = interactive.every((element) => {
|
||||
@@ -212,7 +218,7 @@ const result=await response.json();document.querySelector('#result').textContent
|
||||
failed = checks.some((check) => !check.passed);
|
||||
await fs.writeFile(
|
||||
path.join(stack.runRoot, 'browser.json'),
|
||||
`${JSON.stringify({ run_id: runId, checks, console_errors: consoleErrors }, null, 2)}\n`,
|
||||
`${JSON.stringify({ run_id: runId, checks, console_errors: consoleErrors, forbidden_responses: forbiddenResponses }, null, 2)}\n`,
|
||||
);
|
||||
} finally {
|
||||
await browser?.close();
|
||||
|
||||
Reference in New Issue
Block a user