@@ -13,7 +13,7 @@ use influxdb::{Client, Error, Query, Timestamp};
13
13
///
14
14
/// This test case tests whether the InfluxDB server can be connected to and gathers info about it - tested with async_std
15
15
#[ async_std:: test]
16
- #[ cfg( not( tarpaulin_include) ) ]
16
+ #[ cfg( not( any ( tarpaulin_include, feature = "reqwest" ) ) ) ]
17
17
async fn test_ping_influx_db_async_std ( ) {
18
18
let client = create_client ( "notusedhere" ) ;
19
19
let result = client. ping ( ) . await ;
@@ -29,7 +29,8 @@ async fn test_ping_influx_db_async_std() {
29
29
/// INTEGRATION TEST
30
30
///
31
31
/// This test case tests whether the InfluxDB server can be connected to and gathers info about it * tested with tokio
32
- #[ tokio:: test]
32
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
33
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
33
34
#[ cfg( not( tarpaulin_include) ) ]
34
35
async fn test_ping_influx_db_tokio ( ) {
35
36
let client = create_client ( "notusedhere" ) ;
@@ -46,7 +47,8 @@ async fn test_ping_influx_db_tokio() {
46
47
/// INTEGRATION TEST
47
48
///
48
49
/// This test case tests connection error
49
- #[ async_std:: test]
50
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
51
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
50
52
#[ cfg( not( tarpaulin_include) ) ]
51
53
async fn test_connection_error ( ) {
52
54
let test_name = "test_connection_error" ;
@@ -67,7 +69,8 @@ async fn test_connection_error() {
67
69
/// INTEGRATION TEST
68
70
///
69
71
/// This test case tests the Authentication
70
- #[ async_std:: test]
72
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
73
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
71
74
#[ cfg( not( tarpaulin_include) ) ]
72
75
async fn test_authed_write_and_read ( ) {
73
76
const TEST_NAME : & str = "test_authed_write_and_read" ;
@@ -115,7 +118,8 @@ async fn test_authed_write_and_read() {
115
118
/// INTEGRATION TEST
116
119
///
117
120
/// This test case tests the Authentication
118
- #[ async_std:: test]
121
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
122
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
119
123
#[ cfg( not( tarpaulin_include) ) ]
120
124
async fn test_wrong_authed_write_and_read ( ) {
121
125
const TEST_NAME : & str = "test_wrong_authed_write_and_read" ;
@@ -185,7 +189,8 @@ async fn test_wrong_authed_write_and_read() {
185
189
/// INTEGRATION TEST
186
190
///
187
191
/// This test case tests the Authentication
188
- #[ async_std:: test]
192
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
193
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
189
194
#[ cfg( not( tarpaulin_include) ) ]
190
195
async fn test_non_authed_write_and_read ( ) {
191
196
const TEST_NAME : & str = "test_non_authed_write_and_read" ;
@@ -240,7 +245,8 @@ async fn test_non_authed_write_and_read() {
240
245
/// INTEGRATION TEST
241
246
///
242
247
/// This integration tests that writing data and retrieving the data again is working
243
- #[ async_std:: test]
248
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
249
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
244
250
#[ cfg( not( tarpaulin_include) ) ]
245
251
async fn test_write_and_read_field ( ) {
246
252
const TEST_NAME : & str = "test_write_field" ;
@@ -273,7 +279,8 @@ async fn test_write_and_read_field() {
273
279
/// INTEGRATION TEST
274
280
///
275
281
/// This integration tests that writing data and retrieving the data again is working
276
- #[ async_std:: test]
282
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
283
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
277
284
#[ cfg( feature = "use-serde" ) ]
278
285
#[ cfg( not( tarpaulin_include) ) ]
279
286
async fn test_write_and_read_option ( ) {
@@ -335,7 +342,8 @@ async fn test_write_and_read_option() {
335
342
///
336
343
/// This test case tests whether JSON can be decoded from a InfluxDB response and whether that JSON
337
344
/// is equal to the data which was written to the database
338
- #[ async_std:: test]
345
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
346
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
339
347
#[ cfg( feature = "use-serde" ) ]
340
348
#[ cfg( not( tarpaulin_include) ) ]
341
349
async fn test_json_query ( ) {
@@ -386,8 +394,9 @@ async fn test_json_query() {
386
394
/// INTEGRATION TEST
387
395
///
388
396
/// This test case tests whether the response to a GROUP BY can be parsed by
389
- // deserialize_next_tagged into a tags struct
390
- #[ async_std:: test]
397
+ /// deserialize_next_tagged into a tags struct
398
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
399
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
391
400
#[ cfg( feature = "use-serde" ) ]
392
401
#[ cfg( not( tarpaulin_include) ) ]
393
402
async fn test_json_query_tagged ( ) {
@@ -451,8 +460,8 @@ async fn test_json_query_tagged() {
451
460
///
452
461
/// This test case tests whether JSON can be decoded from a InfluxDB response and wether that JSON
453
462
/// is equal to the data which was written to the database
454
- /// (tested with tokio)
455
- #[ tokio:: test]
463
+ # [ cfg_attr ( feature = "surf" , tokio02 :: test ) ]
464
+ #[ cfg_attr ( feature = "reqwest" , tokio:: test) ]
456
465
#[ cfg( feature = "use-serde" ) ]
457
466
#[ cfg( not( tarpaulin_include) ) ]
458
467
async fn test_json_query_vec ( ) {
@@ -503,7 +512,8 @@ async fn test_json_query_vec() {
503
512
/// INTEGRATION TEST
504
513
///
505
514
/// This integration test tests whether using the wrong query method fails building the query
506
- #[ async_std:: test]
515
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
516
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
507
517
#[ cfg( feature = "use-serde" ) ]
508
518
#[ cfg( not( tarpaulin_include) ) ]
509
519
async fn test_serde_multi_query ( ) {
@@ -580,7 +590,8 @@ async fn test_serde_multi_query() {
580
590
/// INTEGRATION TEST
581
591
///
582
592
/// This integration test tests whether using the wrong query method fails building the query
583
- #[ async_std:: test]
593
+ #[ cfg_attr( feature = "surf" , tokio02:: test) ]
594
+ #[ cfg_attr( feature = "reqwest" , tokio:: test) ]
584
595
#[ cfg( feature = "use-serde" ) ]
585
596
#[ cfg( not( tarpaulin_include) ) ]
586
597
async fn test_wrong_query_errors ( ) {
0 commit comments