]> git.puffer.fish Git - matthieu/nova.git/commitdiff
fix images for arm and windows
authorMatthieu <matthieu@developershouse.xyz>
Wed, 13 Oct 2021 10:49:39 +0000 (14:49 +0400)
committerMatthieu <matthieu@developershouse.xyz>
Wed, 13 Oct 2021 10:49:39 +0000 (14:49 +0400)
webhook/src/handler/tests/handler_integration.rs

index 6aee0bd0bb277b6334c516e08be56993f88d73f5..a2ec403a29689f06b5c04e5ddac6b0009f1b7ac7 100644 (file)
@@ -15,12 +15,27 @@ use hyper::{Body, Method, Request};
 use lazy_static::{__Deref, lazy_static};
 use serde_json::json;
 
+#[cfg(all(unix, target_arch = "x86_64"))]
+const fn nats_image<'a>() -> &'a str {
+    return "amd64/nats";
+}
+
+#[cfg(all(unix, target_arch = "aarch64"))]
+const fn nats_image<'a>() -> &'a str {
+    return "arm64v8/nats";
+}
+
+#[cfg(all(target_arch = "x86_64", target_os = "windows"))]
+const fn nats_image<'a>() -> &'a str {
+    return "winamd64/nats";
+}
+
 lazy_static! {
     static ref DOCKER: Cli = Cli::default();
 
     static ref NATS_CONTAINER: Container<'static, Cli, GenericImage> = {
         test_init();
-        let image: GenericImage = GenericImage::new("nats");
+        let image: GenericImage = GenericImage::new(nats_image());
         let container = DOCKER.run(image);
         container.start();
         container.get_host_port(4222).unwrap();