ryerraguntla commented on code in PR #4730:
URL: https://github.com/apache/iggy/pull/4730#discussion_r4501524351


##########
core/integration/tests/connectors/fixtures/opensearch/container.rs:
##########
@@ -0,0 +1,368 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use integration::harness::TestBinaryError;
+use reqwest_middleware::ClientWithMiddleware as HttpClient;
+use reqwest_retry::RetryTransientMiddleware;
+use reqwest_retry::policies::ExponentialBackoff;
+use serde::Deserialize;
+use testcontainers_modules::testcontainers::core::wait::HttpWaitStrategy;
+use testcontainers_modules::testcontainers::core::{IntoContainerPort, WaitFor};
+use testcontainers_modules::testcontainers::runners::AsyncRunner;
+use testcontainers_modules::testcontainers::{
+    ContainerAsync, GenericImage, ImageExt, ReuseDirective,
+};
+use tracing::info;
+
+const OPENSEARCH_IMAGE: &str = "docker.io/opensearchproject/opensearch";
+const OPENSEARCH_TAG: &str = "2.19.1";
+const OPENSEARCH_PORT: u16 = 9200;
+const OPENSEARCH_HEALTH_ENDPOINT: &str = "/_cluster/health";
+// Fixed name + ReuseDirective::Always shares one container across nextest's
+// per-test processes. Isolation comes from a unique index per fixture (see
+// source.rs); index creation also drops any leftover index of the same name.
+const OPENSEARCH_CONTAINER_NAME: &str = "iggy-test-opensearch";
+
+pub const DEFAULT_TEST_STREAM: &str = "test_stream";
+pub const DEFAULT_TEST_TOPIC: &str = "test_topic";
+
+pub const ENV_SOURCE_URL: &str = 
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_URL";
+pub const ENV_SOURCE_INDEX: &str = 
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_INDEX";
+pub const ENV_SOURCE_POLLING_INTERVAL: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_POLLING_INTERVAL";
+pub const ENV_SOURCE_BATCH_SIZE: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_BATCH_SIZE";
+pub const ENV_SOURCE_TIMESTAMP_FIELD: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_TIMESTAMP_FIELD";
+pub const ENV_SOURCE_STREAMS_0_STREAM: &str = 
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_STREAMS_0_STREAM";
+pub const ENV_SOURCE_STREAMS_0_TOPIC: &str = 
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_STREAMS_0_TOPIC";
+pub const ENV_SOURCE_STREAMS_0_SCHEMA: &str = 
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_STREAMS_0_SCHEMA";
+pub const ENV_SOURCE_PATH: &str = "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PATH";
+pub const ENV_SOURCE_MAX_RETRIES: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_MAX_RETRIES";
+pub const ENV_SOURCE_RETRY_DELAY: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_RETRY_DELAY";
+pub const ENV_SOURCE_RETRY_MAX_DELAY: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_RETRY_MAX_DELAY";
+pub const ENV_SOURCE_MAX_OPEN_RETRIES: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_MAX_OPEN_RETRIES";
+pub const ENV_SOURCE_OPEN_RETRY_MAX_DELAY: &str =
+    "IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_OPEN_RETRY_MAX_DELAY";
+pub const ENV_SOURCE_CIRCUIT_BREAKER_THRESHOLD: &str =
+    
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_CIRCUIT_BREAKER_THRESHOLD";
+pub const ENV_SOURCE_CIRCUIT_BREAKER_COOL_DOWN: &str =
+    
"IGGY_CONNECTORS_SOURCE_OPENSEARCH_PLUGIN_CONFIG_CIRCUIT_BREAKER_COOL_DOWN";
+
+pub struct OpenSearchContainer {
+    _container: ContainerAsync<GenericImage>,
+    pub base_url: String,
+}
+
+impl OpenSearchContainer {
+    pub async fn start() -> Result<Self, TestBinaryError> {

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to