Skip to content

Commit

Permalink
Add reqwest client to integration test (#2523)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Jan 17, 2025
1 parent dace0ca commit 68af3bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
8 changes: 3 additions & 5 deletions opentelemetry-otlp/tests/integration_test/tests/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ mod logtests {
}

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

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

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

let _ = logger_provider.shutdown();
Expand Down
3 changes: 1 addition & 2 deletions opentelemetry-otlp/tests/integration_test/tests/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ pub fn validate_metrics_against_results(scope_name: &str) -> Result<()> {
/// TODO - fix this asynchronously.
///
#[cfg(test)]
#[cfg(not(feature = "hyper-client"))]
#[cfg(not(feature = "reqwest-client"))]
#[cfg(any(feature = "tonic-client", feature = "reqwest-blocking-client"))]
mod metrictests {

use super::*;
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-otlp/tests/integration_test/tests/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const LEMONS_KEY: Key = Key::from_static_str("lemons");
const ANOTHER_KEY: Key = Key::from_static_str("ex.com/another");

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

Expand Down
5 changes: 2 additions & 3 deletions scripts/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ if [ -d "$TEST_DIR" ]; then
# Run tests with the reqwest-client feature
echo
echo ####
echo "Integration Tests: Reqwest Client (Disabled now)"
echo "Integration Tests: Reqwest Client"
echo ####
echo
# TODO: reqwest client is not supported with thread based processor and reader. Enable this test once it is supported.
#cargo test --no-default-features --features "reqwest-client","internal-logs"
cargo test --no-default-features --features "reqwest-client","internal-logs"

# Run tests with the reqwest-blocking-client feature
echo
Expand Down

0 comments on commit 68af3bb

Please sign in to comment.