mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-12 22:33:54 -04:00
* fix(vram): persist remote probe metadata The startup warmer repeated remote size and GGUF metadata probes after every restart because both caches lived only in memory. Store successful HTTP probes for 24 hours so frequent restarts reuse the prior results. Bound the cache, reject invalid records, and purge it when gallery data changes. Local model files continue to bypass persistence. Assisted-by: Codex:gpt-5 * fix(vram): check temporary file cleanup The lint gate rejects the unchecked cleanup call in the persistent cache writer. Assisted-by: Codex:gpt-5.6 [golangci-lint] * fix(vram): make persistent cache optional Remote metadata probes can transfer enough data that operators need control over disk reuse and startup warming. Gallery autoload now gates both behaviors, and the runtime setting applies changes immediately. Assisted-by: Codex:gpt-5 * fix(ui): expose gallery startup pre-warm The existing gallery autoload setting also gates the startup metadata warmer. Name both effects in Settings so operators can find the requested boot control. Assisted-by: Codex:gpt-5 --------- Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com>
77 lines
2.8 KiB
JavaScript
77 lines
2.8 KiB
JavaScript
import { test, expect } from './coverage-fixtures.js'
|
|
|
|
test.describe('Settings - Backend Logging', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('/app/settings')
|
|
// Wait for settings to load
|
|
await expect(page.locator('h3', { hasText: 'Tracing' })).toBeVisible({ timeout: 10_000 })
|
|
})
|
|
|
|
test('backend logging toggle is visible in tracing section', async ({ page }) => {
|
|
await expect(page.locator('text=Enable Backend Logging')).toBeVisible()
|
|
})
|
|
|
|
test('artifact download concurrency is configurable', async ({ page }) => {
|
|
const input = page.getByLabel('Artifact Download Concurrency')
|
|
await expect(input).toBeVisible()
|
|
await input.fill('4')
|
|
await expect(input).toHaveValue('4')
|
|
})
|
|
|
|
test('persistent VRAM cache can be toggled', async ({ page }) => {
|
|
const row = page.locator('.form-row', { hasText: 'Persist remote VRAM estimates' })
|
|
await expect(row).toBeVisible()
|
|
|
|
const checkbox = row.locator('input[type="checkbox"]')
|
|
const wasChecked = await checkbox.isChecked()
|
|
await checkbox.locator('..').click()
|
|
if (wasChecked) {
|
|
await expect(checkbox).not.toBeChecked()
|
|
} else {
|
|
await expect(checkbox).toBeChecked()
|
|
}
|
|
})
|
|
|
|
test('gallery startup loading and pre-warming can be toggled together', async ({ page }) => {
|
|
const row = page.locator('.form-row', { hasText: 'Load and pre-warm galleries on boot' })
|
|
await expect(row).toBeVisible()
|
|
|
|
const checkbox = row.locator('input[type="checkbox"]')
|
|
const wasChecked = await checkbox.isChecked()
|
|
await checkbox.locator('..').click()
|
|
if (wasChecked) {
|
|
await expect(checkbox).not.toBeChecked()
|
|
} else {
|
|
await expect(checkbox).toBeChecked()
|
|
}
|
|
})
|
|
|
|
test('backend logging toggle can be toggled', async ({ page }) => {
|
|
// Find the checkbox associated with backend logging
|
|
const section = page.locator('div', { has: page.locator('text=Enable Backend Logging') })
|
|
const checkbox = section.locator('input[type="checkbox"]').last()
|
|
|
|
// Toggle on
|
|
const wasChecked = await checkbox.isChecked()
|
|
await checkbox.locator('..').click()
|
|
if (wasChecked) {
|
|
await expect(checkbox).not.toBeChecked()
|
|
} else {
|
|
await expect(checkbox).toBeChecked()
|
|
}
|
|
})
|
|
|
|
test('save shows toast', async ({ page }) => {
|
|
// Toggle a setting to enable the Save button (it's disabled when no changes)
|
|
const section = page.locator('div', { has: page.locator('text=Enable Backend Logging') })
|
|
const checkbox = section.locator('input[type="checkbox"]').last()
|
|
await checkbox.locator('..').click()
|
|
|
|
// Click save button
|
|
await page.locator('button', { hasText: /Save Changes/ }).click()
|
|
|
|
// Verify toast appears
|
|
await expect(page.locator('text=Settings saved successfully')).toBeVisible({ timeout: 5_000 })
|
|
})
|
|
})
|