Closed lveillard closed 5 months ago
Here are the code search results. I'm now analyzing these search results to write the PR.
tests/surrealdb/bench/all.bench.ts
In the `tests/surrealdb/bench/all.bench.ts` file, wrap the `await init()` call inside a try/catch block in the `beforeAll` function.
---
+++
@@ -1,3 +1,8 @@
beforeAll(async () => {
- await init();
+ try {
+ await init();
+ } catch (error) {
+ console.error('Error initializing benchmarking environment:', error);
+ throw error;
+ }
});
tests/bench.sh
In the `tests/bench.sh` file, add error handling for the Docker commands used to set up the test environment.
---
+++
@@ -1,2 +1,4 @@
-docker run -d --rm -p 8000:8000 surrealdb/surrealdb:latest start
-docker run -d --rm -p 1729:1729 -v $(pwd)/tests/typedb:/typedb-data vaticle/typedb:latest
+set -e
+
+docker run -d --rm -p 8000:8000 surrealdb/surrealdb:latest start || { echo "Failed to start SurrealDB container"; exit 1; }
+docker run -d --rm -p 1729:1729 -v $(pwd)/tests/typedb:/typedb-data vaticle/typedb:latest || { echo "Failed to start TypeDB container"; exit 1; }
Your changes have been successfully made to the branch sweep/fix_issues_in
. I have validated these changes using a syntax checker and a linter.
[!TIP] To recreate the pull request, edit the issue title or description.
This is an automated message generated by Sweep AI.
Details
Files to change:
File: tests/surrealdb/bench/all.bench.ts The init function is used without any error handling, which could lead to unhandled exceptions if init fails.
File: tests/bench.sh The script does not handle potential errors from Docker commands, which could lead to silent failures or incomplete setups.