Testing: How to set up an initial repository with some branches to operate on? #870
Unanswered
DennisTheMenace780
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been chipping away at trying to better understand how to set up the initial state of a test within my application. The initial setup that I need is fairly minimal:
I think that from this setup I can get further on my own. I've looked at the
common_test.go
package and there seems to be some helpful structs and functions here, but they depend on fixtures fromgo-get/fixtures
, which seem to only pull remote repositories.Pulling something remote is not necessarily what I need to do, so that seems to be out-of-scope.
I suspect I need to do something with the billy filesystem interface, but I haven't quite figured out how to leverage this to do what I need yet.
So far I have something, but it doesn't work as expected. For example, when I create all of the branches on the
repo
, I am unable to iterate over them withForEach()
, at all. In fact, I don't even think the function passed toForEach()
gets called. What I find strange, though, is if I do something likeb, err := repo.Branch("refs/heads/JOB-62131/JOB-76475/add-location-timers-to-fms")
then I can get that branch back without error.Any help would be appreciated! I've spent a fair amount of time looking through various tests for examples that might suite what I need, but I haven't been able to put the right pieces together.
Beta Was this translation helpful? Give feedback.
All reactions