-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
check for different urls when running haxelib git
#640
base: development
Are you sure you want to change the base?
check for different urls when running haxelib git
#640
Conversation
how was this one looking? Should I add tests for this? |
Yes please, a test would be useful! |
It only has to be checked when running interp scripts, so we can avoid checking it in other cases.
…ion#638) * submodule stuff in progress * perhaps a submodule fix? * revert the dipshit logging * update run.n * we dont need to spit out every log, but we should use the threads? * comment out the unneeded git fetch * small reorder / remove redundant `git submodule init` * uncomment the lib deletion, since we've ran into issues related * fix for stderr/stdout related hangs on non-windows when installing git submodules * remove git progress code * run.n * remove whitespace * proper non-cli coupled logging * remove unneeded logging/git --quiet flag code for the time being * run.n * remove unneeded FsUtils.deleteRec() * run.n * remove testing print * run.n * removed unused import and throw an exception on submodule error * add message for SubmoduleError
…cal or not testing in progress accident git thingie
089b365
to
da51ad0
Compare
finally got around to figuring out how to draft up a test! I wrote it in |
how does the PR look @tobil4sk ? |
@@ -0,0 +1 @@ | |||
-lib flixel:git:https://github.com/geokureli/flixel.git#4.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to set up a url that is just a path to a local directory. There is a util function for setting up a git repository, and there is a test/libraries
folder with some existing libraries that could be pointed to.
haxelib/test/tests/util/Vcs.hx
Line 8 in 5a83628
function makeGitRepo(libPath:String) { |
haxelib/test/tests/integration/TestVcs.hx
Lines 6 to 8 in 5a83628
final vcsLibPath = "libraries/libBar"; | |
final vcsLibNoHaxelibJson = "libraries/libNoHaxelibJson"; | |
final vcsBrokenDependency = "libraries/libBrokenDep"; |
External repositories may change ownership or move (and they rely on the network to clone), so it is more reliable to clone from local repositories in tests, especially the unit tests.
@@ -105,6 +106,19 @@ class TestInstaller extends TestBase { | |||
assertTrue(scope.isLibraryInstalled(ProjectName.ofString("hx.signal"))); | |||
} | |||
|
|||
public function testInstallUrlChanges() { | |||
installer.installFromHxml("git-deps-url-old.hxml"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this test, we should run installVcsLibrary
rather than installFromHxml
, since we are only testing the git functionality
Currently running
haxelib git
it doesn't check the differences in remote urls.Running
haxelib git flixel https://github.com/HaxeFlixel/flixel.git
will correctly installflixel
. However, if you then try running with a different urlhaxelib git flixel https://github.com/FunkinCrew/flixel.git
it doesn't properly update / reinstall from the new URL. Going into the cloned repoflixel/git
and runninggit config --get remote.origin.url
will showhttps://github.com/HaxeFlixel/flixel.git
rather than the new one.This PR runs a check from the currently installed haxelib's git remote to the newly inputted one, and if it's different, it will ask if you want to install the new one.
Right now I just have it implemented for git, not mecurial. Current implementation is agnostic to whether someone has an SSH remote url (
git@github.com:HaxeFlixel/flixel
) or HTTP remote url (https://github.com/HaxeFlixel/flixel
)