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")
}
@@ -105,6 +109,9 @@ fn prepare_reference_ccr(
#[test]
fn cir_routinator_script_matches_reference_on_ta_only_cir() {
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()
{
@@ -125,6 +132,12 @@ fn cir_routinator_script_matches_reference_on_ta_only_cir() {
let script =
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("scripts/cir/run_cir_replay_routinator.sh");
let out = Command::new(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([
"--cir",
cir_path.to_string_lossy().as_ref(),
@@ -152,6 +165,9 @@ fn cir_routinator_script_matches_reference_on_ta_only_cir() {
#[test]
fn cir_rpki_client_script_matches_reference_on_ta_only_cir() {
if skip_heavy_script_replay_test() {
return;
}
if !Path::new("/usr/bin/rsync").exists()
|| !Path::new("/home/yuyr/dev/rpki-client-9.7/build-m5/src/rpki-client").exists()
{
@@ -172,6 +188,12 @@ fn cir_rpki_client_script_matches_reference_on_ta_only_cir() {
let script =
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("scripts/cir/run_cir_replay_rpki_client.sh");
let out = Command::new(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([
"--cir",
cir_path.to_string_lossy().as_ref(),