summaryrefslogtreecommitdiff
path: root/server/src/tests.rs
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-01-29 00:34:30 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-01-29 00:34:30 +0100
commit05b674190f26e2a58cc7b7288586c031552d50f3 (patch)
tree452035e852a7012061c9424a9dc0f56fcad129ee /server/src/tests.rs
parent145b93302cbb7cb090c90fd07ed4ebabf742e453 (diff)
Add git-server to docker-compose
To make a githook that can run on alpine images (using musl) they need to be cross-compiled. Then it became apparent that the githook binary was pulling in all the same dependencies as the server was. This is not good, but apparently also not something Rust/Cargo has figured out. RFC:s has been shutdown. workspace might be an option but then I probably need to also add a "code shared by both githook and server" library that both can link. Problem for another day.
Diffstat (limited to 'server/src/tests.rs')
-rw-r--r--server/src/tests.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/src/tests.rs b/server/src/tests.rs
index d59dcbe..1b42485 100644
--- a/server/src/tests.rs
+++ b/server/src/tests.rs
@@ -116,11 +116,20 @@ async fn async_client_with_private_database(test_name: String) -> Client {
};
let git_root = testdir!();
+ let git_hook = std::env::current_exe()
+ .unwrap()
+ .parent()
+ .unwrap()
+ .parent()
+ .unwrap()
+ .join("eyeballs-githook");
+
let authorized_keys = git_root.join("authorized_keys");
let figment = base_figment
.merge(("databases", map!["eyeballs" => db_config]))
.merge(("git_server_root", git_root))
+ .merge(("git_hook", git_hook))
.merge(("authorized_keys", authorized_keys));
Client::tracked(crate::rocket_from_config(figment))