From 17ed5dd14d36d61008c441196e9c0418a5aa7929 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Tue, 9 Apr 2024 10:59:50 -0400 Subject: [PATCH 01/13] feat: add spanner REST API port --- src/google_cloud_sdk_emulators/mod.rs | 38 +++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index e0d6d1ab..281069fe 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -8,12 +8,14 @@ pub const BIGTABLE_PORT: u16 = 8086; pub const DATASTORE_PORT: u16 = 8081; pub const FIRESTORE_PORT: u16 = 8080; pub const PUBSUB_PORT: u16 = 8085; -pub const SPANNER_PORT: u16 = 9010; +pub const SPANNER_GRPC_PORT: u16 = 9010; +pub const SPANNER_REST_PORT: u16 = 9020; #[derive(Debug, Clone)] pub struct CloudSdkArgs { pub host: String, pub port: u16, + pub rest_port: Option, pub emulator: Emulator, } @@ -49,13 +51,18 @@ impl ImageArgs for CloudSdkArgs { args.push("--host-port".to_owned()); args.push(format!("{}:{}", self.host, self.port)); + if let Some(rest_port) = self.rest_port { + args.push("--rest-port".to_owned()); + args.push(rest_port.to_string()); + } + Box::new(args.into_iter()) } } #[derive(Debug)] pub struct CloudSdk { - exposed_port: u16, + exposed_ports: Vec, ready_condition: WaitFor, } @@ -75,21 +82,29 @@ impl Image for CloudSdk { } fn expose_ports(&self) -> Vec { - vec![self.exposed_port] + self.exposed_ports.clone() } } impl CloudSdk { - fn new(port: u16, emulator: Emulator, ready_condition: WaitFor) -> (Self, CloudSdkArgs) { + fn new( + port: u16, + rest_port: Option, + emulator: Emulator, + ready_condition: WaitFor, + ) -> (Self, CloudSdkArgs) { let arguments = CloudSdkArgs { host: HOST.to_owned(), port, + rest_port, emulator, }; - let exposed_port = port; + let mut exposed_ports = vec![port]; + exposed_ports.extend(rest_port); + ( Self { - exposed_port, + exposed_ports, ready_condition, }, arguments, @@ -99,6 +114,7 @@ impl CloudSdk { pub fn bigtable() -> (Self, CloudSdkArgs) { Self::new( BIGTABLE_PORT, + None, Emulator::Bigtable, WaitFor::message_on_stderr("[bigtable] Cloud Bigtable emulator running on"), ) @@ -107,6 +123,7 @@ impl CloudSdk { pub fn firestore() -> (Self, CloudSdkArgs) { Self::new( FIRESTORE_PORT, + None, Emulator::Firestore, WaitFor::message_on_stderr("[firestore] Dev App Server is now running"), ) @@ -116,6 +133,7 @@ impl CloudSdk { let project = project.into(); Self::new( DATASTORE_PORT, + None, Emulator::Datastore { project }, WaitFor::message_on_stderr("[datastore] Dev App Server is now running"), ) @@ -124,6 +142,7 @@ impl CloudSdk { pub fn pubsub() -> (Self, CloudSdkArgs) { Self::new( PUBSUB_PORT, + None, Emulator::PubSub, WaitFor::message_on_stderr("[pubsub] INFO: Server started, listening on"), ) @@ -131,7 +150,8 @@ impl CloudSdk { pub fn spanner() -> (Self, CloudSdkArgs) { Self::new( - SPANNER_PORT, // gRPC port + SPANNER_GRPC_PORT, + Some(SPANNER_REST_PORT), Emulator::Spanner, WaitFor::message_on_stderr("Cloud Spanner emulator running"), ) @@ -190,6 +210,8 @@ mod tests { let docker = clients::Cli::default(); let node = docker.run(google_cloud_sdk_emulators::CloudSdk::spanner()); assert!(RANDOM_PORTS - .contains(&node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_PORT))); + .contains(&node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_GRPC_PORT))); + assert!(RANDOM_PORTS + .contains(&node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT))); } } From 53c937cd0a5850eb652c8fd83c33d5a890498fc4 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Tue, 9 Apr 2024 11:05:26 -0400 Subject: [PATCH 02/13] feat: bump google-cloud-sdk --- src/google_cloud_sdk_emulators/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 281069fe..bf7298f8 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -1,7 +1,7 @@ use testcontainers::{core::WaitFor, Image, ImageArgs}; -const NAME: &str = "google/cloud-sdk"; -const TAG: &str = "362.0.0-emulators"; +const NAME: &str = "gcr.io/google.com/cloudsdktool/google-cloud-cli"; +const TAG: &str = "471.0.0-emulators"; const HOST: &str = "0.0.0.0"; pub const BIGTABLE_PORT: u16 = 8086; From 67590db5c0beb7216bebe0f202a73e61f297be00 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Tue, 9 Apr 2024 12:16:30 -0400 Subject: [PATCH 03/13] Revert "feat: bump google-cloud-sdk" This reverts commit 53c937cd0a5850eb652c8fd83c33d5a890498fc4. --- src/google_cloud_sdk_emulators/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index bf7298f8..281069fe 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -1,7 +1,7 @@ use testcontainers::{core::WaitFor, Image, ImageArgs}; -const NAME: &str = "gcr.io/google.com/cloudsdktool/google-cloud-cli"; -const TAG: &str = "471.0.0-emulators"; +const NAME: &str = "google/cloud-sdk"; +const TAG: &str = "362.0.0-emulators"; const HOST: &str = "0.0.0.0"; pub const BIGTABLE_PORT: u16 = 8086; From 0f635ab83f0de44d6e8bd72b819488cb9eb589d1 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Tue, 9 Apr 2024 12:19:30 -0400 Subject: [PATCH 04/13] fix: mark SPANNER_PORT as deprecated instead of removing --- src/google_cloud_sdk_emulators/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 281069fe..4ac2961b 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -8,6 +8,8 @@ pub const BIGTABLE_PORT: u16 = 8086; pub const DATASTORE_PORT: u16 = 8081; pub const FIRESTORE_PORT: u16 = 8080; pub const PUBSUB_PORT: u16 = 8085; +#[deprecated(since = "0.3.8", note = "please use `SPANNER_GRPC_PORT` instead")] +pub const SPANNER_PORT: u16 = SPANNER_GRPC_PORT; pub const SPANNER_GRPC_PORT: u16 = 9010; pub const SPANNER_REST_PORT: u16 = 9020; From 73ab5dbd8bbb33e709f0b4cb5cffa5534a5e8026 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Tue, 9 Apr 2024 12:43:56 -0400 Subject: [PATCH 05/13] docs: add some documentation to google sdk module --- src/google_cloud_sdk_emulators/mod.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 4ac2961b..85253ff2 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -1,3 +1,25 @@ +/// Module to work with [`Google Cloud Emulators`] inside of tests. +/// +/// The same image can be used to run multiple emulators, using the `emulator` argument allows +/// selecting the one to run. +/// +/// This module is based on the official [`GCloud SDK image`]. +/// +/// # Example +/// ``` +/// use testcontainers::clients; +/// use testcontainers_modules::google_cloud_sdk_emulators; +/// +/// let docker = clients::Cli::default(); +/// let container = docker.run(google_cloud_sdk_emulators::CloudSdk::spanner()); +/// +/// let spanner_host = format!("localhost:{}", container.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT)); +/// +/// // do something with the started spanner instance. +/// ``` +/// +/// [`Google Cloud Emulators`]: https://cloud.google.com/sdk/gcloud/reference/beta/emulators +/// [`GCloud SDK image`]: https://cloud.google.com/sdk/docs/downloads-docker use testcontainers::{core::WaitFor, Image, ImageArgs}; const NAME: &str = "google/cloud-sdk"; From 1b7e5e479332a0dc2ce18591a958420e86371018 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 11:30:10 -0400 Subject: [PATCH 06/13] chore: adjustments after merge --- src/google_cloud_sdk_emulators/mod.rs | 71 ++++++++++++++++----------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index c04a49ca..874a62e3 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -1,26 +1,5 @@ use std::borrow::Cow; -/// Module to work with [`Google Cloud Emulators`] inside of tests. -/// -/// The same image can be used to run multiple emulators, using the `emulator` argument allows -/// selecting the one to run. -/// -/// This module is based on the official [`GCloud SDK image`]. -/// -/// # Example -/// ``` -/// use testcontainers::clients; -/// use testcontainers_modules::google_cloud_sdk_emulators; -/// -/// let docker = clients::Cli::default(); -/// let container = docker.run(google_cloud_sdk_emulators::CloudSdk::spanner()); -/// -/// let spanner_host = format!("localhost:{}", container.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT)); -/// -/// // do something with the started spanner instance. -/// ``` -/// -/// [`Google Cloud Emulators`]: https://cloud.google.com/sdk/gcloud/reference/beta/emulators -/// [`GCloud SDK image`]: https://cloud.google.com/sdk/docs/downloads-docker + use testcontainers::{ core::{ContainerPort, WaitFor}, Image, @@ -56,7 +35,15 @@ pub const PUBSUB_PORT: u16 = 8085; /// [`Spanner`]: https://cloud.google.com/spanner #[deprecated(since = "0.3.8", note = "please use `SPANNER_GRPC_PORT` instead")] pub const SPANNER_PORT: u16 = SPANNER_GRPC_PORT; +/// Port that the [`Spanner`] emulator container has internally (gRPC) +/// Can be rebound externally via [`testcontainers::core::ImageExt::with_mapped_port`] +/// +/// [`Spanner`]: https://cloud.google.com/spanner pub const SPANNER_GRPC_PORT: u16 = 9010; +/// Port that the [`Spanner`] emulator container has internally (REST) +/// Can be rebound externally via [`testcontainers::core::ImageExt::with_mapped_port`] +/// +/// [`Spanner`]: https://cloud.google.com/spanner pub const SPANNER_REST_PORT: u16 = 9020; #[allow(missing_docs)] @@ -115,9 +102,28 @@ impl IntoIterator for &CloudSdkCmd { } } -#[allow(missing_docs)] -// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously -#[derive(Debug, Clone)] +/// Module to work with [`Google Cloud Emulators`] inside of tests. +/// +/// The same image can be used to run multiple emulators, using the `emulator` argument allows +/// selecting the one to run. +/// +/// This module is based on the official [`GCloud SDK image`]. +/// +/// # Example +/// ``` +/// use testcontainers::runners::SyncRunner; +/// use testcontainers_modules::google_cloud_sdk_emulators; +/// +/// let container = google_cloud_sdk_emulators::CloudSdk::spanner().start().unwrap(); +/// let port = container.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT).unwrap(); +/// +/// let spanner_host = format!("localhost:{port}"); +/// +/// // do something with the started spanner instance. +/// ``` +/// +/// [`Google Cloud Emulators`]: https://cloud.google.com/sdk/gcloud/reference/beta/emulators +/// [`GCloud SDK image`]: https://cloud.google.com/sdk/docs/downloads-docker#[derive(Debug, Clone)] pub struct CloudSdk { exposed_ports: Vec, ready_condition: WaitFor, @@ -147,15 +153,22 @@ impl Image for CloudSdk { } impl CloudSdk { - fn new(port: u16, emulator: Emulator, ready_condition: WaitFor) -> Self { + fn new( + port: u16, + rest_port: Option, + emulator: Emulator, + ready_condition: WaitFor, + ) -> Self { let cmd = CloudSdkCmd { host: HOST.to_owned(), port, rest_port, emulator, }; + let mut exposed_ports = vec![ContainerPort::Tcp(port)]; + exposed_ports.extend(rest_port.map(ContainerPort::Tcp)); Self { - exposed_ports: vec![ContainerPort::Tcp(port)], + exposed_ports, ready_condition, cmd, } @@ -266,7 +279,9 @@ mod tests { fn spanner_emulator_expose_port() -> Result<(), Box> { let _ = pretty_env_logger::try_init(); let node = google_cloud_sdk_emulators::CloudSdk::spanner().start()?; - let port = node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_PORT)?; + let port = node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_GRPC_PORT)?; + assert!(RANDOM_PORTS.contains(&port), "Port {port} not found"); + let port = node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT)?; assert!(RANDOM_PORTS.contains(&port), "Port {port} not found"); Ok(()) } From f45e294bd4b1668533935bf66a64d3627a3c5592 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 11:37:22 -0400 Subject: [PATCH 07/13] fix: use arbitrary list of arguments --- src/google_cloud_sdk_emulators/mod.rs | 41 +++++++++++++-------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 874a62e3..908c6244 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -52,8 +52,8 @@ pub const SPANNER_REST_PORT: u16 = 9020; pub struct CloudSdkCmd { pub host: String, pub port: u16, - pub rest_port: Option, pub emulator: Emulator, + additional_args: Vec, } #[allow(missing_docs)] @@ -61,7 +61,7 @@ pub struct CloudSdkCmd { #[derive(Debug, Clone, Eq, PartialEq)] pub enum Emulator { Bigtable, - Datastore { project: String }, + Datastore, Firestore, PubSub, Spanner, @@ -72,12 +72,12 @@ impl IntoIterator for &CloudSdkCmd { type IntoIter = as IntoIterator>::IntoIter; fn into_iter(self) -> Self::IntoIter { - let (emulator, project) = match &self.emulator { - Emulator::Bigtable => ("bigtable", None), - Emulator::Datastore { project } => ("datastore", Some(project)), - Emulator::Firestore => ("firestore", None), - Emulator::PubSub => ("pubsub", None), - Emulator::Spanner => ("spanner", None), + let emulator = match self.emulator { + Emulator::Bigtable => "bigtable", + Emulator::Datastore => "datastore", + Emulator::Firestore => "firestore", + Emulator::PubSub => "pubsub", + Emulator::Spanner => "spanner", }; let mut args = vec![ "gcloud".to_owned(), @@ -86,17 +86,9 @@ impl IntoIterator for &CloudSdkCmd { emulator.to_owned(), "start".to_owned(), ]; - if let Some(project) = project { - args.push("--project".to_owned()); - args.push(project.to_owned()); - } args.push("--host-port".to_owned()); args.push(format!("{}:{}", self.host, self.port)); - - if let Some(rest_port) = self.rest_port { - args.push("--rest-port".to_owned()); - args.push(rest_port.to_string()); - } + args.extend(self.additional_args.iter().cloned()); args.into_iter() } @@ -155,18 +147,19 @@ impl Image for CloudSdk { impl CloudSdk { fn new( port: u16, - rest_port: Option, + additional_port: Option, + additional_args: Vec, emulator: Emulator, ready_condition: WaitFor, ) -> Self { let cmd = CloudSdkCmd { host: HOST.to_owned(), port, - rest_port, + additional_args, emulator, }; let mut exposed_ports = vec![ContainerPort::Tcp(port)]; - exposed_ports.extend(rest_port.map(ContainerPort::Tcp)); + exposed_ports.extend(additional_port.map(ContainerPort::Tcp)); Self { exposed_ports, ready_condition, @@ -180,6 +173,7 @@ impl CloudSdk { Self::new( BIGTABLE_PORT, None, + vec![], Emulator::Bigtable, WaitFor::message_on_stderr("[bigtable] Cloud Bigtable emulator running on"), ) @@ -191,6 +185,7 @@ impl CloudSdk { Self::new( FIRESTORE_PORT, None, + vec![], Emulator::Firestore, WaitFor::message_on_stderr("[firestore] Dev App Server is now running"), ) @@ -199,11 +194,11 @@ impl CloudSdk { // not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously #[allow(missing_docs)] pub fn datastore(project: impl Into) -> Self { - let project = project.into(); Self::new( DATASTORE_PORT, None, - Emulator::Datastore { project }, + vec!["--project".to_string(), project.into()], + Emulator::Datastore, WaitFor::message_on_stderr("[datastore] Dev App Server is now running"), ) } @@ -214,6 +209,7 @@ impl CloudSdk { Self::new( PUBSUB_PORT, None, + vec![], Emulator::PubSub, WaitFor::message_on_stderr("[pubsub] INFO: Server started, listening on"), ) @@ -225,6 +221,7 @@ impl CloudSdk { Self::new( SPANNER_GRPC_PORT, Some(SPANNER_REST_PORT), + vec!["--rest-port".to_string(), SPANNER_REST_PORT.to_string()], Emulator::Spanner, WaitFor::message_on_stderr("Cloud Spanner emulator running"), ) From 25787c00f36c317a2d996d59e3adf28fcf3e98fb Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 17:08:39 -0400 Subject: [PATCH 08/13] fix: make things module-private Turns out that these were `pub`, but impossible to use since `CloudSdk::new` was not also `pub`. So removing `pub` should have no consequence. --- src/google_cloud_sdk_emulators/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 908c6244..3d405c92 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -49,17 +49,17 @@ pub const SPANNER_REST_PORT: u16 = 9020; #[allow(missing_docs)] // not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously #[derive(Debug, Clone)] -pub struct CloudSdkCmd { - pub host: String, - pub port: u16, - pub emulator: Emulator, +struct CloudSdkCmd { + host: String, + port: u16, + emulator: Emulator, additional_args: Vec, } #[allow(missing_docs)] // not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously #[derive(Debug, Clone, Eq, PartialEq)] -pub enum Emulator { +enum Emulator { Bigtable, Datastore, Firestore, From 1fe1a80f6b638e1b7587b6f586bb3777420e72ca Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 17:11:14 -0400 Subject: [PATCH 09/13] fix: adjust deprecation version --- src/google_cloud_sdk_emulators/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index 3d405c92..c211d569 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -33,7 +33,7 @@ pub const PUBSUB_PORT: u16 = 8085; /// Can be rebound externally via [`testcontainers::core::ImageExt::with_mapped_port`] /// /// [`Spanner`]: https://cloud.google.com/spanner -#[deprecated(since = "0.3.8", note = "please use `SPANNER_GRPC_PORT` instead")] +#[deprecated(since = "0.13.0", note = "please use `SPANNER_GRPC_PORT` instead")] pub const SPANNER_PORT: u16 = SPANNER_GRPC_PORT; /// Port that the [`Spanner`] emulator container has internally (gRPC) /// Can be rebound externally via [`testcontainers::core::ImageExt::with_mapped_port`] From 406ac4293c0ea39f0a53d2f0583bd2ac2b0b6af9 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 17:27:14 -0400 Subject: [PATCH 10/13] test: add test asserting REST endpoint is available --- src/google_cloud_sdk_emulators/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index c211d569..ce94e98e 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -282,4 +282,20 @@ mod tests { assert!(RANDOM_PORTS.contains(&port), "Port {port} not found"); Ok(()) } + + #[test] + fn spanner_emulator_expose_rest() -> Result<(), Box> { + let _ = pretty_env_logger::try_init(); + let node = google_cloud_sdk_emulators::CloudSdk::spanner().start()?; + let port = node.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT)?; + let body = reqwest::blocking::Client::new() + .get(format!( + "http://localhost:{port}/v1/projects/test/instances" + )) + .send()? + .error_for_status()? + .text()?; + assert_eq!(body, "{}"); + Ok(()) + } } From 213d749a49c74fa54c9a473539de2ce5dbf1f4ee Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Fri, 25 Jul 2025 17:33:44 -0400 Subject: [PATCH 11/13] feat: bump `google/cloud-sdk` tag --- src/google_cloud_sdk_emulators/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index ce94e98e..b357dd3e 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -6,7 +6,7 @@ use testcontainers::{ }; const NAME: &str = "google/cloud-sdk"; -const TAG: &str = "362.0.0-emulators"; +const TAG: &str = "531.0.0-emulators"; const HOST: &str = "0.0.0.0"; /// Port that the [`Bigtable`] emulator container has internally From 60cd912ad744cf61950ce2e5f95074d1e5587b46 Mon Sep 17 00:00:00 2001 From: Philippe Laflamme Date: Sun, 27 Jul 2025 12:06:44 -0400 Subject: [PATCH 12/13] tidy: cargo fmt --- src/google_cloud_sdk_emulators/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index b357dd3e..a0b19100 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -106,8 +106,12 @@ impl IntoIterator for &CloudSdkCmd { /// use testcontainers::runners::SyncRunner; /// use testcontainers_modules::google_cloud_sdk_emulators; /// -/// let container = google_cloud_sdk_emulators::CloudSdk::spanner().start().unwrap(); -/// let port = container.get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT).unwrap(); +/// let container = google_cloud_sdk_emulators::CloudSdk::spanner() +/// .start() +/// .unwrap(); +/// let port = container +/// .get_host_port_ipv4(google_cloud_sdk_emulators::SPANNER_REST_PORT) +/// .unwrap(); /// /// let spanner_host = format!("localhost:{port}"); /// From fff33993b30070f3099d6410872d04798bd37d5e Mon Sep 17 00:00:00 2001 From: Philippe Laflamme <484152+plaflamme@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:39:42 -0400 Subject: [PATCH 13/13] docs: simplify documentation on non-`pub` Co-authored-by: Frank Elsinga --- src/google_cloud_sdk_emulators/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/google_cloud_sdk_emulators/mod.rs b/src/google_cloud_sdk_emulators/mod.rs index a0b19100..cdb79583 100644 --- a/src/google_cloud_sdk_emulators/mod.rs +++ b/src/google_cloud_sdk_emulators/mod.rs @@ -56,8 +56,7 @@ struct CloudSdkCmd { additional_args: Vec, } -#[allow(missing_docs)] -// not having docs here is currently allowed to address the missing docs problem one place at a time. Helping us by documenting just one of these places helps other devs tremendously +/// The emulator used by the sdk #[derive(Debug, Clone, Eq, PartialEq)] enum Emulator { Bigtable,