Skip to content

Commit

Permalink
Update readme with config needed to run tests locally (#1056)
Browse files Browse the repository at this point in the history
* Update readme with config needed to run tests locally

* Remove coma from README.md

* FIx typos in README.md

* Refactor driver./test/testUtil.ts
  • Loading branch information
diksipav authored Jul 22, 2024
1 parent 40bb9d9 commit 0cbd195
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ $ yarn workspaces run build # build all packages
$ yarn workspaces run test # run tests for all packages
```

> In order to be able to run all tests you need to have `edgedb-server` in your
> path. This can be done by either running tests from within a Python 3.12
> virtual environment (you will have it if you built EdgeDB locally), or by
> [installing](https://docs.edgedb.com/cli/edgedb_server/edgedb_server_install#ref-cli-edgedb-server-install)
> specific EdgeDB version and then adding its binary path to the `EDGEDB_SERVER_BIN` environment variable.
> Check [here](https://docs.edgedb.com/cli/edgedb_server/edgedb_server_info#ref-cli-edgedb-server-info)
> to find how to get the binary path.
## License

`edgedb-js` is developed and distributed under the Apache 2.0 license.
10 changes: 9 additions & 1 deletion packages/driver/test/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,16 @@ export const startServer = async (
if (process.env.EDGEDB_DEBUG_SERVER) {
console.log(`running command: ${cmd.join(" ")}`);
}

const maybeEnvWithDevMode =
process.env.EDGEDB_SERVER_BIN || process.env.CI
? {}
: {
__EDGEDB_DEVMODE: "1",
};

const proc = child_process.spawn(cmd[0], cmd.slice(1), {
env: { ...process.env, ...env },
env: { ...process.env, ...env, ...maybeEnvWithDevMode },
});

try {
Expand Down

0 comments on commit 0cbd195

Please sign in to comment.