Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
test(cli): add a fish leg to the local install e2e
jkomynoaa2832539480
diff --git a/.github/workflows/cli.install-e2e.yml b/.github/workflows/cli.install-e2e.ymlindex c458f5ef7..740eda4de 100644--- a/.github/workflows/cli.install-e2e.yml+++ b/.github/workflows/cli.install-e2e.yml@@ -141,7 +141,7 @@ jobs:strategy:fail-fast: falsematrix:- shell: [zsh, bash]+ shell: [zsh, bash, fish]steps:- name: Checkoutdiff --git a/ts/e2e-tests/_utils/Dockerfile.install b/ts/e2e-tests/_utils/Dockerfile.installindex ecba8b153..30b113f23 100644--- a/ts/e2e-tests/_utils/Dockerfile.install+++ b/ts/e2e-tests/_utils/Dockerfile.install@@ -2,9 +2,9 @@ FROM debian:bookworm-slimARG INSTALL_SHELL=bash-RUN case "$INSTALL_SHELL" in bash|zsh) ;; *) exit 2 ;; esac && \+RUN case "$INSTALL_SHELL" in bash|zsh|fish) ;; *) exit 2 ;; esac && \apt-get update && \- apt-get install -y --no-install-recommends bash ca-certificates curl passwd unzip $([ "$INSTALL_SHELL" = zsh ] && printf zsh) && \+ apt-get install -y --no-install-recommends bash ca-certificates curl passwd unzip $([ "$INSTALL_SHELL" = bash ] || printf '%s' "$INSTALL_SHELL") && \rm -rf /var/lib/apt/lists/* && \useradd -m -s "/bin/$INSTALL_SHELL" composiodiff --git a/ts/e2e-tests/_utils/src/const.ts b/ts/e2e-tests/_utils/src/const.tsindex cdebadf9a..d5c8d482c 100644--- a/ts/e2e-tests/_utils/src/const.ts+++ b/ts/e2e-tests/_utils/src/const.ts@@ -28,7 +28,7 @@ export const WELL_KNOWN_DENO_VERSIONS = [...toolchainVersions.deno, 'current'] a*/export const WELL_KNOWN_CLI_VERSIONS = ['current'] as const;-export const INSTALL_E2E_SHELLS = ['bash', 'zsh'] as const;+export const INSTALL_E2E_SHELLS = ['bash', 'zsh', 'fish'] as const;export const INSTALL_E2E_MODES = ['local', 'prod'] as const;diff --git a/ts/e2e-tests/_utils/src/image-lifecycle.ts b/ts/e2e-tests/_utils/src/image-lifecycle.tsindex f8e2cfdc6..c08cd6a87 100644--- a/ts/e2e-tests/_utils/src/image-lifecycle.ts+++ b/ts/e2e-tests/_utils/src/image-lifecycle.ts@@ -715,7 +715,7 @@ export async function runCliContainer(options: RunCliContainerOptions): Promise<// CLI installer Docker utilities// ============================================================================-export type InstallShell = 'bash' | 'zsh';+export type InstallShell = 'bash' | 'zsh' | 'fish';export type InstallPlatform = 'linux/amd64' | 'linux/arm64';export interface EnsureInstallImageOptions {@@ -754,8 +754,8 @@ export async function ensureInstallImage(shell: InstallShell,options: EnsureInstallImageOptions = {}): Promise<InstallImage> {- if (shell !== 'bash' && shell !== 'zsh') {- throw new Error(`ensureInstallImage(${shell}): shell must be bash or zsh`);+ if (shell !== 'bash' && shell !== 'zsh' && shell !== 'fish') {+ throw new Error(`ensureInstallImage(${shell}): shell must be bash, zsh, or fish`);}const repoRoot = options.repoRoot ?? getRepoRoot();diff --git a/ts/e2e-tests/cli/install/e2e.test.ts b/ts/e2e-tests/cli/install/e2e.test.tsindex 9d38ed180..0e413a23f 100644--- a/ts/e2e-tests/cli/install/e2e.test.ts+++ b/ts/e2e-tests/cli/install/e2e.test.ts@@ -53,10 +53,13 @@ async function run(script: string): Promise<ExecResult> {if (!image) {throw new Error('Install image is not ready');}+ // The test scripts are POSIX sh, which fish cannot interpret: drive fish legs+ // from bash and let the assertions invoke fish login shells explicitly.+ const scriptShell = config.shell === 'fish' ? 'bash' : config.shell;return runInstallContainer({...image,shell: config.shell,- cmd: [config.shell, '-lc', script],+ cmd: [scriptShell, '-lc', script],env: installerEnvironment(),});}@@ -171,6 +174,30 @@ test "$(zsh -ilc 'composio --version')" = 98.0.0});}+if (config.mode === 'local' && config.shell === 'fish') {+ describe('local fish installation', () => {+ it(+ 'configures fish idempotently and exposes composio in a fresh fish login shell',+ async () => {+ const result = await run(`+set -eu+test ! -d "$HOME/.local/bin"+curl -fsSL "$INSTALL_BASE_URL/install/fish" | sh+curl -fsSL "$INSTALL_BASE_URL/install/fish" | sh+test -x "$HOME/.composio/composio"+test -L "$HOME/.local/bin/composio"+test "$(readlink -f "$HOME/.local/bin/composio")" = "$HOME/.composio/composio"+test "$(grep -Fc '# Composio CLI' "$HOME/.config/fish/config.fish")" = 1+test "$(fish -l -c 'command -v composio')" = "$HOME/.local/bin/composio"+test "$(fish -l -c 'composio --version')" = 98.0.0+`);+ assertSuccess(result);+ },+ timeout+ );+ });+}+if (config.mode === 'local') {describe('local failure handling', () => {it(