Skip to content

Commit dee5f9f

Browse files
authored
Run Miri everywhere (#269)
* Explicitly mark all tests where MIRI doesn't run * Update the github action to run miri on the entire library
1 parent b056a8e commit dee5f9f

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/env_verifier.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ mod tests {
299299
use super::{EnvVerifier, ServerlessEnvVerifier};
300300

301301
#[tokio::test]
302+
#[cfg_attr(miri, ignore)]
302303
async fn test_ensure_gcp_env_false_if_metadata_server_unreachable() {
303304
struct MockGoogleMetadataClient {}
304305
#[async_trait]
@@ -316,6 +317,7 @@ mod tests {
316317
}
317318

318319
#[tokio::test]
320+
#[cfg_attr(miri, ignore)]
319321
async fn test_ensure_gcp_env_false_if_no_server_in_response_headers() {
320322
struct MockGoogleMetadataClient {}
321323
#[async_trait]
@@ -336,6 +338,7 @@ mod tests {
336338
}
337339

338340
#[tokio::test]
341+
#[cfg_attr(miri, ignore)]
339342
async fn test_ensure_gcp_env_if_server_header_not_serverless() {
340343
struct MockGoogleMetadataClient {}
341344
#[async_trait]
@@ -357,6 +360,7 @@ mod tests {
357360
}
358361

359362
#[tokio::test]
363+
#[cfg_attr(miri, ignore)]
360364
async fn test_ensure_gcp_env_true_if_cloud_function_env() {
361365
struct MockGoogleMetadataClient {}
362366
#[async_trait]
@@ -395,6 +399,7 @@ mod tests {
395399
}
396400

397401
#[tokio::test]
402+
#[cfg_attr(miri, ignore)]
398403
async fn test_gcp_verify_environment_timeout_exceeded_gives_unknown_values() {
399404
let env_verifier = ServerlessEnvVerifier {};
400405
let res = env_verifier
@@ -428,6 +433,7 @@ mod tests {
428433
}
429434

430435
#[tokio::test]
436+
#[cfg_attr(miri, ignore)]
431437
async fn test_ensure_azure_env_windows_true() {
432438
struct MockAzureVerificationClient {}
433439
#[async_trait]
@@ -443,6 +449,7 @@ mod tests {
443449
}
444450

445451
#[tokio::test]
452+
#[cfg_attr(miri, ignore)]
446453
async fn test_ensure_azure_env_windows_false() {
447454
struct MockAzureVerificationClient {}
448455
#[async_trait]
@@ -465,6 +472,7 @@ mod tests {
465472
}
466473

467474
#[tokio::test]
475+
#[cfg_attr(miri, ignore)]
468476
async fn test_ensure_azure_env_linux_true() {
469477
struct MockAzureVerificationClient {}
470478
#[async_trait]
@@ -480,6 +488,7 @@ mod tests {
480488
}
481489

482490
#[tokio::test]
491+
#[cfg_attr(miri, ignore)]
483492
async fn test_ensure_azure_env_linux_false() {
484493
struct MockAzureVerificationClient {}
485494
#[async_trait]

src/http_utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ mod tests {
100100
}
101101

102102
#[tokio::test]
103+
#[cfg_attr(miri, ignore)]
103104
async fn test_request_content_length_missing() {
104105
let verify_result = verify_request_content_length(&HeaderMap::new(), 1, "Test Prefix");
105106
assert!(verify_result.is_some());
@@ -113,6 +114,7 @@ mod tests {
113114
}
114115

115116
#[tokio::test]
117+
#[cfg_attr(miri, ignore)]
116118
async fn test_request_content_length_cant_convert_to_str() {
117119
let verify_result = verify_request_content_length(
118120
&create_test_headers_with_content_length("❤❤❤❤❤❤❤"),
@@ -130,6 +132,7 @@ mod tests {
130132
}
131133

132134
#[tokio::test]
135+
#[cfg_attr(miri, ignore)]
133136
async fn test_request_content_length_cant_convert_to_usize() {
134137
let verify_result = verify_request_content_length(
135138
&create_test_headers_with_content_length("not_an_int"),
@@ -147,6 +150,7 @@ mod tests {
147150
}
148151

149152
#[tokio::test]
153+
#[cfg_attr(miri, ignore)]
150154
async fn test_request_content_length_too_long() {
151155
let verify_result = verify_request_content_length(
152156
&create_test_headers_with_content_length("100"),

src/trace_processor.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ mod tests {
153153
}
154154

155155
#[tokio::test]
156+
#[cfg_attr(miri, ignore)]
156157
async fn test_process_trace() {
157158
let (tx, mut rx): (
158159
Sender<trace_utils::SendData>,
@@ -215,6 +216,7 @@ mod tests {
215216
}
216217

217218
#[tokio::test]
219+
#[cfg_attr(miri, ignore)]
218220
async fn test_process_trace_top_level_span_set() {
219221
let (tx, mut rx): (
220222
Sender<trace_utils::SendData>,

0 commit comments

Comments
 (0)