Fix MCP settings migration continually adding the same key (#32848)
Release Notes: - N/A
This commit is contained in:
parent
2f3acb6185
commit
c4355d2905
2 changed files with 103 additions and 123 deletions
|
@ -1010,4 +1010,46 @@ mod tests {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mcp_settings_migration_doesnt_change_valid_settings() {
|
||||
let settings = r#"{
|
||||
"context_servers": {
|
||||
"empty_server": {
|
||||
"source": "extension",
|
||||
"settings": {}
|
||||
},
|
||||
"extension_server": {
|
||||
"source": "extension",
|
||||
"settings": {
|
||||
"foo": "bar"
|
||||
}
|
||||
},
|
||||
"custom_server": {
|
||||
"source": "custom",
|
||||
"command": {
|
||||
"path": "foo",
|
||||
"args": ["bar"],
|
||||
"env": {
|
||||
"FOO": "BAR"
|
||||
}
|
||||
}
|
||||
},
|
||||
"invalid_server": {
|
||||
"source": "custom",
|
||||
"command": {
|
||||
"path": "foo",
|
||||
"args": ["bar"],
|
||||
"env": {
|
||||
"FOO": "BAR"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"foo": "bar"
|
||||
}
|
||||
}
|
||||
}
|
||||
}"#;
|
||||
assert_migrate_settings(settings, None);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue