Skip to content

Conversation

@LucioFranco
Copy link
Contributor

@LucioFranco LucioFranco commented Nov 26, 2025

Note

Use a temp pnpm-installed moose-cli instead of npx, switch installs to pnpm, explicitly use Python 3.13, and update flake to python313 with cleanup handling.

  • E2E Backward-Compat Tests (apps/framework-cli-e2e/test/backward-compatibility.test.ts):
    • Install latest @514labs/moose-cli via pnpm into a temp dir and use its binary (LATEST_CLI_PATH) for init and dev.
    • Replace npm install with pnpm install for TypeScript template setup.
    • Python setup: create venv with python3.13 and install from requirements.txt.
    • Add after hook to clean up the temporary CLI install directory.
    • Adjust spawn/env to use the npm-installed CLI path.
  • Nix (flake.nix):
    • Bump Python from python312 to python313 and propagate through pythonEnv.

Written by Cursor Bugbot for commit 6663a7e. This will update automatically on new commits. Configure here.

Created using jj-spr 0.1.0
@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Nov 26, 2025 10:46pm
framework-docs Ready Ready Preview Comment Nov 26, 2025 10:46pm

Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Temporary CLI install directory never cleaned up

The checkLatestPublishedCLI() function creates a temporary directory via fs.mkdtempSync() and stores it in the global CLI_INSTALL_DIR variable. However, there's no corresponding cleanup in an after() hook at the outer describe level to remove this directory after all tests complete. This causes a resource leak where temporary directories accumulate in the system's temp folder. An after() hook should be added to clean up CLI_INSTALL_DIR when the test suite finishes.

apps/framework-cli-e2e/test/backward-compatibility.test.ts#L246-L263

describe("Backward Compatibility Tests", function () {
before(async function () {
this.timeout(TIMEOUTS.TEST_SETUP_MS);
// Check latest published CLI is available
await checkLatestPublishedCLI();
// Verify new CLI is built
try {
await fs.promises.access(CLI_PATH, fs.constants.F_OK);
} catch (err) {
console.error(
`CLI not found at ${CLI_PATH}. It should be built in the pretest step.`,
);
throw err;
}
});

apps/framework-cli-e2e/test/backward-compatibility.test.ts#L64-L106

*/
async function checkLatestPublishedCLI(): Promise<void> {
console.log("Installing latest published moose-cli from npm...");
try {
// Create a temp directory for CLI install
const os = require("os");
CLI_INSTALL_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "moose-cli-"));
console.log(`Installing CLI to temp directory: ${CLI_INSTALL_DIR}`);
// Install CLI using pnpm (consistent with monorepo)
const installResult = await execAsync(
"pnpm add @514labs/moose-cli@latest",
{ cwd: CLI_INSTALL_DIR },
);
console.log("pnpm install output:", installResult.stdout);
// Find the installed CLI binary in pnpm's structure
LATEST_CLI_PATH = path.join(
CLI_INSTALL_DIR,
"node_modules",
".bin",
"moose-cli",
);
// Verify it exists and works
if (!fs.existsSync(LATEST_CLI_PATH)) {
throw new Error(`CLI binary not found at ${LATEST_CLI_PATH}`);
}
const { stdout: version } = await execAsync(
`"${LATEST_CLI_PATH}" --version`,
);
console.log("Latest published CLI version:", version.trim());
} catch (error: any) {
console.error("Failed to install latest CLI:", error.message);
if (error.stdout) console.error("stdout:", error.stdout);
if (error.stderr) console.error("stderr:", error.stderr);
throw new Error(
"Cannot install latest published CLI for backward compatibility test",
);
}
}

Fix in Cursor Fix in Web


Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Created using jj-spr 0.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants