WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const assert = require('node:assert/strict')
|
||||
const { chromium } = require('/Users/macclaw/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/node_modules/playwright')
|
||||
const directory = path.resolve(__dirname, '../../acceptance')
|
||||
const origin = 'https://agent.pducv.cn'
|
||||
const checks = [], failures = [], snapshots = []
|
||||
let auth, browser
|
||||
function check(name, value) { checks.push({name, passed: !!value}); assert.ok(value, name) }
|
||||
async function api(route, method = 'GET', body) {
|
||||
const response = await fetch(origin + '/api/v1' + route, {
|
||||
method, headers: {'Content-Type': 'application/json', ...(auth ? {Authorization: `Bearer ${auth.token}`, 'X-Tenant-ID': '10059'} : {})},
|
||||
body: body === undefined ? undefined : JSON.stringify(body), signal: AbortSignal.timeout(45000),
|
||||
})
|
||||
assert.equal(response.status, 200, route)
|
||||
return response.json()
|
||||
}
|
||||
async function main() {
|
||||
const credentials = JSON.parse(fs.readFileSync(path.join(directory, 'super-admin-login.json'), 'utf8'))
|
||||
auth = await api('/auth/login', 'POST', {username: credentials.username, password: credentials.password})
|
||||
check('admin_login_opens_business_workspace', Number(auth.active_tenant.id) === 10059)
|
||||
const baseline = JSON.parse(fs.readFileSync(path.join(directory, 'business-wiki-backfill.json'), 'utf8'))
|
||||
for (const kb of baseline.before) {
|
||||
const current = (await api(`/knowledge-bases/${kb.id}`)).data
|
||||
check(`${kb.name}:rag_and_wiki_enabled`, current.indexing_strategy.wiki_enabled && current.indexing_strategy.vector_enabled && current.indexing_strategy.keyword_enabled)
|
||||
const stats = await api(`/knowledgebase/${kb.id}/wiki/stats`)
|
||||
const pages = await api(`/knowledgebase/${kb.id}/wiki/pages?page=1&page_size=5`)
|
||||
check(`${kb.name}:wiki_readable`, typeof stats.total_pages === 'number' && Array.isArray(pages.pages))
|
||||
snapshots.push({id: kb.id, name: kb.name, pages: stats.total_pages, pending_tasks: stats.pending_tasks, active: stats.is_active})
|
||||
}
|
||||
check('wiki_pages_actually_generated', snapshots.some(s => s.pages > 0))
|
||||
const product = baseline.before.find(k => k.name === '\u4ea7\u54c1\u4fe1\u606f')
|
||||
const start = Date.now()
|
||||
const hits = (await api(`/knowledge-bases/${product.id}/hybrid-search`, 'POST', {
|
||||
query_text: '\u4ea7\u54c1\u4fe1\u606f', match_count: 5, vector_threshold: 0, keyword_threshold: 0,
|
||||
})).data
|
||||
check('existing_rag_still_returns_source_chunks', Array.isArray(hits) && hits.some(hit => hit.knowledge_id))
|
||||
snapshots.push({rag_query_ms: Date.now() - start, rag_hits: hits.length})
|
||||
browser = await chromium.launch({headless: true, channel: 'chrome'})
|
||||
const page = await browser.newPage({viewport: {width: 1440, height: 1000}})
|
||||
await page.addInitScript(a => {
|
||||
const values = {weknora_user: JSON.stringify(a.user), weknora_tenant: JSON.stringify(a.active_tenant), weknora_token: a.token, weknora_refresh_token: a.refresh_token, weknora_memberships: JSON.stringify(a.memberships)}
|
||||
Object.entries(values).forEach(([k,v]) => localStorage.setItem(k,v))
|
||||
localStorage.setItem('weknora:new-user-guide-done:v1', '1')
|
||||
}, auth)
|
||||
const errors = []
|
||||
page.on('pageerror', e => errors.push(e.message))
|
||||
page.on('response', response => {if(response.status() >= 400 && /\/(api|assets)\//.test(new URL(response.url()).pathname)) errors.push(`${response.status()} ${new URL(response.url()).pathname}`)})
|
||||
await page.goto(`${origin}/platform/knowledge-bases/${product.id}?tab=wiki`)
|
||||
await page.locator('.wiki-browser').waitFor({timeout: 30000})
|
||||
await page.locator('.wiki-tab').first().waitFor({timeout: 30000})
|
||||
await page.locator('.wiki-directory-item, .wiki-page-item').first().waitFor({timeout: 30000})
|
||||
check('generated_wiki_entries_visible', await page.locator('.wiki-tab-count').first().innerText() !== '0')
|
||||
await page.screenshot({path: path.join(directory, 'business-wiki-desktop.png'), animations: 'disabled'})
|
||||
check('public_wiki_browser_visible', await page.locator('.wiki-browser').isVisible())
|
||||
await page.setViewportSize({width: 390, height: 844})
|
||||
await page.screenshot({path: path.join(directory, 'business-wiki-mobile.png'), animations: 'disabled'})
|
||||
check('wiki_no_horizontal_overflow', await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 2))
|
||||
check('wiki_no_failed_requests_or_page_errors', errors.length === 0)
|
||||
}
|
||||
main().catch(e => {failures.push(e.message); process.exitCode = 1}).finally(async () => {
|
||||
if (browser) await browser.close()
|
||||
const report = {checked_at: new Date().toISOString(), origin, checks, snapshots, failures, passed: failures.length === 0}
|
||||
fs.writeFileSync(path.join(directory, 'business-wiki-verification.json'), JSON.stringify(report, null, 2))
|
||||
console.log(JSON.stringify(report))
|
||||
})
|
||||
Reference in New Issue
Block a user