release: bump version to 0.80.1
This commit is contained in:
1 parent
41059ca42a
commit
4b2004b7d8
29 files changed
+1843
-220
No files matched your search
@@ -835,6 +835,19 @@ const datasource = {
|
||||
retry_attempts: 2,
|
||||
}
|
||||
|
||||
const disabledDatasource = {
|
||||
...datasource,
|
||||
id: 2,
|
||||
source_id: 'ris_live_bgp',
|
||||
name: 'ris_live_bgp',
|
||||
display_name: 'RIPE RIS Live BGP',
|
||||
source: 'ris_live_bgp',
|
||||
collected_records: 0,
|
||||
is_active: false,
|
||||
}
|
||||
|
||||
const datasourceCounts = { all: 2, active: 1, inactive: 1 }
|
||||
|
||||
const integrationSettings = {
|
||||
integrations: {
|
||||
ai_provider: {
|
||||
@@ -990,7 +1003,22 @@ function apiPayloadFor(requestUrl, method) {
|
||||
if (path === '/collected/types') return jsonResponse({ data_types: ['bgp_event'] })
|
||||
if (path === '/collected/countries') return jsonResponse({ countries: ['CN'] })
|
||||
|
||||
if (path === '/datasources') return jsonResponse([datasource])
|
||||
const datasourceToggle = method === 'POST' ? path.match(/^\/datasources\/(\d+)\/(enable|disable)$/) : null
|
||||
if (datasourceToggle) {
|
||||
const isActive = datasourceToggle[2] === 'enable'
|
||||
const sourceId = Number(datasourceToggle[1])
|
||||
const base = sourceId === disabledDatasource.id ? disabledDatasource : datasource
|
||||
return jsonResponse({
|
||||
status: isActive ? 'enabled' : 'disabled',
|
||||
source_id: sourceId,
|
||||
data: { ...base, is_active: isActive },
|
||||
counts: datasourceCounts,
|
||||
})
|
||||
}
|
||||
if (method === 'POST' && path === '/datasources/batch-status') {
|
||||
return jsonResponse({ is_active: true, updated: [], unchanged: [], not_found: [], sync_failed: [], counts: datasourceCounts })
|
||||
}
|
||||
if (path === '/datasources') return jsonResponse({ total: 2, data: [datasource, disabledDatasource], counts: datasourceCounts })
|
||||
if (path === '/datasources/configs') return jsonResponse([datasource])
|
||||
if (path === '/datasources/configs/all') return jsonResponse([datasource])
|
||||
if (path === '/datasources/mappings') return jsonResponse({ mappings: [{ id: 1, name: 'Default Mapping', target_schema: 'collected_data', validation_status: 'valid' }] })
|
||||
@@ -1695,6 +1723,56 @@ async function runAIModelCatalogChecks(browser, failures, consoleErrors) {
|
||||
}
|
||||
}
|
||||
|
||||
async function runDatasourceSchedulingChecks(browser, failures, consoleErrors) {
|
||||
for (const viewport of [desktopViewport, mobileViewport]) {
|
||||
const context = await browser.newContext({ viewport })
|
||||
await installApiMocks(context)
|
||||
bindConsoleCollection(context, consoleErrors)
|
||||
const page = await context.newPage()
|
||||
await seedAuthenticatedState(page)
|
||||
let listRequests = 0
|
||||
const toggles = []
|
||||
page.on('request', (request) => {
|
||||
const { pathname } = new URL(request.url())
|
||||
if (request.method() === 'GET' && pathname.endsWith('/api/v1/datasources')) listRequests += 1
|
||||
if (request.method() === 'POST' && /\/datasources\/\d+\/(enable|disable)$/.test(pathname)) toggles.push(pathname)
|
||||
})
|
||||
try {
|
||||
smokeProgress(`datasource scheduling ${viewport.width}px`)
|
||||
await page.goto(urlFor('/datasources'), { waitUntil: 'domcontentloaded' })
|
||||
const enableSwitch = page.getByRole('switch', { name: '启用调度', exact: true })
|
||||
await enableSwitch.first().waitFor({ state: 'visible' })
|
||||
assert.equal(await page.getByRole('button', { name: '触发全部' }).count(), 0, 'idle datasources toolbar must not show redundant trigger-all button')
|
||||
assert.equal(await page.locator('thead th', { hasText: '操作' }).count(), 1, 'datasources table must label its actions column')
|
||||
const listRequestsBeforeToggle = listRequests
|
||||
await enableSwitch.first().click()
|
||||
await page.locator('.an-toast--success').first().waitFor({ state: 'visible' })
|
||||
assert.deepEqual(toggles, ['/api/v1/datasources/2/enable'], 'row switch must call the single enable endpoint')
|
||||
assert.equal(listRequests, listRequestsBeforeToggle, 'toggling scheduling must not reload the datasource list')
|
||||
assert.equal(await page.getByRole('switch', { name: '停用调度', exact: true }).count(), 2, 'toggled row must update in place')
|
||||
await page.locator('tbody .an-data-table__selection-cell input').first().check()
|
||||
await page.locator('.an-batch-bar').waitFor({ state: 'visible' })
|
||||
if (viewport.width >= 1024) {
|
||||
await page.locator('.an-table-link', { hasText: 'open_bgp' }).click()
|
||||
await page.locator('.an-detail-links').waitFor({ state: 'visible' })
|
||||
assert.equal(await page.locator('.an-detail-links .an-detail-link', { hasText: '详情与统计' }).count(), 1)
|
||||
assert.equal(await page.locator('.an-detail-links .an-detail-link', { hasText: '任务状态' }).count(), 1)
|
||||
assert.equal(await page.locator('.an-detail-links .an-detail-link', { hasText: '查看日志' }).count(), 1)
|
||||
assert.equal(await page.locator('.an-detail-content .an-status-pill').count(), 1, 'datasource detail panel must not duplicate the status pill')
|
||||
}
|
||||
if (process.env.PLANET_DATASOURCE_SCREENSHOT_DIR) {
|
||||
await page.screenshot({ path: `${process.env.PLANET_DATASOURCE_SCREENSHOT_DIR}/datasources-${viewport.width}.png`, fullPage: false })
|
||||
}
|
||||
await checkNoFrameworkOverlay(page, 'datasource scheduling')
|
||||
await checkNoGlobalHorizontalOverflow(page, 'datasource scheduling')
|
||||
} catch (error) {
|
||||
failures.push(`datasource scheduling ${viewport.width}px: ${formatSmokeError(error)}`)
|
||||
} finally {
|
||||
await context.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function runDocsInteractionChecks(browser, failures, consoleErrors) {
|
||||
const context = await browser.newContext({ viewport: desktopViewport })
|
||||
await installApiMocks(context)
|
||||
@@ -2611,6 +2689,7 @@ async function main() {
|
||||
}
|
||||
await runAdminInteractionChecks(browser, failures, consoleErrors)
|
||||
await runAIModelCatalogChecks(browser, failures, consoleErrors)
|
||||
await runDatasourceSchedulingChecks(browser, failures, consoleErrors)
|
||||
await runDocsInteractionChecks(browser, failures, consoleErrors)
|
||||
await runAuthInteractionChecks(browser, failures, consoleErrors)
|
||||
await runEarthNewsRefreshChecks(browser, failures)
|
||||
|
||||
Reference in new issue
Block a user