Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(ts/e2e): address cursorbot

jkomyno2acf31d1532d
diff --git a/ts/e2e-tests/_utils/src/config.ts b/ts/e2e-tests/_utils/src/config.ts
index ca78782e0..54cbab736 100644
--- a/ts/e2e-tests/_utils/src/config.ts
+++ b/ts/e2e-tests/_utils/src/config.ts
@@ -160,13 +160,16 @@ export function resolveDenoVersionMetaList(
configDenoVersions?: readonly DenoVersionFromUser[]
): NonEmptyArray<DenoVersionMeta> {
const envVersion = Bun.env.COMPOSIO_E2E_DENO_VERSION;
- const dvmrcVersion = getDvmrcVersion();
// Local mode with env override: single version, no skip
+ // Check this BEFORE calling getDvmrcVersion() so env override works without .dvmrc
if (!isCI() && envVersion) {
return [{ kind: 'overridden', value: envVersion, skip: { value: false } }];
}
+ // Only read .dvmrc after env override check (getDvmrcVersion throws if file missing)
+ const dvmrcVersion = getDvmrcVersion();
+
// No config provided: use .dvmrc version
if (configDenoVersions === undefined || configDenoVersions.length === 0) {
return [{ kind: 'current', value: dvmrcVersion, skip: { value: false } }];
diff --git a/ts/e2e-tests/_utils/src/image-lifecycle.ts b/ts/e2e-tests/_utils/src/image-lifecycle.ts
index 8faeeaea7..466546ce4 100644
--- a/ts/e2e-tests/_utils/src/image-lifecycle.ts
+++ b/ts/e2e-tests/_utils/src/image-lifecycle.ts
@@ -444,10 +444,10 @@ export async function runDenoContainer(options: RunDenoContainerOptions): Promis
// Handle cmd as array for direct execution without shell interpretation.
if (Array.isArray(cmd)) {
dockerArgs.push(...cmd.map(String));
- // Handle cmd as string by wrapping in deno run with necessary permissions.
+ // Handle cmd as string by wrapping in login shell for proper environment setup.
+ // Callers must explicitly use 'deno run --allow-all <file>' when running Deno scripts.
} else if (typeof cmd === 'string' && cmd.length > 0) {
- // Use deno run with all permissions for e2e tests
- dockerArgs.push('sh', '-lc', `deno run --allow-all ${cmd}`);
+ dockerArgs.push('sh', '-lc', cmd);
} else {
throw new Error('runDenoContainer({ cmd, ... }): cmd must be a non-empty string or string[]');
}
diff --git a/ts/e2e-tests/_utils/src/runner.ts b/ts/e2e-tests/_utils/src/runner.ts
index 6415b74ca..5fce1dcd9 100644
--- a/ts/e2e-tests/_utils/src/runner.ts
+++ b/ts/e2e-tests/_utils/src/runner.ts
@@ -350,7 +350,7 @@ function createNodeDockerExecutors(
try {
await createVolume(volumeName);
- await initializeVolumeOwnership(volumeName, imageTag);
+ await initializeVolumeOwnership(volumeName, imageTag, 'node');
const setupContainerName = `${containerBaseName}-setup`;
const setupStartTime = Date.now();
@@ -481,10 +481,12 @@ function createDenoDockerExecutors(
function runFixture(options: { filename: string; setup: string }): Promise<E2ETestResultWithSetup>;
async function runFixture(options: RunFixtureOptions): Promise<E2ETestResult | E2ETestResultWithSetup> {
const { filename, setup } = options;
+ // Deno scripts need explicit 'deno run' with permissions
+ const denoRunCmd = `deno run --allow-all ${filename}`;
// For Deno without setup, just run the file directly
if (!setup) {
- return runCmd(filename);
+ return runCmd(denoRunCmd);
}
// Deno with setup: use Docker volumes for caching
@@ -495,7 +497,7 @@ function createDenoDockerExecutors(
try {
await createVolume(volumeName);
- await initializeVolumeOwnership(volumeName, imageTag);
+ await initializeVolumeOwnership(volumeName, imageTag, 'deno');
const setupContainerName = `${containerBaseName}-setup`;
const setupStartTime = Date.now();
@@ -525,7 +527,7 @@ function createDenoDockerExecutors(
const fixtureStartTime = Date.now();
const fixtureResult = await runDenoContainer({
imageTag,
- cmd: filename,
+ cmd: denoRunCmd,
cwd: effectiveCwd,
env: containerEnv,
name: fixtureContainerName,
@@ -537,7 +539,7 @@ function createDenoDockerExecutors(
phase: 'fixture',
phaseIndex: 2,
totalPhases: 2,
- command: filename,
+ command: denoRunCmd,
containerName: fixtureContainerName,
durationMs: fixtureDurationMs,
exitCode: fixtureResult.exitCode,
diff --git a/ts/e2e-tests/_utils/src/volume.ts b/ts/e2e-tests/_utils/src/volume.ts
index c4c2dd13b..2c556ef5d 100644
--- a/ts/e2e-tests/_utils/src/volume.ts
+++ b/ts/e2e-tests/_utils/src/volume.ts
@@ -49,18 +49,23 @@ export async function removeVolume(name: string): Promise<void> {
}
/**
- * Initializes a Docker volume with correct ownership for the node user (UID 1000).
+ * Initializes a Docker volume with correct ownership for the container user.
* This is necessary because Docker volumes are created with root ownership by default.
*
* @param volumeName - Name of the volume to initialize
* @param imageTag - Docker image to use for the initialization container
+ * @param runtime - Runtime type ('node' or 'deno') to determine the correct user/group
*/
export async function initializeVolumeOwnership(
volumeName: string,
- imageTag: string
+ imageTag: string,
+ runtime: 'node' | 'deno'
): Promise<void> {
+ // Node images use node:node, Deno images use deno:deno
+ const user = runtime === 'node' ? 'node:node' : 'deno:deno';
+
// Run a quick container as root to chown the volume contents
- const result = await $`docker run --rm --user root -v ${volumeName}:/mnt/vol ${imageTag} chown -R node:node /mnt/vol`.nothrow().quiet();
+ const result = await $`docker run --rm --user root -v ${volumeName}:/mnt/vol ${imageTag} chown -R ${user} /mnt/vol`.nothrow().quiet();
if (result.exitCode !== 0) {
const err = new Error(`Failed to initialize volume ownership for: ${volumeName}`);