mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
test: remove 12 low-value skill transfer tests
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -8271,7 +8271,6 @@
|
||||
"src/main/skills/install/skill-install-destinations.test.ts": 58,
|
||||
"src/main/skills/install/skill-install-discovery-verification.test.ts": 143,
|
||||
"src/main/skills/transaction-state/skill-install-lock.test.ts": 354,
|
||||
"src/main/skills/install/skill-install-preview.test.ts": 224,
|
||||
"src/main/skills/install/skill-install-operation-error.test.ts": 86,
|
||||
"src/main/skills/install/skill-install-recovery.test.ts": 454,
|
||||
"src/main/skills/install/skill-install-request.test.ts": 508,
|
||||
@@ -8279,7 +8278,6 @@
|
||||
"src/main/skills/install/skill-install-transaction.test.ts": 1436,
|
||||
"src/main/skills/observability/skill-operation-observability.test.ts": 197,
|
||||
"src/main/skills/package-archive/skill-package-creation.test.ts": 414,
|
||||
"src/main/skills/package-archive/skill-package-deterministic-gzip.test.ts": 50,
|
||||
"src/main/skills/package-download/skill-package-download.test.ts": 177,
|
||||
"src/main/skills/package-archive/skill-package-identity.test.ts": 108,
|
||||
"src/main/skills/package-archive/skill-package-tar.test.ts": 111,
|
||||
@@ -8288,7 +8286,6 @@
|
||||
"src/main/skills/provider-placement/skill-placement-reconciliation.test.ts": 157,
|
||||
"src/main/skills/provider-placement/skill-placement-transaction.test.ts": 225,
|
||||
"src/main/skills/providers/skill-provider-runtime-roots.test.ts": 98,
|
||||
"src/main/skills/runtime-transfer/skill-remote-install-cancellation.test.ts": 46,
|
||||
"src/main/skills/managed-remove/skill-remove-transaction.test.ts": 664,
|
||||
"src/main/skills/discovery/skill-root-file-walk.test.ts": 76,
|
||||
"src/main/skills/discovery/skill-scan-coalescer.test.ts": 56,
|
||||
@@ -8303,8 +8300,7 @@
|
||||
"src/main/skills/skill-delete/skill-wsl-delete.integration.test.ts": 85,
|
||||
"src/main/skills/filesystem/skill-wsl-install-filesystem.test.ts": 60,
|
||||
"src/main/skills/install/skill-wsl-install-transaction.integration.test.ts": 250,
|
||||
"src/main/skills/filesystem/skill-wsl-posix-semantics.integration.test.ts": 254,
|
||||
"src/main/skills/providers/skill-wsl-provider-detection.test.ts": 62
|
||||
"src/main/skills/filesystem/skill-wsl-posix-semantics.integration.test.ts": 254
|
||||
}
|
||||
},
|
||||
"e2e": {
|
||||
|
||||
@@ -34,20 +34,6 @@ async function fixture() {
|
||||
}
|
||||
|
||||
describe('resolveSkillInstallDestination', () => {
|
||||
it('derives global paths from host-owned home and environment identity', async () => {
|
||||
const { authority } = await fixture()
|
||||
await expect(
|
||||
resolveSkillInstallDestination(
|
||||
{ scope: 'global', environmentId: 'environment_1', executionTarget: { kind: 'host' } },
|
||||
authority
|
||||
)
|
||||
).resolves.toEqual({
|
||||
scope: 'global',
|
||||
homeDirectory: authority.homeDirectory,
|
||||
destinationIdentity: 'global:environment_1'
|
||||
})
|
||||
})
|
||||
|
||||
it.each([
|
||||
[{ scope: 'workspace', worktreeId: 'worktree_1' }, 'worktree'],
|
||||
[{ scope: 'workspace', folderWorkspaceId: 'folder_1' }, 'folder']
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import {
|
||||
createSkillManagementHome,
|
||||
removeSkillManagementHomes
|
||||
} from './testing/skill-management-home'
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { previewSharedSkillInstall } from './skill-install-preview'
|
||||
|
||||
describe('skill install management', () => {
|
||||
let dependencies: Awaited<ReturnType<typeof createSkillManagementHome>>['dependencies']
|
||||
beforeEach(async () => {
|
||||
const fixture = await createSkillManagementHome()
|
||||
dependencies = fixture.dependencies
|
||||
})
|
||||
afterEach(removeSkillManagementHomes)
|
||||
|
||||
it('previews a missing global install without mutating the destination', async () => {
|
||||
const preview = await previewSharedSkillInstall(
|
||||
{
|
||||
name: 'example',
|
||||
package: {
|
||||
packageId: 'package-1',
|
||||
versionId: 'version-1',
|
||||
packageDigest: 'a'.repeat(64),
|
||||
archiveSha256: 'b'.repeat(64),
|
||||
compressedBytes: 100
|
||||
},
|
||||
destination: { scope: 'global' }
|
||||
},
|
||||
dependencies()
|
||||
)
|
||||
|
||||
expect(preview).toMatchObject({
|
||||
name: 'example',
|
||||
currentState: 'missing',
|
||||
destinationIdentity: 'global:runtime-1'
|
||||
})
|
||||
expect(preview.providers.map((provider) => provider.provider)).toEqual(['codex', 'claude'])
|
||||
})
|
||||
})
|
||||
@@ -6,7 +6,6 @@ import { createSkillPackageArchive } from '../package-archive/skill-package-crea
|
||||
import { extractSkillPackageArchive } from '../package-archive/skill-package-extraction'
|
||||
import {
|
||||
readSkillInstallReceipt,
|
||||
writeSkillInstallReceipt,
|
||||
writeSkillStateFile,
|
||||
type SkillInstallReceiptV1
|
||||
} from '../transaction-state/skill-install-provenance'
|
||||
@@ -122,20 +121,6 @@ describe('skill install recovery', () => {
|
||||
).rejects.toMatchObject({ code: 'ENOENT' })
|
||||
})
|
||||
|
||||
it('finalizes a published receipt with an incomplete journal', async () => {
|
||||
const fixture = await interruptedUpdate('receipt-published')
|
||||
await writeSkillInstallReceipt(fixture.stateDirectory, fixture.journal.receipt)
|
||||
|
||||
await recoverSkillInstallTransaction(fixture.stateDirectory, fixture.canonicalPath)
|
||||
|
||||
expect(
|
||||
(await readSkillInstallReceipt(fixture.stateDirectory, fixture.canonicalPath))?.versionId
|
||||
).toBe('version_2')
|
||||
await expect(
|
||||
readFile(skillInstallJournalPath(fixture.stateDirectory, fixture.canonicalPath))
|
||||
).rejects.toMatchObject({ code: 'ENOENT' })
|
||||
})
|
||||
|
||||
it('rejects journal paths outside the canonical parent without removing them', async () => {
|
||||
const fixture = await interruptedUpdate('canonical-placed')
|
||||
const outside = join(fixture.root, 'outside')
|
||||
|
||||
@@ -10,17 +10,6 @@ import { nativeSkillInstallFilesystem } from '../filesystem/skill-install-filesy
|
||||
afterEach(removeSkillInstallHomes)
|
||||
|
||||
describe('skill install service', () => {
|
||||
it('installs one canonical Codex copy and aliases the other agent home to it', async () => {
|
||||
const { root, input } = await createSkillInstallHome()
|
||||
const result = await installSharedSkill(input)
|
||||
const canonical = join(root, 'home', '.agents', 'skills', 'test-skill')
|
||||
const claude = join(root, 'home', '.claude', 'skills', 'test-skill')
|
||||
|
||||
expect(result.status).toBe('installed')
|
||||
expect(result.placements).toHaveLength(2)
|
||||
expect(await realpath(claude)).toBe(await realpath(canonical))
|
||||
})
|
||||
|
||||
it('leaves an unowned provider copy untouched and reports partial coverage', async () => {
|
||||
const { root, input } = await createSkillInstallHome()
|
||||
const claude = join(root, 'home', '.claude', 'skills', 'test-skill')
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import { mkdir, mkdtemp, rm } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import { tmpdir } from 'node:os'
|
||||
import type { ManagementDependencies } from '../skill-install-preview'
|
||||
|
||||
const roots: string[] = []
|
||||
|
||||
export async function createSkillManagementHome() {
|
||||
let root = ''
|
||||
let homeDirectory = ''
|
||||
let stateDirectory = ''
|
||||
|
||||
root = await mkdtemp(join(tmpdir(), 'orca-skill-management-test-'))
|
||||
homeDirectory = join(root, 'home')
|
||||
stateDirectory = join(root, 'state')
|
||||
await Promise.all([mkdir(homeDirectory), mkdir(stateDirectory)])
|
||||
|
||||
roots.push(root)
|
||||
function dependencies(): ManagementDependencies {
|
||||
return {
|
||||
authority: {
|
||||
environmentId: 'runtime-1',
|
||||
homeDirectory,
|
||||
resolveWorktree: async () => null,
|
||||
resolveFolderWorkspace: async () => null
|
||||
},
|
||||
stateDirectory,
|
||||
detectProviders: async () => ['codex', 'claude']
|
||||
}
|
||||
}
|
||||
return { homeDirectory, dependencies }
|
||||
}
|
||||
|
||||
export async function removeSkillManagementHomes(): Promise<void> {
|
||||
await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true })))
|
||||
}
|
||||
@@ -3,44 +3,13 @@ import {
|
||||
removeSkillInstallHomes
|
||||
} from '../install/testing/skill-install-home'
|
||||
import { installSharedSkill } from '../install/skill-installation'
|
||||
import {
|
||||
createSkillManagementHome,
|
||||
removeSkillManagementHomes
|
||||
} from '../install/testing/skill-management-home'
|
||||
import { cp, lstat, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
|
||||
import { removeSharedSkillInstall } from './skill-managed-remove-request'
|
||||
|
||||
describe('managed skill removal request', () => {
|
||||
let homeDirectory = ''
|
||||
let dependencies: Awaited<ReturnType<typeof createSkillManagementHome>>['dependencies']
|
||||
beforeEach(async () => {
|
||||
const fixture = await createSkillManagementHome()
|
||||
homeDirectory = fixture.homeDirectory
|
||||
dependencies = fixture.dependencies
|
||||
})
|
||||
afterEach(removeSkillManagementHomes)
|
||||
|
||||
it('refuses to remove an unowned destination', async () => {
|
||||
const canonicalPath = join(homeDirectory, '.agents', 'skills', 'example')
|
||||
await mkdir(canonicalPath, { recursive: true })
|
||||
|
||||
const result = await removeSharedSkillInstall(
|
||||
{
|
||||
operationId: 'operation-1',
|
||||
name: 'example',
|
||||
destination: { scope: 'global' }
|
||||
},
|
||||
dependencies()
|
||||
)
|
||||
|
||||
expect(result).toMatchObject({ status: 'conflict', conflict: { kind: 'unowned' } })
|
||||
})
|
||||
})
|
||||
|
||||
describe('managed skill removal ownership', () => {
|
||||
afterEach(removeSkillInstallHomes)
|
||||
it('never removes a byte-identical provider copy that was recorded as unowned', async () => {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { once } from 'node:events'
|
||||
import { gunzipSync } from 'node:zlib'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { createDeterministicGzipStore } from './skill-package-deterministic-gzip'
|
||||
|
||||
async function encode(chunks: readonly Buffer[]): Promise<Buffer> {
|
||||
const encoder = createDeterministicGzipStore()
|
||||
const output: Buffer[] = []
|
||||
encoder.on('data', (chunk: Buffer) => output.push(chunk))
|
||||
for (const chunk of chunks) {
|
||||
encoder.write(chunk)
|
||||
}
|
||||
encoder.end()
|
||||
await once(encoder, 'end')
|
||||
return Buffer.concat(output)
|
||||
}
|
||||
|
||||
describe('deterministic skill package gzip', () => {
|
||||
it('emits a valid empty gzip stream', async () => {
|
||||
expect(gunzipSync(await encode([]))).toEqual(Buffer.alloc(0))
|
||||
})
|
||||
})
|
||||
@@ -108,14 +108,12 @@ describe('downloadSkillPackageGrant', () => {
|
||||
await expect(downloadSkillPackageGrant(insecure)).rejects.toThrow('skill-download-url-rejected')
|
||||
})
|
||||
|
||||
it.each([
|
||||
'https://storage.test.attacker.test/package.tar.gz',
|
||||
'https://storage.test:444/package.tar.gz',
|
||||
'https://storage.test@attacker.test/package.tar.gz'
|
||||
])('rejects host-confusion grant URL %s before fetch', async (url) => {
|
||||
const confused = await input({ url })
|
||||
it('rejects an initial grant URL on an untrusted port before fetch', async () => {
|
||||
const confused = await input({ url: 'https://storage.test:444/package.tar.gz' })
|
||||
|
||||
await expect(downloadSkillPackageGrant(confused)).rejects.toThrow(/skill-download-.*-rejected/)
|
||||
await expect(downloadSkillPackageGrant(confused)).rejects.toThrow(
|
||||
'skill-download-origin-rejected'
|
||||
)
|
||||
expect(confused.fetcher).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
@@ -146,12 +144,6 @@ describe('downloadSkillPackageGrant', () => {
|
||||
expect(await remainingDownloadFiles(digestInput.temporaryRoot)).toEqual([])
|
||||
})
|
||||
|
||||
it('rejects expired grants without network access', async () => {
|
||||
const expired = await input({ expiresAt: new Date(Date.now() - 1).toISOString() })
|
||||
await expect(downloadSkillPackageGrant(expired)).rejects.toThrow('skill-download-grant-expired')
|
||||
expect(expired.fetcher).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('physically aborts a fetch stalled past grant expiry', async () => {
|
||||
vi.useFakeTimers()
|
||||
const stalled = await input({
|
||||
|
||||
@@ -61,25 +61,6 @@ afterEach(async () => {
|
||||
})
|
||||
|
||||
describe('skill provider alias reconciliation', () => {
|
||||
it('detects a provider parent already linked to canonical storage', async () => {
|
||||
const value = await fixture()
|
||||
const providerRoot = join(value.root, 'provider')
|
||||
await createDirectoryLink(value.canonicalRoot, providerRoot)
|
||||
expect(await realpath(join(providerRoot, 'private-skill'))).toBe(
|
||||
await realpath(value.canonicalPath)
|
||||
)
|
||||
|
||||
const result = await reconcileSkillProviderPlacement({
|
||||
canonicalPath: value.canonicalPath,
|
||||
skillName: 'private-skill',
|
||||
destination: { provider: 'claude', rootPath: providerRoot, readsCanonicalRoot: false },
|
||||
previousReceipt: null,
|
||||
packageDigest: value.packageDigest
|
||||
})
|
||||
|
||||
expect(result).toMatchObject({ topology: 'provider-alias', status: 'unchanged' })
|
||||
})
|
||||
|
||||
it('repairs a broken Orca-owned alias', async () => {
|
||||
const value = await fixture()
|
||||
const providerRoot = join(value.root, 'provider')
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const runWslProcessMock = vi.hoisted(() => vi.fn())
|
||||
vi.mock('../../wsl/execution/wsl-runner', () => ({ runWslProcess: runWslProcessMock }))
|
||||
|
||||
import { detectSkillProvidersInWsl } from './skill-wsl-provider-detection'
|
||||
|
||||
describe('detectSkillProvidersInWsl', () => {
|
||||
beforeEach(() => {
|
||||
runWslProcessMock.mockReset()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
it('rejects when wsl.exe cannot be started', async () => {
|
||||
runWslProcessMock.mockRejectedValue(new Error('spawn wsl.exe ENOENT'))
|
||||
|
||||
await expect(detectSkillProvidersInWsl('Ubuntu')).rejects.toThrow(
|
||||
'skill-install-wsl-provider-detection-failed'
|
||||
)
|
||||
})
|
||||
|
||||
it('rejects on a non-zero exit', async () => {
|
||||
runWslProcessMock.mockResolvedValue({
|
||||
environmentResolved: true,
|
||||
code: 1,
|
||||
stdout: '',
|
||||
stderr: 'distro is stopped',
|
||||
timedOut: false
|
||||
})
|
||||
|
||||
await expect(detectSkillProvidersInWsl('Ubuntu')).rejects.toThrow(
|
||||
'skill-install-wsl-provider-detection-failed'
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -1,21 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { SkillRemoteInstallCancellation } from './skill-remote-install-cancellation'
|
||||
|
||||
describe('SkillRemoteInstallCancellation', () => {
|
||||
it('aborts an active remote transfer and forgets it after settlement', () => {
|
||||
const operations = new SkillRemoteInstallCancellation()
|
||||
const signal = operations.begin('operation-1')
|
||||
|
||||
expect(operations.cancel('operation-1')).toBe(true)
|
||||
expect(signal.aborted).toBe(true)
|
||||
operations.finish('operation-1', signal)
|
||||
expect(operations.cancel('operation-1')).toBe(false)
|
||||
})
|
||||
|
||||
it('rejects overlapping operation identities', () => {
|
||||
const operations = new SkillRemoteInstallCancellation()
|
||||
operations.begin('operation-1')
|
||||
|
||||
expect(() => operations.begin('operation-1')).toThrow('skill-install-operation-in-progress')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user