fix: clean up plugins after failed plugin tests - #2313
Open
CAOShurong wants to merge 1 commit into
Open
Conversation
CAOShurong
marked this pull request as ready for review
August 12, 2026 13:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Return plugin-test validation failures through the CLI action instead of exiting immediately. This lets the existing deferred
plugins.Removecall run after both successful and failed tests.Add a Bats regression that removes a required callback, runs the failing plugin test twice, and verifies after each run that:
already added;asdf-test-dummyis removed from the isolated data directory.Fixes: #2130
Other Information
Root cause:
failTestcalledcli.OsExiter(1)insidepluginTestCommand. Process exit bypassed the deferred cleanup registered after the temporary plugin was added.Validation run locally on Linux under WSL with Go 1.26.5 and the repository-declared Bats 1.8.2:
go test ./cmd/asdf -run TestBatsTests/plugin_test_command -count=1go test -timeout=30m -coverprofile=<E:-scratch-output> -bench= -race ./...scripts/lint.bash --checkwith shfmt 3.6.0, ShellCheck 0.10.0, and the custom Python style checkergo run mvdan.cc/gofumpt -l .go mod verifygo vet ./...go run github.com/mgechev/revive -set_exit_status ./...go run honnef.co/go/tools/cmd/staticcheck -tests -show-ignored ./...go build -v ./...ASDF_DATA_DIRvalues, including two consecutive failed runsLocal
fish_indentwas not available, so the Fish formatting portion ofscripts/lint.bash --checkwas skipped with the script's normal warning. No Fish files changed. The macOS test matrix was not run locally.The fork-triggered Lint and Test workflow runs are currently
action_requiredwith zero jobs started and need maintainer approval before they can execute.semantic-prpassed. This is an external workflow gate, not a CI pass or test failure; the unrun Fish and macOS checks remain unverified until those workflows run.This contribution was prepared with OpenAI Codex assistance under CAOShurong's direction; the diff and the checks run are reported here without claiming unrun validation.