Files
composiohq__composio/ts/packages/cli-local-tools/scripts/swift-system-patches.test.ts
Alberto Schiabel 74ce25812e fix(ci): repair CLI binary and docs sync workflows (#3568)
This PR:
- patches the Peekaboo sidecar build to rewrite the resolved
`swift-system` `AT_RESOLVE_BENEATH` Darwin guard before compiling on
GitHub macOS runners
- adds regression coverage for the `swift-system` checkout patch and
includes script tests in `@composio/cli-local-tools` Vitest
- switches the SDK docs sync workflow to
`anthropics/claude-code-action/base-action` so push-triggered automation
does not fail on unsupported event parsing
- moves Claude tool restrictions to `claude_args` and quotes
`$GITHUB_OUTPUT` writes so the workflow passes `actionlint`
- verifies the changed package and workflow with targeted tests, build,
formatting, YAML parsing, and `actionlint`
2026-06-15 15:27:21 +04:00

37 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { patchSwiftSystemAtResolveBeneathGuardInSource } from './swift-system-patches';
describe('swift-system build patches', () => {
it('narrows AT_RESOLVE_BENEATH availability to FreeBSD', () => {
const source = `#if canImport(Darwin, _version: 346) || os(FreeBSD)
@_alwaysEmitIntoClient
internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
#endif
`;
const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
source,
'Sources/System/Internals/Constants.swift'
);
expect(patched.replacementCount).toBe(1);
expect(patched.source).toContain('#if os(FreeBSD)');
expect(patched.source).not.toContain('canImport(Darwin, _version: 346)');
});
it('is idempotent for already patched sources', () => {
const source = `#if os(FreeBSD)
@_alwaysEmitIntoClient
internal var _AT_RESOLVE_BENEATH: CInt { AT_RESOLVE_BENEATH }
#endif
`;
const patched = patchSwiftSystemAtResolveBeneathGuardInSource(
source,
'Sources/System/Internals/Constants.swift'
);
expect(patched).toEqual({ source, replacementCount: 0 });
});
});