build the test certificate in code instead of committing one
This commit is contained in:
parent
e592078868
commit
401a3c9a51
1 changed files with 60 additions and 18 deletions
|
|
@ -97,7 +97,7 @@ mod tests {
|
|||
use opentelemetry_sdk::metrics::{InMemoryMetricExporter, PeriodicReader, SdkMeterProvider};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::cert::tests::{CERT_PEM, NOT_AFTER, NOT_BEFORE};
|
||||
use crate::cert::tests::{NOT_AFTER, NOT_BEFORE, certificate_pem};
|
||||
|
||||
/// A provider with both gauges registered for `path`, and the exporter it
|
||||
/// flushes into.
|
||||
|
|
@ -152,7 +152,7 @@ mod tests {
|
|||
fn both_gauges_report_the_files_window_under_the_cert_label() {
|
||||
let dir = scratch("window");
|
||||
let path = dir.join("cert.pem");
|
||||
std::fs::write(&path, CERT_PEM).expect("write");
|
||||
std::fs::write(&path, certificate_pem(NOT_BEFORE, NOT_AFTER)).expect("write");
|
||||
let (provider, exporter) = registered(&path);
|
||||
assert_eq!(
|
||||
collect(&provider, &exporter),
|
||||
|
|
@ -192,7 +192,7 @@ mod tests {
|
|||
let path = dir.join("cert.pem");
|
||||
let (provider, exporter) = registered(&path);
|
||||
assert_eq!(collect(&provider, &exporter), []);
|
||||
std::fs::write(&path, CERT_PEM).expect("write");
|
||||
std::fs::write(&path, certificate_pem(NOT_BEFORE, NOT_AFTER)).expect("write");
|
||||
assert_eq!(collect(&provider, &exporter).len(), 2);
|
||||
std::fs::remove_dir_all(&dir).expect("cleanup");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue