Skip to content

Commit 68af3bb

Browse files
authored
Add reqwest client to integration test (open-telemetry#2523)
1 parent dace0ca commit 68af3bb

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

opentelemetry-otlp/tests/integration_test/tests/logs.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,21 @@ mod logtests {
124124
}
125125

126126
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
127-
#[cfg(any(feature = "tonic-client"))]
127+
#[cfg(any(feature = "tonic-client", feature = "reqwest-client"))]
128128
pub async fn logs_simple_tokio_multi_thread() -> Result<()> {
129129
logs_simple_tokio_helper().await
130130
}
131131

132132
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
133-
#[cfg(any(feature = "tonic-client"))]
133+
#[cfg(any(feature = "tonic-client", feature = "reqwest-client"))]
134134
pub async fn logs_simple_tokio_multi_with_one_worker() -> Result<()> {
135135
logs_simple_tokio_helper().await
136136
}
137137

138138
// Ignored, to be investigated
139139
#[ignore]
140140
#[tokio::test(flavor = "current_thread")]
141-
#[cfg(any(feature = "tonic-client"))]
141+
#[cfg(any(feature = "tonic-client", feature = "reqwest-client"))]
142142
pub async fn logs_simple_tokio_current() -> Result<()> {
143143
logs_simple_tokio_helper().await
144144
}
@@ -155,9 +155,7 @@ mod logtests {
155155
let expected_uuid = Uuid::new_v4().to_string();
156156
{
157157
let _guard = tracing::subscriber::set_default(subscriber);
158-
info!("Tracing subscriber initialized");
159158
info!(target: "my-target", uuid = expected_uuid, "hello from {}. My price is {}.", "banana", 2.99);
160-
info!("Log emitted");
161159
}
162160

163161
let _ = logger_provider.shutdown();

opentelemetry-otlp/tests/integration_test/tests/metrics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ pub fn validate_metrics_against_results(scope_name: &str) -> Result<()> {
189189
/// TODO - fix this asynchronously.
190190
///
191191
#[cfg(test)]
192-
#[cfg(not(feature = "hyper-client"))]
193-
#[cfg(not(feature = "reqwest-client"))]
192+
#[cfg(any(feature = "tonic-client", feature = "reqwest-blocking-client"))]
194193
mod metrictests {
195194

196195
use super::*;

opentelemetry-otlp/tests/integration_test/tests/traces.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const LEMONS_KEY: Key = Key::from_static_str("lemons");
4848
const ANOTHER_KEY: Key = Key::from_static_str("ex.com/another");
4949

5050
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
51+
#[cfg(any(feature = "tonic-client", feature = "reqwest-blocking-client"))]
5152
pub async fn traces() -> Result<()> {
5253
test_utils::start_collector_container().await?;
5354

scripts/integration_tests.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ if [ -d "$TEST_DIR" ]; then
1616
# Run tests with the reqwest-client feature
1717
echo
1818
echo ####
19-
echo "Integration Tests: Reqwest Client (Disabled now)"
19+
echo "Integration Tests: Reqwest Client"
2020
echo ####
2121
echo
22-
# TODO: reqwest client is not supported with thread based processor and reader. Enable this test once it is supported.
23-
#cargo test --no-default-features --features "reqwest-client","internal-logs"
22+
cargo test --no-default-features --features "reqwest-client","internal-logs"
2423

2524
# Run tests with the reqwest-blocking-client feature
2625
echo

0 commit comments

Comments
 (0)