Hopefully improve coverage
@@ -52,14 +52,26 @@ async fn no_connection() -> Result<()> {
#[serial(gpubsub)]
async fn no_token() -> Result<()> {
let _ = env_logger::try_init();
+
+ let runner = Cli::docker();
+
+ let (pubsub, pubsub_args) =
+ testcontainers::images::google_cloud_sdk_emulators::CloudSdk::pubsub();
+ let runnable_image = RunnableImage::from((pubsub, pubsub_args));
+ let container = runner.run(runnable_image);
+
+ let port =
+ container.get_host_port(testcontainers::images::google_cloud_sdk_emulators::PUBSUB_PORT);
+ let endpoint = format!("http://localhost:{}", port);
+
let mut env = EnvHelper::new();
env.remove_var("GOOGLE_APPLICATION_CREDENTIALS");
let connector_yaml = literal!({
"codec": "binary",
"config":{
- "endpoint": "https://localhost:9090",
- "connect_timeout": 100000000,
- "topic": "projects/xxx/topics/test-a",
+ "endpoint": endpoint,
+ "connect_timeout": 30000000000u64,
+ "topic": "projects/test/topics/test",
"skip_authentication": false
}
});
@@ -91,7 +103,6 @@ async fn simple_publish() -> Result<()> {
"codec": "binary",
"config":{
"endpoint": endpoint,
- "ack_deadline": 30000000000u64,
"connect_timeout": 30000000000u64,
"topic": "projects/test/topics/test",
"skip_authentication": true
