Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

test(setup): isolate registration checks from installed providers

morluto0e62094b69b4
diff --git a/tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts b/tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts
index 07a8b2bc7..9617e19b8 100644
--- a/tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts
+++ b/tests/acceptance/setup/registrationRuntimeEnvironmentCli.test.ts
@@ -11,6 +11,14 @@ import {
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
import { cliTest } from "../../support/cli/cliFixture.js";
+// Registration configuration tests must not discover installed providers or
+// plan provider-environment edits based on the machine running the suite.
+const missingHopperAndGhidraEnvironment = (home: string) => ({
+ HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
+ GHIDRA_INSTALL_DIR: join(home, "missing-ghidra"),
+ JAVA_HOME: join(home, "missing-java"),
+});
+
const scenarios = [
{
client: "cursor",
@@ -75,7 +83,7 @@ cliTest.for([
USERPROFILE: home,
XDG_CONFIG_HOME: join(home, ".config"),
DSH_HOME: join(home, ".dsh"),
- HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
+ ...missingHopperAndGhidraEnvironment(home),
};
const registration = (env: Readonly<Record<string, string>>) => {
const entry = clientRegistrationEntry(
@@ -194,6 +202,7 @@ for (const scenario of scenarios)
USERPROFILE: home,
XDG_CONFIG_HOME: join(home, ".config"),
DSH_HOME: join(home, ".dsh"),
+ ...missingHopperAndGhidraEnvironment(home),
};
const registration = (env: Readonly<Record<string, string>>) => {
const server = {
@@ -324,11 +333,7 @@ cliTest(
HOME: home,
USERPROFILE: home,
XDG_CONFIG_HOME: join(home, ".config"),
- // Select absent provider locations so installed tools cannot make this
- // configuration merge test plan an unrelated provider-environment edit.
- HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
- GHIDRA_INSTALL_DIR: join(home, "missing-ghidra"),
- JAVA_HOME: join(home, "missing-java"),
+ ...missingHopperAndGhidraEnvironment(home),
};
const run = (args: readonly string[]) =>
cli.run({ arguments: [...args, "--json"], cwd: home, environment });
@@ -405,7 +410,7 @@ cliTest(
XDG_CONFIG_HOME: join(home, ".config"),
CODEX_HOME: codexHome,
KIMI_CODE_HOME: kimiHome,
- HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
+ ...missingHopperAndGhidraEnvironment(home),
REA_ANALYSIS_PROVIDER: "auto",
REA_GHIDRA_STARTUP_TIMEOUT_MS: "2700001",
REA_HOPPER_STARTUP_TIMEOUT_MS: "2800002",
@@ -503,7 +508,7 @@ for (const [client, provider] of [
XDG_CONFIG_HOME: join(home, ".config"),
CODEX_HOME: clientHome,
KIMI_CODE_HOME: clientHome,
- HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
+ ...missingHopperAndGhidraEnvironment(home),
};
const setupArguments = [
"setup",
@@ -628,7 +633,7 @@ for (const invalidSetting of [
USERPROFILE: home,
XDG_CONFIG_HOME: join(home, ".config"),
KIMI_CODE_HOME: kimiHome,
- HOPPER_LAUNCHER_PATH: join(home, "missing-hopper"),
+ ...missingHopperAndGhidraEnvironment(home),
[invalidSetting.setting]: invalidSetting.value,
};
const result = await cli.run({