tests(binary): improve repo cloning/checkout #379
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 PR makes it faster to re-run the tests of the configlet
executable. These tests checkout a known state of some Exercism repos,
but previously always ran
git clone
- even if the repos were alreadypresent locally.
With this PR, the tests only run
git clone
when necessary. Thismakes it easier to add new tests - a configlet developer would otherwise
want to comment-out the
git clone
lines while doing so.Other changes:
cloneExercismRepo
(avoid ourdirty
template andblock
).binaryPath
const, to better signal to the reader that it isknown at compile-time.
tests
dir, rather than the repo root.gitignore
- it was missing.Future PRs will refactor this code further.
I was going to push these changes (and much more upcoming) to #366, but it makes that PR (and eventual squashed commit) too large - it'll already be pretty big. So I want to merge a few PRs first - this won't slow things down more. I consider adding decent tests one of the biggest parts of #366, so in this case I want to not hate the initial state of the new tests.
The next PR will improve the cloning process further, so we'll just have
setupExercismRepo
at the call site that does "clone if necessary, and checkout".I think I've finally figured out an ergonomic design for some exec/git helper commands, so they'll soon infect the rest of our codebase too.