mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
test: remove low-value WSL and identity lookup tests (#43621)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -417,59 +417,6 @@ it('answers unavailable when the worker cannot load, or is stopped while loading
|
||||
await vi.waitFor(() => expect(workers.every(exited)).toBe(true))
|
||||
})
|
||||
|
||||
describe('PaneAgentIdentities explicit lookups', () => {
|
||||
it.each([12, 120])(
|
||||
'asks the store once for %i simultaneous callers of one id',
|
||||
async (callers) => {
|
||||
const client = new InProcessAgentIdentityClient()
|
||||
const { identities } = inProcessService(databasePath(), client)
|
||||
const id = await identities.identify(sighting({ id: 'dormant' }))
|
||||
client.hasRequests = 0
|
||||
|
||||
const answers = await Promise.all(
|
||||
Array.from({ length: callers }, () => identities.isTerminalIdentity(id!))
|
||||
)
|
||||
|
||||
expect(answers.every((known) => known === true)).toBe(true)
|
||||
expect(client.hasRequests).toBe(1)
|
||||
}
|
||||
)
|
||||
|
||||
it('answers reverse lookups only through their indexes, once a busy writer lets them be built', () => {
|
||||
const path = databasePath()
|
||||
const store = new AgentIdentityStore(path)
|
||||
opened.push(store)
|
||||
const id = store.identify({
|
||||
executionHost: 'local',
|
||||
wslDistro: '',
|
||||
agent: 'claude',
|
||||
providerSessionId: 'session-a',
|
||||
locator: ''
|
||||
})
|
||||
const writer = new SyncDatabase(path)
|
||||
opened.push(writer)
|
||||
writer.exec('BEGIN IMMEDIATE')
|
||||
// Never a scan of every link: a store that cannot build the indexes cannot answer yet.
|
||||
expect(() => store.providerKeyOf(id!)).toThrow()
|
||||
writer.exec('COMMIT')
|
||||
|
||||
expect(store.providerKeyOf(id!)).toMatchObject({ providerSessionId: 'session-a' })
|
||||
expect(store.idsOfProviderSession('session-a')).toEqual([id])
|
||||
const plans = [
|
||||
'SELECT locator FROM provider_links WHERE orca_session_id = ?',
|
||||
'SELECT DISTINCT orca_session_id FROM provider_links WHERE provider_session_id = ?'
|
||||
].map((sql) =>
|
||||
writer
|
||||
.prepare(`EXPLAIN QUERY PLAN ${sql}`)
|
||||
.all('x')
|
||||
.map((row) => String(row.detail))
|
||||
.join('; ')
|
||||
)
|
||||
expect(plans[0]).toContain('USING INDEX provider_links_by_orca_session')
|
||||
expect(plans[1]).toContain('USING INDEX provider_links_by_provider_session')
|
||||
})
|
||||
})
|
||||
|
||||
/** A newer build's read-only identity file with `links` links and only `indexSql`'s indexes. */
|
||||
function newerReadOnlyFile(links: number, indexSql: string[]) {
|
||||
const path = databasePath()
|
||||
|
||||
@@ -60,15 +60,6 @@ describe('resolveWslInteropSpawnCwd', () => {
|
||||
expect(resolveWslInteropSpawnCwd()).toBe(systemRoot)
|
||||
})
|
||||
|
||||
it('never falls back to the profile or user folder when no system directory resolves', () => {
|
||||
const profile = makeExistingDirectory()
|
||||
const userFolder = makeExistingDirectory()
|
||||
process.env.ORCA_USER_DATA_PATH = profile
|
||||
process.env.USERPROFILE = userFolder
|
||||
|
||||
expect([profile, userFolder]).not.toContain(resolveWslInteropSpawnCwd())
|
||||
})
|
||||
|
||||
it('skips a candidate that does not resolve instead of naming it', () => {
|
||||
process.env.SystemRoot = join(tmpdir(), 'orca-wsl-spawn-cwd-never-created')
|
||||
const windir = makeExistingDirectory()
|
||||
|
||||
Reference in New Issue
Block a user