Repository navigation
test(project): copy one template repository instead of building each with four git calls - #808
Merged
Merged
Conversation
…with four git calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
internal/projectis the slowest package on the Windows runner (82s in the #807 run, 6s on Linux) and almost none of it is a slow test: the suite spawns git 1,431 times, about 57ms a process on Windows. Half of those only build fixtures, andinitRepo, called by ~95 tests, ran four of them (init,config,add,commit) to reach the same repository every time.initRepobuilds that repository once per package run and hands each test anos.CopyFScopy plus onegit update-index --refresh. The refresh is required: the copied index carries the template's inodes and ctimes, so the first git read would rewrite it, whichTestSnapshotTreeLeavesTheRepositoryAlonecatches.git initskips (no usable git), a failure after it fails the test.TestMainremoves the template.testGitIdentity, shared bygitInand the template build.No assertion changes. Locally: git calls 1,431 → 1,036, package green at
-count=5,go vetclean for linux, windows and darwin. The Windows number comes from this PR's Timings table.