Skip to content

Add reqwest client to integration test #2523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Loading