Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make asdf latest output consistent #1685

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cj81499
Copy link
Contributor

@cj81499 cj81499 commented Nov 24, 2023

Summary

Modify the default query used by asdf latest to allow for "v" prefixes.

Additionally, perform a small refactor to extract some duplicated logic to a helper function.

Fixes: #1684

Other Information

I believe that asdf latest --all uses an empty query (it simply doesn't pass a query argument), which is different than asdf latest <plugin>.
I think both should use the same default query, but I'm not sure which ("v?[0-9]" vs "") should be preferred. I'd like guidance on which should be preferred.

allow versions that begin with "v"
fixes: asdf-vm#1684
@cj81499 cj81499 changed the title fix inconsistent asdf latest output fix: make asdf latest output consistent Nov 24, 2023
@cj81499
Copy link
Contributor Author

cj81499 commented Nov 24, 2023

I'm having trouble reproducing the test failures locally (in fact, I'm having trouble getting a clean run of the tests on the default branch).

I'd appreciate help getting the tests running/passing.

@cj81499 cj81499 marked this pull request as ready for review November 24, 2023 22:22
@cj81499 cj81499 requested a review from a team as a code owner November 24, 2023 22:22
@hyperupcall
Copy link
Contributor

The tests that usually fail are in update_command.bats. When I run bats test, 5 tests fail out of 368:

update_command.bats
 ✓ asdf update --head should checkout the master branch
 ✗ asdf update should checkout the latest non-RC tag
   (in test file test/update_command.bats, line 41)
     `[ "$status" -eq 0 ]' failed
   Cloning into '/tmp/asdf.UZh0/home/.asdf'...
   done.
 ✗ asdf update should checkout the latest tag when configured with use_release_candidates = yes
   (in test file test/update_command.bats, line 54)
     `[ "$status" -eq 0 ]' failed
   Cloning into '/tmp/asdf.OpSy/home/.asdf'...
   done.
 ✓ asdf update is a noop for when updates are disabled
 ✓ asdf update is a noop for non-git repos
 ✓ asdf update fails with exit code 1
 ✗ asdf update should not remove plugin versions
   (in test file test/update_command.bats, line 85)
     `[ "$status" -eq 0 ]' failed
   Cloning into '/tmp/asdf.RWrB/home/.asdf'...
   done.
 ✗ asdf update should not remove plugins
   (in test file test/update_command.bats, line 95)
     `[ "$status" -eq 0 ]' failed
   Cloning into '/tmp/asdf.dOCk/home/.asdf'...
   done.
 ✗ asdf update should not remove shims
   (in test file test/update_command.bats, line 106)
     `[ "$status" -eq 0 ]' failed
   Cloning into '/tmp/asdf.n4EO/home/.asdf'...
   done.

If you get other failures that aren't due to your changes, it might be useful to file an issue about that.

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.

bug: asdf latest <plugin> and asdf latest --all are sometimes inconsistent
2 participants