Skip to content

Commit

Permalink
Use edgedb-server in testUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
diksipav committed Jan 20, 2025
1 parent bbc010e commit 7c68cbb
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/driver/test/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ export const getServerCommand = (
strictSecurity = true,
): { args: string[]; availableFeatures: string[] } => {
const availableFeatures: string[] = [];
const srvcmd = process.env.GEL_SERVER_BIN || "gel-server";

// we can check version here and use gel-server for newer versions
// but edgedb-server works for all versions
const srvcmd = process.env.GEL_SERVER_BIN || "edgedb-server";

let args = [srvcmd];
if (process.platform === "win32") {
args = ["wsl", "-u", "gel", ...args];
args = ["wsl", "-u", "edgedb", ...args];
}

const helpCmd = [...args, "--help"];
Expand Down Expand Up @@ -127,7 +130,6 @@ export const getServerCommand = (
`--security=${strictSecurity ? "strict" : "insecure_dev_mode"}`,
"--bootstrap-command=ALTER ROLE edgedb { SET password := 'edgedbtest' }",
];

return { args, availableFeatures };
};

Expand All @@ -146,7 +148,9 @@ export const startServer = async (
}

const maybeEnvWithDevMode =
process.env.GEL_SERVER_BIN || process.env.CI
process.env.GEL_SERVER_BIN ||
process.env.EDGEDB_SERVER_BIN ||
process.env.CI
? {}
: {
__EDGEDB_DEVMODE: "1",
Expand Down Expand Up @@ -292,20 +296,20 @@ export async function applyMigrations(
if (process.platform === "win32") {
await runCommand("wsl", [
"-u",
"gel",
"edgedb",
"env",
...Object.entries(configToEnv(config)).map(
([key, val]) => `${key}=${val}`,
),
"gel",
"edgedb",
"migrate",
...(params?.flags || []),
"--schema-dir",
getWSLPath(path.join(process.cwd(), "dbschema")),
]);
} else {
await runCommand(
"gel",
"edgedb",
["migrate", ...(params?.flags || [])],
configToEnv(config),
);
Expand Down

0 comments on commit 7c68cbb

Please sign in to comment.