@@ -20,7 +20,7 @@ const (
2020func TestRpcServerPlugins (t * testing.T ) {
2121 ctx := testharness .NewTestContext (t )
2222
23- t .Run ("should_install_list_and_uninstall_plugin_from_local_marketplace " , func (t * testing.T ) {
23+ t .Run ("should_install_and_list_plugin_from_local_marketplace " , func (t * testing.T ) {
2424 ctx .ConfigureForTest (t )
2525 marketplaceDir := createPortedLocalMarketplaceFixture (t )
2626 client := newStartedIsolatedPortedClient (t , ctx )
@@ -63,17 +63,6 @@ func TestRpcServerPlugins(t *testing.T) {
6363 t .Fatal ("Expected listed marketplace plugin to be enabled" )
6464 }
6565
66- if _ , err := client .RPC .Plugins .Uninstall (t .Context (), & rpc.PluginsUninstallRequest {Name : spec }); err != nil {
67- t .Fatalf ("Plugins.Uninstall failed: %v" , err )
68- }
69-
70- afterUninstall , err := client .RPC .Plugins .List (t .Context ())
71- if err != nil {
72- t .Fatalf ("Plugins.List after uninstall failed: %v" , err )
73- }
74- if findPortedInstalledPlugin (afterUninstall .Plugins , portedPluginName , portedMarketplaceName ) != nil {
75- t .Fatalf ("Expected plugin %q to be removed" , spec )
76- }
7766 })
7867
7968 t .Run ("should_enable_and_disable_marketplace_plugin" , func (t * testing.T ) {
@@ -200,8 +189,14 @@ func TestRpcServerPlugins(t *testing.T) {
200189 if countPortedInstalledPluginByName (afterInstall .Plugins , portedDirectPluginName ) != 1 {
201190 t .Fatalf ("Expected exactly one direct plugin named %q, got %+v" , portedDirectPluginName , afterInstall .Plugins )
202191 }
192+ if install .Plugin .DirectSourceID == nil {
193+ t .Fatal ("Expected direct plugin install to include directSourceId" )
194+ }
203195
204- if _ , err := client .RPC .Plugins .Uninstall (t .Context (), & rpc.PluginsUninstallRequest {Name : portedDirectPluginName }); err != nil {
196+ if _ , err := client .RPC .Plugins .Uninstall (t .Context (), & rpc.PluginsUninstallRequest {
197+ DirectSourceID : install .Plugin .DirectSourceID ,
198+ Name : portedDirectPluginName ,
199+ }); err != nil {
205200 t .Fatalf ("Plugins.Uninstall direct failed: %v" , err )
206201 }
207202 afterUninstall , err := client .RPC .Plugins .List (t .Context ())
0 commit comments