Skip to content

Commit e45c9d2

Browse files
authored
Remove dep on test_utils (#532)
1 parent 26a847e commit e45c9d2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gel-tokio = { path = "../gel-tokio", features = ["unstable"] }
2222
gel-protocol = { path = "../gel-protocol", features = ["serde_json"] }
2323
gel-errors = { path = "../gel-errors" }
2424
gel-derive = { path = "../gel-derive" }
25-
test-utils = { git = "https://github.com/edgedb/test-utils.git" }
25+
gel-captive = { path = "../gel-captive" }
2626

2727
[features]
2828
unstable = []

tests/functional/src/server.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#![allow(dead_code)]
22
use dtor::dtor;
3+
use gel_captive::ServerProcess;
34
use gel_tokio::{Builder, Config};
45
use std::sync::atomic::{AtomicBool, Ordering};
5-
use std::sync::LazyLock;
6+
use std::sync::{LazyLock, Mutex};
67
use std::{path::PathBuf, str::FromStr};
7-
use test_utils::server::ServerInstance;
88

99
pub struct ServerGuard {
10-
instance: ServerInstance,
10+
instance: Mutex<Option<ServerProcess>>,
1111
pub config: Config,
1212
}
1313

@@ -20,7 +20,9 @@ unsafe fn stop_server() {
2020
.compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst)
2121
.is_ok()
2222
{
23-
SERVER.instance.stop()
23+
let mut lock = SERVER.instance.lock().unwrap();
24+
let instance = lock.take();
25+
drop(instance); // this stops the server
2426
}
2527
}
2628

@@ -36,7 +38,7 @@ fn start_server() -> ServerGuard {
3638
panic!("Server already started");
3739
}
3840

39-
let instance = ServerInstance::start();
41+
let instance = gel_captive::ServerBuilder::new().start();
4042

4143
let schema_dir = PathBuf::from_str(env!("CARGO_MANIFEST_DIR"))
4244
.unwrap()
@@ -54,5 +56,6 @@ fn start_server() -> ServerGuard {
5456
.without_system()
5557
.build()
5658
.unwrap();
59+
let instance = Mutex::new(Some(instance));
5760
ServerGuard { instance, config }
5861
}

0 commit comments

Comments
 (0)