test: add support for testing native binaries

- Update TestRig to support GEMINI_BINARY environment variable
- Add E2E smoke test job for native Linux binary
- Minimal addition that runs in parallel with existing tests
This commit is contained in:
Daniel Young Lee
2025-08-10 13:22:38 -07:00
parent 46480326cf
commit f9c3e0d71a
2 changed files with 34 additions and 4 deletions

View File

@@ -103,7 +103,14 @@ export function validateModelOutput(
export class TestRig {
constructor() {
this.bundlePath = join(__dirname, '..', 'bundle/gemini.js');
// Support testing native binaries via GEMINI_BINARY env variable
if (env.GEMINI_BINARY) {
this.binaryPath = env.GEMINI_BINARY;
this.isNativeBinary = true;
} else {
this.bundlePath = join(__dirname, '..', 'bundle/gemini.js');
this.isNativeBinary = false;
}
this.testDir = null;
}
@@ -162,7 +169,9 @@ export class TestRig {
}
run(promptOrOptions, ...args) {
let command = `node ${this.bundlePath} --yolo`;
let command = this.isNativeBinary
? `${this.binaryPath} --yolo`
: `node ${this.bundlePath} --yolo`;
const execOptions = {
cwd: this.testDir,
encoding: 'utf-8',
@@ -185,9 +194,9 @@ export class TestRig {
command += ` ${args.join(' ')}`;
const commandArgs = parse(command);
const node = commandArgs.shift();
const executable = commandArgs.shift();
const child = spawn(node, commandArgs, {
const child = spawn(executable, commandArgs, {
cwd: this.testDir,
stdio: 'pipe',
});