MCPcopy Create free account
hub / github.com/bootc-dev/bootc / check_integration

Function check_integration

crates/xtask/src/tmt.rs:1018–1037  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1016/// Fails with an error if any file would change, similar to `cargo fmt --check`.
1017#[context("Checking TMT generated files")]
1018pub(crate) fn check_integration() -> Result<()> {
1019 let tests_fmf_path = Utf8Path::new("tmt/tests/tests.fmf");
1020 let integration_fmf_path = Utf8Path::new("tmt/plans/integration.fmf");
1021
1022 let (tests_generated, integration_generated) = generate_integration()?;
1023
1024 let tests_on_disk = std::fs::read_to_string(tests_fmf_path)
1025 .with_context(|| format!("Reading {}", tests_fmf_path))?;
1026 let integration_on_disk = std::fs::read_to_string(integration_fmf_path)
1027 .with_context(|| format!("Reading {}", integration_fmf_path))?;
1028
1029 if tests_generated != tests_on_disk {
1030 return out_of_sync_error(&format!("{tests_fmf_path} is out of date"));
1031 }
1032 if integration_generated != integration_on_disk {
1033 return out_of_sync_error(&format!("{integration_fmf_path} is out of date"));
1034 }
1035
1036 Ok(())
1037}
1038
1039/// Generate tmt/plans/integration.fmf from test definitions
1040#[context("Updating TMT integration.fmf")]

Callers 1

try_mainFunction · 0.85

Calls 2

generate_integrationFunction · 0.85
out_of_sync_errorFunction · 0.85

Tested by

no test coverage detected