20260147 迭代优化全量测试和覆盖率测试,时间从325秒降低到90+秒,覆盖率维持在90%

This commit is contained in:
2026-04-17 17:18:05 +08:00
parent 224ae10052
commit f485786470
18 changed files with 225 additions and 11 deletions

View File

@@ -6,6 +6,10 @@ use rpki::cir::{
materialize_cir,
};
fn skip_heavy_script_replay_test() -> bool {
std::env::var_os("RPKI_SKIP_HEAVY_SCRIPT_REPLAY_TESTS").is_some()
}
fn apnic_tal_path() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/tal/apnic-rfc7730-https.tal")
}
@@ -161,6 +165,9 @@ fn prepare_sequence_root(td: &Path) -> PathBuf {
#[test]
fn peer_sequence_replay_scripts_replay_all_steps() {
if skip_heavy_script_replay_test() {
return;
}
if !Path::new("/usr/bin/rsync").exists()
|| !Path::new("/home/yuyr/dev/rust_playground/routinator/target/debug/routinator").exists()
|| !Path::new("/home/yuyr/dev/rpki-client-9.7/build-m5/src/rpki-client").exists()
@@ -174,6 +181,12 @@ fn peer_sequence_replay_scripts_replay_all_steps() {
let routinator_script = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("scripts/cir/run_cir_replay_sequence_routinator.sh");
let out = Command::new(routinator_script)
.env("CIR_MATERIALIZE_BIN", env!("CARGO_BIN_EXE_cir_materialize"))
.env("CIR_EXTRACT_INPUTS_BIN", env!("CARGO_BIN_EXE_cir_extract_inputs"))
.env(
"CCR_TO_COMPARE_VIEWS_BIN",
env!("CARGO_BIN_EXE_ccr_to_compare_views"),
)
.args(["--sequence-root", sequence_root.to_string_lossy().as_ref()])
.output()
.expect("run routinator sequence replay");
@@ -192,6 +205,12 @@ fn peer_sequence_replay_scripts_replay_all_steps() {
let rpki_client_script = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("scripts/cir/run_cir_replay_sequence_rpki_client.sh");
let out = Command::new(rpki_client_script)
.env("CIR_MATERIALIZE_BIN", env!("CARGO_BIN_EXE_cir_materialize"))
.env("CIR_EXTRACT_INPUTS_BIN", env!("CARGO_BIN_EXE_cir_extract_inputs"))
.env(
"CCR_TO_COMPARE_VIEWS_BIN",
env!("CARGO_BIN_EXE_ccr_to_compare_views"),
)
.args([
"--sequence-root",
sequence_root.to_string_lossy().as_ref(),