Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/lib/sandbox-base-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { afterAll, afterEach, describe, expect, it } from "vitest";

import {
baseImageInputsChangedSinceMain,
Expand All @@ -17,9 +17,15 @@ import {
} from "../../dist/lib/sandbox-base-image";

const tmpRoots: string[] = [];
const emptyGitConfigDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-empty-gitconfig-"));
tmpRoots.push(emptyGitConfigDir);
const emptyGitConfig = path.join(emptyGitConfigDir, "gitconfig");
const emptyGitConfigFd = fs.openSync(emptyGitConfig, "wx", 0o600);
fs.closeSync(emptyGitConfigFd);

const gitEnv = {
...process.env,
GIT_CONFIG_GLOBAL: "/dev/null",
GIT_CONFIG_GLOBAL: emptyGitConfig,
GIT_CONFIG_NOSYSTEM: "1",
GIT_TERMINAL_PROMPT: "0",
GIT_AUTHOR_NAME: "Test User",
Expand Down Expand Up @@ -81,6 +87,10 @@ afterEach(() => {
}
});

afterAll(() => {
fs.rmSync(emptyGitConfig, { force: true });
});

describe("sandbox base image helpers", () => {
it("parses glibc versions from ldd output", () => {
expect(parseGlibcVersion("ldd (Debian GLIBC 2.41-12+deb13u2) 2.41")).toBe("2.41");
Expand Down
1 change: 1 addition & 0 deletions test/onboard-selection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5801,6 +5801,7 @@ runner.runShell = (command, opts = {}) => {
registry.updateSandbox = (_name, update) => updates.push(update);

Object.defineProperty(process, "platform", { value: "linux" });
Object.defineProperty(process, "getuid", { value: () => 1000 });
platform.isWsl = () => false;

const { setupNim } = require(${onboardPath});
Expand Down
Loading