IBM-Cloud / ibm-developer-extension-vscode

Extension for VS Code editor to enable IBM Cloud CLI capabilities from within the editing environment.
https://marketplace.visualstudio.com/items?itemName=IBM.ibm-developer
Apache License 2.0
13 stars 10 forks source link

feat: Added plugin commands #46

Closed Aerex closed 2 years ago

Aerex commented 2 years ago

Context

This PR will add a few new VSCode commands from the plugin namespace in the IBM Cloud CLI. The following commands will be added:

Note: All installed plugins will be installed from the official public IBM Cloud repository.

Callouts

Steps to Test

Note: Is is recommended that you use a temporary directory to install plugins for testing. This will ensure the current state of your plugins are not inhibited. To do this you will need to export the IBMCLOUD_HOME environment (eg. IBMCLOUD_HOME=/tmp) in the terminal from VSCode before testing.

Run integration tests

  1. Generate API key from IBM Cloud
  2. Set and export the IBMCLOUD_API_KEY environment variable to the key generated in step 1
  3. Login into IBM Cloud using CLI
  4. Change directory to the root of your local ibm-developer-vscode repo
  5. Run the command npm test
  6. Verify that all tests pass

Test plugin install command

  1. Make sure to follow the steps in the Setup section in previous PRs
  2. Open the Command Palette
    • To enter Command Palette press Ctrl+Shift+P or F1 or navigate to View-> Command Palette
  3. Type and enter in ibmcloud login --sso in the Command Palette
  4. Follow the instructions to login into IBM Cloud
  5. Repeat step 2 (command palette)
  6. Enter the command: ibmcloud plugin install
  7. Verify a dropdown list is shown with a list of plugins that can be installed
  8. Select a plugin to install or type the plugin name in the input box then press Enter.
  9. Verify that plugin is installed successfully by checking the Output Channel
  10. Repeat steps 5-7 and verify that plugin installed from step 8 does not appear in the dropdown list

Test plugin uninstall command

  1. Make sure to follow the steps in Test plugin install command section
  2. Open the Command Palette
  3. Type and enter the command: ibmcloud plugin uninstall
  4. Verify a dropdown list is shown the list of plugins that have been installed.
    • Verify that installed plugin from step 9 is shown
  5. Select plugin from dropdown
  6. Verify that plugin is successfully uninstalled by checking the Output Channel
  7. Repeat steps 3-4 and verify that plugin that was uninstalled in step 6 does not appear in the dropdown list

Test plugin uninstall command (no plugins installed)

  1. Make sure that no plugins are installed
  2. Follow the steps from 2-3 in Test plugin uninstall command section
  3. Verify that toast message is shown that prints the message No plugin is installed. Please install a plugin before trying again

Test plugin update command

  1. Install an older version of plugin using the CLI
    ibmcloud plugin install code-engine 0.6.3
  2. Open the Command Palette
  3. Type and enter the command: ibmcloud plugin update
  4. Verify that the plugin installed in step 1 is shown in the dropdown list
  5. Type or select the plugin from step 1
  6. Verify that the plugin is updated to the latest version by checking the Output Channel

Videos

install_uninstall_plugin

Aerex commented 2 years ago

Since there will be multiple features in this release, I think it is best to use a feature branch. When we are ready to release we can merge the release-0.2.1 feature branch to master.

FYI @steveclay @schmidtp0740