Skip to content

Commit edca944

Browse files
committed
*: fix codebase after go-mysql-server upgrade
Signed-off-by: Miguel Molina <[email protected]>
1 parent 268efcd commit edca944

11 files changed

+27
-16
lines changed

cmd/gitquery/server.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ func (c *CmdServer) Execute(args []string) error {
6060

6161
hostString := net.JoinHostPort(c.Host, strconv.Itoa(c.Port))
6262
s, err := server.NewServer(
63-
"tcp",
64-
hostString,
65-
auth,
63+
server.Config{
64+
Protocol: "tcp",
65+
Address: hostString,
66+
Auth: auth,
67+
},
6668
c.engine,
6769
gitbase.NewSessionBuilder(c.pool),
6870
)

common_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/stretchr/testify/require"
89
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
910
sqle "gopkg.in/src-d/go-mysql-server.v0"
@@ -31,7 +32,7 @@ func setup(t *testing.T) (ctx *sql.Context, path string, cleanup CleanupFunc) {
3132
}
3233

3334
session := NewSession(&pool)
34-
ctx = sql.NewContext(context.TODO(), session)
35+
ctx = sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3536

3637
return ctx, path, cleanup
3738
}

integration_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/src-d/gitbase"
89
"github.com/src-d/gitbase/internal/function"
910
"github.com/stretchr/testify/require"
@@ -137,7 +138,7 @@ func TestIntegration(t *testing.T) {
137138
require := require.New(t)
138139

139140
session := gitbase.NewSession(&pool)
140-
ctx := sql.NewContext(context.TODO(), session)
141+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
141142

142143
_, iter, err := engine.Query(ctx, tt.query)
143144
require.NoError(err)

internal/function/commit_has_blob_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/src-d/gitbase"
89
"github.com/stretchr/testify/require"
910
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -28,7 +29,7 @@ func TestCommitHasBlob(t *testing.T) {
2829
}
2930

3031
session := gitbase.NewSession(&pool)
31-
ctx := sql.NewContext(context.TODO(), session)
32+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3233

3334
testCases := []struct {
3435
name string
@@ -73,7 +74,7 @@ func BenchmarkCommitHasBlob(b *testing.B) {
7374
}
7475

7576
session := gitbase.NewSession(&pool)
76-
ctx := sql.NewContext(context.TODO(), session)
77+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
7778

7879
rows := []sql.Row{
7980
// blob is not on commit

internal/function/commit_has_tree_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/src-d/gitbase"
89
"github.com/stretchr/testify/require"
910
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -28,7 +29,7 @@ func TestCommitHasTree(t *testing.T) {
2829
}
2930

3031
session := gitbase.NewSession(&pool)
31-
ctx := sql.NewContext(context.TODO(), session)
32+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3233

3334
testCases := []struct {
3435
name string
@@ -74,7 +75,7 @@ func BenchmarkCommitHasTree(b *testing.B) {
7475
}
7576

7677
session := gitbase.NewSession(&pool)
77-
ctx := sql.NewContext(context.TODO(), session)
78+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
7879

7980
rows := []sql.Row{
8081
// tree is not on commit

internal/function/history_idx_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/src-d/gitbase"
89
"github.com/stretchr/testify/require"
910
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
@@ -28,7 +29,7 @@ func TestHistoryIdx(t *testing.T) {
2829
}
2930

3031
session := gitbase.NewSession(&pool)
31-
ctx := sql.NewContext(context.TODO(), session)
32+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3233

3334
testCases := []struct {
3435
name string
@@ -81,7 +82,7 @@ func BenchmarkHistoryIdx(b *testing.B) {
8182
}
8283

8384
session := gitbase.NewSession(&pool)
84-
ctx := sql.NewContext(context.TODO(), session)
85+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
8586

8687
cases := []struct {
8788
row sql.Row

internal/function/is_remote_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/stretchr/testify/require"
89
"gopkg.in/src-d/go-mysql-server.v0/sql"
910
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -30,7 +31,7 @@ func TestIsRemote(t *testing.T) {
3031
require := require.New(t)
3132

3233
session := sql.NewBaseSession()
33-
ctx := sql.NewContext(context.TODO(), session)
34+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3435

3536
val, err := f.Eval(ctx, tt.row)
3637
if tt.err {

internal/function/is_tag_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/stretchr/testify/require"
89
"gopkg.in/src-d/go-mysql-server.v0/sql"
910
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -30,7 +31,7 @@ func TestIsTag(t *testing.T) {
3031
require := require.New(t)
3132

3233
session := sql.NewBaseSession()
33-
ctx := sql.NewContext(context.TODO(), session)
34+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
3435

3536
val, err := f.Eval(ctx, tt.row)
3637
if tt.err {

repositories_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
opentracing "github.com/opentracing/opentracing-go"
78
"github.com/stretchr/testify/require"
89
"gopkg.in/src-d/go-mysql-server.v0/sql"
910
"gopkg.in/src-d/go-mysql-server.v0/sql/expression"
@@ -43,7 +44,7 @@ func TestRepositoriesTable_RowIter(t *testing.T) {
4344
}
4445

4546
session := NewSession(&pool)
46-
ctx := sql.NewContext(context.TODO(), session)
47+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
4748

4849
db := NewDatabase(repositoriesTableName)
4950
require.NotNil(db)

repository_pool_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"sync"
1111
"testing"
1212

13+
opentracing "github.com/opentracing/opentracing-go"
1314
"github.com/stretchr/testify/require"
1415
"gopkg.in/src-d/go-git-fixtures.v3"
1516
"gopkg.in/src-d/go-git.v4"
@@ -188,7 +189,7 @@ func TestRepositoryRowIterator(t *testing.T) {
188189

189190
pool := NewRepositoryPool()
190191
session := NewSession(&pool)
191-
ctx := sql.NewContext(context.TODO(), session)
192+
ctx := sql.NewContext(context.TODO(), session, opentracing.NoopTracer{})
192193
max := 64
193194

194195
for i := 0; i < max; i++ {

0 commit comments

Comments
 (0)