Fix MCP settings migration continually adding the same key (#32848)

Release Notes:

- N/A
This commit is contained in:
Ben Brandt 2025-06-17 11:32:08 +02:00 committed by GitHub
parent 2f3acb6185
commit c4355d2905
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 103 additions and 123 deletions

View file

@ -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);
}
}