Skip to content

fix: run the test command of plugin test - #2351

Open
mbutov wants to merge 1 commit into
asdf-vm:masterfrom
mbutov:fix/plugin-test-command
Open

mbutov wants to merge 1 commit into
asdf-vm:masterfrom
mbutov:fix/plugin-test-command

Conversation

@mbutov

@mbutov mbutov commented Nov 16, 2026

Copy link
Copy Markdown

Summary

asdf plugin test <name> <url> [test_command...] has not run the test command since the Go rewrite: pluginTestCommand reads only args[0] and args[1], and the remaining arguments are silently ignored. A plugin passes the test even with false as the test command, as long as the install succeeds. asdf-vm/actions plugin-test passes its required command input the same way, so plugin CI relying on it never runs the command either. asdf 0.15 ran it after asdf local and reshim.

This change runs the command after the install:

  • with the installed version's bin paths prepended to PATH and the plugin's exec-env applied, the way asdf env builds the environment;
  • a non-zero exit fails the test with FAILED: <command> failed: <error>;
  • several arguments are the command and its arguments (node --version, as in the docs), a single argument is run as a command line ("node --version", as asdf-vm/actions passes it).

Tests: four cases in test/plugin_test_command.bats (arguments, single command line, failing command, missing command); they fail without the change. The plugin docs get a short description of how the command runs.

Fixes: no issue found for this.

Other Information

Found while testing plugins in asdf-community (asdf-tomcat, asdf-jetbrains): their CI passed with plugin-test while the command was never executed.

asdf plugin test accepted [test_command...] but never ran it since the Go
rewrite: only the install was checked, so plugins passed with a test command
that fails. asdf-vm/actions plugin-test passes the command too and was
affected the same way.

The command runs after the install with the version's bin paths on PATH and
exec-env applied, as asdf env does; a failure fails the test. A single
argument is run as a command line, the way asdf-vm/actions passes it.
@mbutov
mbutov requested a review from a team as a code owner November 16, 2026 07:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant