Skip to content

Commit

Permalink
upgrade go-git-fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Molina <[email protected]>
  • Loading branch information
erizocosmico committed Jun 11, 2019
1 parent 3c4100c commit 33e3e37
Show file tree
Hide file tree
Showing 17 changed files with 808,052 additions and 120 deletions.
4 changes: 1 addition & 3 deletions checksum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (
"path/filepath"
"testing"

fixtures "github.com/src-d/go-git-fixtures"
"github.com/stretchr/testify/require"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
)

func TestChecksum(t *testing.T) {
require := require.New(t)

require.NoError(fixtures.Init())
defer func() {
require.NoError(fixtures.Clean())
}()
Expand Down Expand Up @@ -68,7 +67,6 @@ func TestChecksumSiva(t *testing.T) {
func TestChecksumStable(t *testing.T) {
require := require.New(t)

require.NoError(fixtures.Init())
defer func() {
require.NoError(fixtures.Clean())
}()
Expand Down
11 changes: 3 additions & 8 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,31 @@ import (
"sync"
"testing"

fixtures "github.com/src-d/go-git-fixtures"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
sivafs "gopkg.in/src-d/go-billy-siva.v4"
billy "gopkg.in/src-d/go-billy.v4"
"gopkg.in/src-d/go-billy.v4/osfs"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/plan"
)

type CleanupFunc func()

func setup(t *testing.T) (*sql.Context, string, CleanupFunc) {
require := require.New(t)
t.Helper()
require.NoError(fixtures.Init())
fxs := []*fixtures.Fixture{fixtures.ByTag("worktree").One()}
ctx, paths, cleanup := buildSession(t, fxs)
require.Len(paths, 1)
return ctx, paths[0], cleanup
}

func setupRepos(t *testing.T) (*sql.Context, []string, CleanupFunc) {
require := require.New(t)
t.Helper()
require.NoError(fixtures.Init())
return buildSession(t, fixtures.ByTag("worktree"))
}

Expand All @@ -46,8 +43,6 @@ func buildSession(t *testing.T, repos fixtures.Fixtures,
require := require.New(t)
t.Helper()

require.NoError(fixtures.Init())

pool := NewRepositoryPool(cache.DefaultMaxSize)
for _, fixture := range repos {
path := fixture.Worktree().Root()
Expand Down
8 changes: 1 addition & 7 deletions database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@ import (
"sort"
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/sql"

"gopkg.in/src-d/go-git-fixtures.v3"
"github.com/stretchr/testify/require"
)

func init() {
fixtures.RootFolder = "vendor/gopkg.in/src-d/go-git-fixtures.v3/"
}

const testDBName = "foo"

func TestDatabase_Tables(t *testing.T) {
Expand Down
4 changes: 1 addition & 3 deletions fs_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
billy "gopkg.in/src-d/go-billy.v4"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
fixtures "github.com/src-d/go-git-fixtures"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
Expand Down Expand Up @@ -52,8 +52,6 @@ func setupErrorRepos(t *testing.T) (*sql.Context, CleanupFunc) {

t.Helper()

require.NoError(fixtures.Init())

fixture := fixtures.ByTag("worktree").One()
baseFS := fixture.Worktree()

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/miekg/dns v1.1.1 // indirect
github.com/opentracing/opentracing-go v1.1.0
github.com/sirupsen/logrus v1.3.0
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible
github.com/src-d/go-mysql-server v0.4.1-0.20190531100547-4dcaf78ac20d
github.com/stretchr/testify v1.3.0
github.com/toqueteos/trie v0.0.0-20150530104557-56fed4a05683 // indirect
Expand All @@ -26,7 +27,7 @@ require (
gopkg.in/src-d/go-billy-siva.v4 v4.2.2
gopkg.in/src-d/go-billy.v4 v4.3.0
gopkg.in/src-d/go-errors.v1 v1.0.0
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 // indirect
gopkg.in/src-d/go-git.v4 v4.11.0
gopkg.in/src-d/go-siva.v1 v1.3.0 // indirect
gopkg.in/src-d/go-vitess.v1 v1.7.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4=
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI=
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible h1:A5bKevhs9C//Nh8QV0J+1KphEaIa25cDe1DTs/yPxDI=
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible/go.mod h1:XcIQp7L+k0pgfTqfbaTKj3kxlBv8kYOKZ/tKNXbZFLg=
github.com/src-d/go-mysql-server v0.4.1-0.20190531100547-4dcaf78ac20d h1:wJoC2gVGP3UNz96Gsaq2PRtY/LPVeeUwHokSt0J+LwA=
github.com/src-d/go-mysql-server v0.4.1-0.20190531100547-4dcaf78ac20d/go.mod h1:gX+I1R89v9OeNSMKvLnY6wkapOT8067nrGPkFP1+jNE=
github.com/src-d/go-oniguruma v1.0.0 h1:JDk5PUAjreGsGAKLsoDLNmrsaryjJ5RqT3h+Si6aw/E=
Expand Down
4 changes: 1 addition & 3 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/src-d/gitbase"
"github.com/src-d/gitbase/internal/function"
"github.com/stretchr/testify/require"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
fixtures "github.com/src-d/go-git-fixtures"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
sqle "github.com/src-d/go-mysql-server"
"github.com/src-d/go-mysql-server/auth"
Expand All @@ -26,7 +26,6 @@ import (
)

func TestIntegration(t *testing.T) {
require.NoError(t, fixtures.Init())
defer func() {
require.NoError(t, fixtures.Clean())
}()
Expand Down Expand Up @@ -991,7 +990,6 @@ func deleteIndex(

func setup(t testing.TB) (*sqle.Engine, *gitbase.RepositoryPool, func()) {
t.Helper()
require.NoError(t, fixtures.Init())
cleanup := func() {
require.NoError(t, fixtures.Clean())
}
Expand Down
3 changes: 1 addition & 2 deletions internal/function/uast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
bblfsh "github.com/bblfsh/go-client/v4"
"github.com/bblfsh/sdk/v3/uast/nodes"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
fixtures "github.com/src-d/go-git-fixtures"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
Expand Down Expand Up @@ -418,7 +418,6 @@ func bblfshFixtures(

func setup(t *testing.T) (*sql.Context, func()) {
t.Helper()
require.NoError(t, fixtures.Init())

pool := gitbase.NewRepositoryPool(cache.DefaultMaxSize)
for _, f := range fixtures.ByTag("worktree") {
Expand Down
2 changes: 1 addition & 1 deletion path_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
fixtures "github.com/src-d/go-git-fixtures"
)

func TestPatternMatches(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion repository_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"gopkg.in/src-d/go-git-fixtures.v3"
"github.com/src-d/go-git-fixtures"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
"gopkg.in/src-d/go-git.v4/plumbing/object"
Expand Down
8 changes: 3 additions & 5 deletions squash_iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
fixtures "github.com/src-d/go-git-fixtures"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/stretchr/testify/require"
"gopkg.in/src-d/go-git.v4/plumbing/cache"
)

func TestAllReposIter(t *testing.T) {
Expand Down Expand Up @@ -717,8 +717,6 @@ func setupIter(t *testing.T) (*sql.Context, func()) {
}

func setupIterWithErrors(t *testing.T, badRepo bool, skipErrors bool) (*sql.Context, func()) {
require.NoError(t, fixtures.Init())

pool := NewRepositoryPool(cache.DefaultMaxSize)
if badRepo {
// TODO: add repo with errors
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/src-d/go-git-fixtures/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33e3e37

Please sign in to comment.