asdf icon indicating copy to clipboard operation
asdf copied to clipboard

Improve testing with plugin repositories

Open acidghost opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe

As mentioned in #1507 some features need actually remote repositories for their tests to be complete.

This example only tests for repo "remote" URL that is a local folder, doesn't test other forms of URLs (http, ssh): https://github.com/asdf-vm/asdf/blob/05a8bb940a9ce1a83dcda2a2bf52dc3d0786bd54/test/asdf_nu.bats#L102-L115

A similar thing also happens here: https://github.com/asdf-vm/asdf/blob/05a8bb940a9ce1a83dcda2a2bf52dc3d0786bd54/test/asdf_nu.bats#L150-L160

Describe the proposed solution

One solution would be to have dummy remote repositories that are cloned in different ways. ATM the dummy repository is exclusively cloned from a local directory.

Another solution is to manually add a fake "remote origin" (e.g. git remote remove origin && git remote add origin http://example.com); branch and ref can be faked as they are now.

Describe similar asdf features and why they are not sufficient

n/a

Describe other workarounds you've considered

n/a

acidghost avatar Mar 24 '23 08:03 acidghost

Is this what you mean when you say "fake remote origin"?

https://github.com/asdf-vm/asdf/blob/05a8bb940a9ce1a83dcda2a2bf52dc3d0786bd54/test/update_command.bats#L10

jthegedus avatar Mar 30 '23 07:03 jthegedus

Yes, precisely! This would enable testing different URL formats in the first example I provided.

For the second one example I think the only way is to add more plugins (with different URL formats) to the dummy_plugins_repo.

acidghost avatar Mar 30 '23 18:03 acidghost