You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: asdf plugin test does not cleanup the test plugin #2130
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
# From some plugin directory
asdf plugin test nim .
asdf plugin test nim .# Fails because `asdf-test-nim` is already installed
Expected Behaviour
# 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
There are other places it can fail further down the function (eg installing one version) which results in the same behaviour where the defer does not run.
I reproduced this on current master (f87a31efc67c041af49f0d3c566840e4f30a12cb) with an isolated ASDF_DATA_DIR and a local test plugin missing its install callback. The first run exits 1 and leaves plugins/asdf-test-dummy; the second run then fails because that test plugin is already added. I'm working on a small change that returns failures through the CLI action so the existing deferred cleanup runs, plus a Bats regression covering failure cleanup and a repeat run.
Activity
gunzy83 commentedon Oct 9, 2025
Looks like it is not cleaning up after a failure:
There are other places it can fail further down the function (eg installing one version) which results in the same behaviour where the defer does not run.
CAOShurong commentedon Aug 12, 2026
I reproduced this on current
master(f87a31efc67c041af49f0d3c566840e4f30a12cb) with an isolatedASDF_DATA_DIRand a local test plugin missing itsinstallcallback. The first run exits 1 and leavesplugins/asdf-test-dummy; the second run then fails because that test plugin is already added. I'm working on a small change that returns failures through the CLI action so the existing deferred cleanup runs, plus a Bats regression covering failure cleanup and a repeat run.