Skip to content

Commit a0b8dd6

Browse files
committed
🤖 refactor: rename CMUX_TEST_ROOT to CMUX_ROOT
Renames CMUX_TEST_ROOT to CMUX_ROOT for clearer intent - this env var is not just for tests, but for any scenario where you want to override the default data directory. The -dev suffix behavior from #573 is preserved: - `make start` uses `~/.cmux-dev` (NODE_ENV=development) - Packaged apps use `~/.cmux` - `CMUX_ROOT=/custom/path` overrides both Changes: - Renamed CMUX_TEST_ROOT → CMUX_ROOT in all files - Updated comments to reflect the clearer naming - All existing behavior preserved _Generated with `cmux`_
1 parent 43bce08 commit a0b8dd6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/constants/paths.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join } from "path";
33

44
/**
55
* Get the root directory for all cmux configuration and data.
6-
* Can be overridden with CMUX_TEST_ROOT environment variable.
6+
* Can be overridden with CMUX_ROOT environment variable.
77
* Appends '-dev' suffix when NODE_ENV=development (explicit dev mode).
88
*
99
* This is a getter function to support test mocking of os.homedir().
@@ -13,9 +13,9 @@ import { join } from "path";
1313
*/
1414
export function getCmuxHome(): string {
1515
// eslint-disable-next-line no-restricted-syntax, no-restricted-globals
16-
if (process.env.CMUX_TEST_ROOT) {
16+
if (process.env.CMUX_ROOT) {
1717
// eslint-disable-next-line no-restricted-syntax, no-restricted-globals
18-
return process.env.CMUX_TEST_ROOT;
18+
return process.env.CMUX_ROOT;
1919
}
2020

2121
const baseName = ".cmux";

src/main-desktop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const forceDistLoad = process.env.CMUX_E2E_LOAD_DIST === "1";
7575

7676
if (isE2ETest) {
7777
// For e2e tests, use a test-specific userData directory
78-
// Note: getCmuxHome() already respects CMUX_TEST_ROOT for test isolation
78+
// Note: getCmuxHome() already respects CMUX_ROOT for test isolation
7979
const e2eUserData = path.join(getCmuxHome(), "user-data");
8080
try {
8181
fs.mkdirSync(e2eUserData, { recursive: true });

tests/e2e/electronTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function buildTarget(target: string): void {
8888

8989
export const electronTest = base.extend<ElectronFixtures>({
9090
workspace: async ({}, use, testInfo) => {
91-
const envRoot = process.env.CMUX_TEST_ROOT ?? "";
91+
const envRoot = process.env.CMUX_ROOT ?? "";
9292
const baseRoot = envRoot || defaultTestRoot;
9393
const uniqueTestId = testInfo.testId || testInfo.title || `test-${Date.now()}`;
9494
const testRoot = envRoot ? baseRoot : path.join(baseRoot, sanitizeForPath(uniqueTestId));
@@ -195,7 +195,7 @@ export const electronTest = base.extend<ElectronFixtures>({
195195
}
196196
electronEnv.ELECTRON_DISABLE_SECURITY_WARNINGS = "true";
197197
electronEnv.CMUX_MOCK_AI = electronEnv.CMUX_MOCK_AI ?? "1";
198-
electronEnv.CMUX_TEST_ROOT = configRoot;
198+
electronEnv.CMUX_ROOT = configRoot;
199199
electronEnv.CMUX_E2E = "1";
200200
electronEnv.CMUX_E2E_LOAD_DIST = shouldLoadDist ? "1" : "0";
201201
electronEnv.VITE_DISABLE_MERMAID = "1";

0 commit comments

Comments
 (0)