bug: asdf plugin test does not cleanup the test plugin
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 941
- Avg merge
- 9h 24m
- Merged PRs (30d)
- 3
Description
### Describe the Bug
When I am actively developing my plugin and running `asdf plugin test nim .`, I have to manually run `asdf plugin remove asdf-test-nim` before each run.
I could see it being sometimes useful to keep the installed test plugin around if a plugin developer needs to inspect the installation, but that should be opt-in rather than opt-out. The default behavior should be to uninstall the plugin once the test is done, whether it succeeds or fails.
### Steps to Reproduce
```shell
# From some plugin directory
asdf plugin test nim .
asdf plugin test nim . # Fails because `asdf-test-nim` is already installed
```
### Expected Behaviour
```shell
# From some plugin directory
asdf plugin test nim .
asdf plugin test nim . # Works beause `asdf-test-nim` was uninstalled
```
### Actual Behaviour
```
FAILED: nim was not properly installed reason: Plugin named asdf-test-nim already added
```
### Environment
```shell
macos and linux
```
### asdf plugins affected (if relevant)
asdf-nim
Contributor guide
Research direction
Start at the `asdf plugin test nim .` CLI entry point and reproduce the issue by running it twice from a plugin directory. Trace the cleanup paths for both successful and failed tests; done means the second run works because the test plugin is removed by default, while any retention behavior is explicitly opted into.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100