Make a local repo for checkoutExternalQueries #177
Merged
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.
This makes the
checkoutExternalQueriestest create a local git repo instead of downloading one from github.com. This makes the test faster so it won't risk timing out on slower internet connections, and makes it run at all without internet.This turned out to be moderately complicated because of having to create the git repo. There are probably libraries that would make this easier but for just this one test I didn't think it was worth it.
As a bonus I also add a test of checking out two refs from the same repo, which is now possible without timing out the test.
I did make one small change to the non-test code which is remove the
.gitsuffix when cloning. This made the test easier because the directory name was more predictable and because I'm cheating slightly by giving it afile://url. This shouldn't matter for github.com as that suffix is optional when cloning by HTTP. The integration tests should catch it if this now fails as one of those clones remote queries.Merge / deployment checklist