@@ -1131,6 +1131,7 @@ mod tests {
11311131 use opentelemetry_http:: { Bytes , HttpClient } ;
11321132 use std:: io:: Read ;
11331133
1134+ #[ cfg( feature = "http-proto" ) ]
11341135 #[ test]
11351136 fn test_gzip_compression_and_decompression ( ) {
11361137 let client = OtlpHttpClient :: new (
@@ -1163,7 +1164,7 @@ mod tests {
11631164 assert_ne ! ( compressed_body, test_data. to_vec( ) ) ;
11641165 }
11651166
1166- #[ cfg( feature = "zstd-http" ) ]
1167+ #[ cfg( all ( feature = "http-proto" , feature = " zstd-http") ) ]
11671168 #[ test]
11681169 fn test_zstd_compression_and_decompression ( ) {
11691170 let client = OtlpHttpClient :: new (
@@ -1194,6 +1195,7 @@ mod tests {
11941195 assert_ne ! ( compressed_body, test_data. to_vec( ) ) ;
11951196 }
11961197
1198+ #[ cfg( feature = "http-proto" ) ]
11971199 #[ test]
11981200 fn test_no_compression_when_disabled ( ) {
11991201 let client = OtlpHttpClient :: new (
@@ -1216,7 +1218,7 @@ mod tests {
12161218 assert_eq ! ( content_encoding, None ) ;
12171219 }
12181220
1219- #[ cfg( not( feature = "gzip-http" ) ) ]
1221+ #[ cfg( all ( feature = "http-proto" , not( feature = "gzip-http" ) ) ) ]
12201222 #[ test]
12211223 fn test_gzip_error_when_feature_disabled ( ) {
12221224 let client = OtlpHttpClient :: new (
@@ -1240,7 +1242,7 @@ mod tests {
12401242 . contains( "gzip-http feature not enabled" ) ) ;
12411243 }
12421244
1243- #[ cfg( not( feature = "zstd-http" ) ) ]
1245+ #[ cfg( all ( feature = "http-proto" , not( feature = "zstd-http" ) ) ) ]
12441246 #[ test]
12451247 fn test_zstd_error_when_feature_disabled ( ) {
12461248 let client = OtlpHttpClient :: new (
@@ -1352,7 +1354,7 @@ mod tests {
13521354 }
13531355 }
13541356
1355- #[ cfg( feature = "trace" ) ]
1357+ #[ cfg( all ( feature = "trace" , feature = "http-proto" ) ) ]
13561358 #[ test]
13571359 fn test_build_trace_export_body_binary_protocol ( ) {
13581360 let client = create_test_client ( crate :: Protocol :: HttpBinary , None ) ;
@@ -1378,7 +1380,7 @@ mod tests {
13781380 assert_eq ! ( content_encoding, None ) ;
13791381 }
13801382
1381- #[ cfg( all( feature = "trace" , feature = "gzip-http" ) ) ]
1383+ #[ cfg( all( feature = "http-proto" , feature = " trace", feature = "gzip-http" ) ) ]
13821384 #[ test]
13831385 fn test_build_trace_export_body_with_compression ( ) {
13841386 let client =
@@ -1400,7 +1402,7 @@ mod tests {
14001402 LogBatch :: new ( & [ ] )
14011403 }
14021404
1403- #[ cfg( feature = "logs" ) ]
1405+ #[ cfg( all ( feature = "http-proto" , feature = " logs") ) ]
14041406 #[ test]
14051407 fn test_build_logs_export_body_binary_protocol ( ) {
14061408 let client = create_test_client ( crate :: Protocol :: HttpBinary , None ) ;
@@ -1426,7 +1428,7 @@ mod tests {
14261428 assert_eq ! ( content_encoding, None ) ;
14271429 }
14281430
1429- #[ cfg( all( feature = "logs" , feature = "gzip-http" ) ) ]
1431+ #[ cfg( all( feature = "http-proto" , feature = " logs", feature = "gzip-http" ) ) ]
14301432 #[ test]
14311433 fn test_build_logs_export_body_with_compression ( ) {
14321434 let client =
@@ -1440,7 +1442,7 @@ mod tests {
14401442 assert_eq ! ( content_encoding, Some ( "gzip" ) ) ;
14411443 }
14421444
1443- #[ cfg( feature = "metrics" ) ]
1445+ #[ cfg( all ( feature = "http-proto" , feature = " metrics") ) ]
14441446 #[ test]
14451447 fn test_build_metrics_export_body_binary_protocol ( ) {
14461448 use opentelemetry_sdk:: metrics:: data:: ResourceMetrics ;
@@ -1470,7 +1472,7 @@ mod tests {
14701472 assert_eq ! ( content_encoding, None ) ;
14711473 }
14721474
1473- #[ cfg( all( feature = "metrics" , feature = "gzip-http" ) ) ]
1475+ #[ cfg( all( feature = "http-proto" , feature = " metrics", feature = "gzip-http" ) ) ]
14741476 #[ test]
14751477 fn test_build_metrics_export_body_with_compression ( ) {
14761478 use opentelemetry_sdk:: metrics:: data:: ResourceMetrics ;
@@ -1486,7 +1488,11 @@ mod tests {
14861488 assert_eq ! ( content_encoding, Some ( "gzip" ) ) ;
14871489 }
14881490
1489- #[ cfg( all( feature = "metrics" , not( feature = "gzip-http" ) ) ) ]
1491+ #[ cfg( all(
1492+ feature = "http-proto" ,
1493+ feature = "metrics" ,
1494+ not( feature = "gzip-http" )
1495+ ) ) ]
14901496 #[ test]
14911497 fn test_build_metrics_export_body_compression_error_returns_none ( ) {
14921498 use opentelemetry_sdk:: metrics:: data:: ResourceMetrics ;
@@ -1574,7 +1580,7 @@ mod tests {
15741580 assert_eq ! ( retry_policy. jitter_ms, 50 ) ;
15751581 }
15761582
1577- #[ cfg( feature = "experimental-http-retry" ) ]
1583+ #[ cfg( all ( feature = "http-proto" , feature = " experimental-http-retry") ) ]
15781584 #[ test]
15791585 fn test_default_retry_policy_when_none_configured ( ) {
15801586 let client = create_test_client ( crate :: Protocol :: HttpBinary , None ) ;
@@ -1586,7 +1592,7 @@ mod tests {
15861592 assert_eq ! ( client. retry_policy. jitter_ms, 100 ) ;
15871593 }
15881594
1589- #[ cfg( feature = "experimental-http-retry" ) ]
1595+ #[ cfg( all ( feature = "http-proto" , feature = " experimental-http-retry") ) ]
15901596 #[ test]
15911597 fn test_custom_retry_policy_used ( ) {
15921598 use crate :: retry:: RetryPolicy ;
0 commit comments