test: align runtime fixtures across platforms
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s

Account for Electron-as-Node when probing the current executable and update the Linux workspace registry scenario to validate the writable handle behavior shipped with remote file management.
This commit is contained in:
mesalogo
2026-09-10 07:01:48 +08:00
parent 21ac8330ea
commit c1848a9dc4
2 changed files with 21 additions and 13 deletions
+15 -11
View File
@@ -137,7 +137,7 @@ describe('WorkspaceRegistry', () => {
).rejects.toMatchObject({ code: 'workspace-not-found' })
})
linuxIt('enforces read-only policy, caps, and symlink-root rejection', async () => {
linuxIt('supports writable handles while enforcing caps and symlink-root rejection', async () => {
const root = temporaryDirectory()
const linked = join(tmpdir(), `goodbuddy-linked-${Date.now()}`)
symlinkSync(root, linked, 'dir')
@@ -149,16 +149,20 @@ describe('WorkspaceRegistry', () => {
maximumControllerHandles: 1,
inspectGit: async () => 'not-a-repository'
})
await expect(
registry.validate(
{
remoteRootPath: root,
requestedAccess: 'read-write',
requiredCapabilities: []
},
controller
)
).rejects.toMatchObject({ code: 'read-only' })
const writable = await registry.validate(
{
remoteRootPath: root,
requestedAccess: 'read-write',
requiredCapabilities: []
},
controller
)
expect(writable.handle.access).toBe('read-write')
await registry.close(
writable.handle.workspaceId,
writable.handle.generation,
controller
)
await expect(
registry.validate(
{
+6 -2
View File
@@ -75,7 +75,7 @@ describe('runtime discovery', () => {
await expect(validation).resolves.toEqual({ valid: false })
})
it('canonicalizes a configured ordinary file without launching it', async () => {
it('canonicalizes and validates a configured ordinary file first', async () => {
process.env.PATH = ''
process.env.Path = ''
@@ -90,7 +90,11 @@ describe('runtime discovery', () => {
path: await realpath(process.execPath),
source: 'configured'
})
expect(detection.version).toBeUndefined()
if (process.versions.electron) {
expect(detection.version).toBeUndefined()
} else {
expect(detection.version).toMatch(/^\d+\.\d+\.\d+/u)
}
})
it('trusts a configured execution path without reading or launching it', async () => {