From 2d3962fb97ee4c8a5d09d2a2074b295d1ad9f0e5 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Wed, 13 Oct 2021 14:49:39 +0400 Subject: [PATCH] fix images for arm and windows --- .../src/handler/tests/handler_integration.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webhook/src/handler/tests/handler_integration.rs b/webhook/src/handler/tests/handler_integration.rs index 6aee0bd..a2ec403 100644 --- a/webhook/src/handler/tests/handler_integration.rs +++ b/webhook/src/handler/tests/handler_integration.rs @@ -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(); -- 2.39.5