Skip to content

Commit 1c4abb3

Browse files
committed
test(cli): cover static Switchyard migration validation
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
1 parent aeba7c6 commit 1c4abb3

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

crates/cli/tests/coverage/shared/server_tests.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,28 @@ async fn static_only_cli_configuration_keeps_the_legacy_lifecycle() {
18371837
let _ = deregister_plugin(GENERIC_TEST_PLUGIN_KIND);
18381838
}
18391839

1840+
#[test]
1841+
fn register_and_validate_plugin_components_rejects_legacy_switchyard_components() {
1842+
for enabled in [true, false] {
1843+
let config = PluginConfig {
1844+
components: vec![PluginComponentSpec {
1845+
kind: "switchyard".into(),
1846+
enabled,
1847+
config: Map::new(),
1848+
}],
1849+
..PluginConfig::default()
1850+
};
1851+
1852+
let errors = register_and_validate_plugin_components(&config);
1853+
assert!(
1854+
errors
1855+
.iter()
1856+
.any(|error| matches!(error, PluginComponentSetupError::RemovedSwitchyard)),
1857+
"legacy Switchyard components must be rejected when enabled is {enabled}"
1858+
);
1859+
}
1860+
}
1861+
18401862
#[test]
18411863
fn plugin_component_setup_errors_render_every_diagnostic_variant() {
18421864
let adaptive = PluginComponentSetupError::Adaptive("adaptive failure".into());

0 commit comments

Comments
 (0)