Skip to content

Commit 040dc67

Browse files
prontthomasqueirozb
authored andcommitted
chore(ci): reorganize integration test files (vectordotdev#24108)
* chore(ci): reorganize integration test files * revert nats data move * fix paths to data * fix more paths * amqp fix * Fix logstash int tests shared files paths * Rename scripts/integration -> tests/integration * scripts/integration -> tests/integration in source files * Fix scripts->tests * Fix gcp paths * Fix http-client pem path * move nats data --------- Co-authored-by: Thomas <thomas.schneider@datadoghq.com>
1 parent fc3955b commit 040dc67

File tree

125 files changed

+149
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+149
-122
lines changed

.github/workflows/changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ jobs:
324324

325325
# creates a yaml file that contains the filters for each integration,
326326
# extracted from the output of the `vdev int ci-paths` command, which
327-
# sources the paths from the scripts/integration/.../test.yaml files
327+
# sources the paths from the tests/integration/.../config/test.yaml files
328328
- name: Create filter rules for integrations
329329
run: vdev int ci-paths > int_test_filters.yaml
330330

src/nats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ mod tests {
266266
parse_auth(
267267
r#"
268268
strategy = "credentials_file"
269-
credentials_file.path = "tests/data/nats/nats.creds"
269+
credentials_file.path = "tests/integration/nats/data/nats.creds"
270270
"#,
271271
)
272272
.unwrap();

src/sinks/gcp_chronicle/chronicle_unstructured.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,9 @@ mod integration_tests {
718718
trace_init();
719719

720720
let log_type = random_string(10);
721-
let (sink, healthcheck) =
722-
config_build(&log_type, "/home/vector/scripts/integration/gcp/auth.json")
723-
.await
724-
.expect("Building sink failed");
721+
let (sink, healthcheck) = config_build(&log_type, "tests/integration/gcp/config/auth.json")
722+
.await
723+
.expect("Building sink failed");
725724

726725
healthcheck.await.expect("Health check failed");
727726

@@ -749,11 +748,7 @@ mod integration_tests {
749748

750749
let log_type = random_string(10);
751750
// Test with an auth file that doesnt match the public key sent to the dummy chronicle server.
752-
let sink = config_build(
753-
&log_type,
754-
"/home/vector/scripts/integration/gcp/invalidauth.json",
755-
)
756-
.await;
751+
let sink = config_build(&log_type, "tests/integration/gcp/config/invalidauth.json").await;
757752

758753
assert!(sink.is_err())
759754
}
@@ -765,10 +760,9 @@ mod integration_tests {
765760
// The chronicle-emulator we are testing against is setup so a `log_type` of "INVALID"
766761
// will return a `400 BAD_REQUEST`.
767762
let log_type = "INVALID";
768-
let (sink, healthcheck) =
769-
config_build(log_type, "/home/vector/scripts/integration/gcp/auth.json")
770-
.await
771-
.expect("Building sink failed");
763+
let (sink, healthcheck) = config_build(log_type, "tests/integration/gcp/config/auth.json")
764+
.await
765+
.expect("Building sink failed");
772766

773767
healthcheck.await.expect("Health check failed");
774768

src/sinks/nats/integration_tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async fn nats_tls_valid() {
252252
conf.tls = Some(TlsEnableableConfig {
253253
enabled: Some(true),
254254
options: TlsConfig {
255-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
255+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
256256
..Default::default()
257257
},
258258
});
@@ -293,9 +293,9 @@ async fn nats_tls_client_cert_valid() {
293293
conf.tls = Some(TlsEnableableConfig {
294294
enabled: Some(true),
295295
options: TlsConfig {
296-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
297-
crt_file: Some("tests/data/nats/nats-client.pem".into()),
298-
key_file: Some("tests/data/nats/nats-client.key".into()),
296+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
297+
crt_file: Some("tests/integration/nats/data/nats-client.pem".into()),
298+
key_file: Some("tests/integration/nats/data/nats-client.key".into()),
299299
..Default::default()
300300
},
301301
});
@@ -319,7 +319,7 @@ async fn nats_tls_client_cert_invalid() {
319319
conf.tls = Some(TlsEnableableConfig {
320320
enabled: Some(true),
321321
options: TlsConfig {
322-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
322+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
323323
..Default::default()
324324
},
325325
});
@@ -343,13 +343,13 @@ async fn nats_tls_jwt_auth_valid() {
343343
conf.tls = Some(TlsEnableableConfig {
344344
enabled: Some(true),
345345
options: TlsConfig {
346-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
346+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
347347
..Default::default()
348348
},
349349
});
350350
conf.auth = Some(NatsAuthConfig::CredentialsFile {
351351
credentials_file: NatsAuthCredentialsFile {
352-
path: "tests/data/nats/nats.creds".into(),
352+
path: "tests/integration/nats/data/nats.creds".into(),
353353
},
354354
});
355355

@@ -372,13 +372,13 @@ async fn nats_tls_jwt_auth_invalid() {
372372
conf.tls = Some(TlsEnableableConfig {
373373
enabled: Some(true),
374374
options: TlsConfig {
375-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
375+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
376376
..Default::default()
377377
},
378378
});
379379
conf.auth = Some(NatsAuthConfig::CredentialsFile {
380380
credentials_file: NatsAuthCredentialsFile {
381-
path: "tests/data/nats/nats-bad.creds".into(),
381+
path: "tests/integration/nats/data/nats-bad.creds".into(),
382382
},
383383
});
384384

src/sources/amqp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ pub mod test {
618618
}
619619
}
620620

621-
/// Integration tests use the docker compose files in `scripts/integration/docker-compose.amqp.yml`.
621+
/// Integration tests use the docker compose files in `tests/integration/docker-compose.amqp.yml`.
622622
#[cfg(feature = "amqp-integration-tests")]
623623
#[cfg(test)]
624624
mod integration_test {

src/sources/http_client/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async fn tls_invalid_ca() {
244244
headers: HashMap::new(),
245245
method: HttpMethod::Get,
246246
tls: Some(TlsConfig {
247-
ca_file: Some("tests/data/http-client/certs/invalid-ca-cert.pem".into()),
247+
ca_file: Some("tests/integration/http-client/data/certs/invalid-ca-cert.pem".into()),
248248
..Default::default()
249249
}),
250250
auth: None,

src/sources/logstash.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,12 @@ mod integration_tests {
966966
Some(TlsEnableableConfig {
967967
enabled: Some(true),
968968
options: TlsConfig {
969-
crt_file: Some("tests/data/host.docker.internal.crt".into()),
970-
key_file: Some("tests/data/host.docker.internal.key".into()),
969+
crt_file: Some(
970+
"tests/integration/shared/data/host.docker.internal.crt".into(),
971+
),
972+
key_file: Some(
973+
"tests/integration/shared/data/host.docker.internal.key".into(),
974+
),
971975
..Default::default()
972976
},
973977
}),

src/sources/nats/integration_tests.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ async fn nats_tls_valid() {
280280
conf.tls = Some(TlsEnableableConfig {
281281
enabled: Some(true),
282282
options: TlsConfig {
283-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
283+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
284284
..Default::default()
285285
},
286286
});
@@ -317,9 +317,9 @@ async fn nats_tls_client_cert_valid() {
317317
conf.tls = Some(TlsEnableableConfig {
318318
enabled: Some(true),
319319
options: TlsConfig {
320-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
321-
crt_file: Some("tests/data/nats/nats-client.pem".into()),
322-
key_file: Some("tests/data/nats/nats-client.key".into()),
320+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
321+
crt_file: Some("tests/integration/nats/data/nats-client.pem".into()),
322+
key_file: Some("tests/integration/nats/data/nats-client.key".into()),
323323
..Default::default()
324324
},
325325
});
@@ -341,7 +341,7 @@ async fn nats_tls_client_cert_invalid() {
341341
conf.tls = Some(TlsEnableableConfig {
342342
enabled: Some(true),
343343
options: TlsConfig {
344-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
344+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
345345
..Default::default()
346346
},
347347
});
@@ -363,13 +363,13 @@ async fn nats_tls_jwt_auth_valid() {
363363
conf.tls = Some(TlsEnableableConfig {
364364
enabled: Some(true),
365365
options: TlsConfig {
366-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
366+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
367367
..Default::default()
368368
},
369369
});
370370
conf.auth = Some(NatsAuthConfig::CredentialsFile {
371371
credentials_file: NatsAuthCredentialsFile {
372-
path: "tests/data/nats/nats.creds".into(),
372+
path: "tests/integration/nats/data/nats.creds".into(),
373373
},
374374
});
375375

@@ -390,13 +390,13 @@ async fn nats_tls_jwt_auth_invalid() {
390390
conf.tls = Some(TlsEnableableConfig {
391391
enabled: Some(true),
392392
options: TlsConfig {
393-
ca_file: Some("tests/data/nats/rootCA.pem".into()),
393+
ca_file: Some("tests/integration/nats/data/rootCA.pem".into()),
394394
..Default::default()
395395
},
396396
});
397397
conf.auth = Some(NatsAuthConfig::CredentialsFile {
398398
credentials_file: NatsAuthCredentialsFile {
399-
path: "tests/data/nats/nats-bad.creds".into(),
399+
path: "tests/integration/nats/data/nats-bad.creds".into(),
400400
},
401401
});
402402

File renamed without changes.

0 commit comments

Comments
 (0)