Skip to content

Commit

Permalink
Merge pull request #27 from grafana/update-k6build
Browse files Browse the repository at this point in the history
update k6build to v0.3.0
  • Loading branch information
szkiba authored Aug 29, 2024
2 parents aa2e3fd + 5904200 commit a34efde
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 5 additions & 3 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"syscall"

"github.com/grafana/k6build"
"github.com/grafana/k6build/pkg/client"
"github.com/grafana/k6build/pkg/local"
"github.com/grafana/k6deps"
)

Expand Down Expand Up @@ -84,19 +86,19 @@ func newLocalBuildService(ctx context.Context, opts *Options) (k6build.BuildServ
return nil, err
}

conf := k6build.LocalBuildServiceConfig{
conf := local.BuildServiceConfig{
BuildEnv: map[string]string{"GOWORK": "off"},
Catalog: catfile,
CopyGoEnv: true,
CacheDir: filepath.Join(cachedir, "build"),
Verbose: slog.Default().Enabled(ctx, slog.LevelDebug),
}

return k6build.NewLocalBuildService(ctx, conf)
return local.NewBuildService(ctx, conf)
}

func newBuildServiceClient(opts *Options) (k6build.BuildService, error) {
return k6build.NewBuildServiceClient(k6build.BuildServiceClientConfig{
return client.NewBuildServiceClient(client.BuildServiceClientConfig{
URL: opts.BuildServiceURL.String(),
})
}
Expand Down
7 changes: 4 additions & 3 deletions build_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
"strings"
"testing"

"github.com/grafana/k6build"
"github.com/grafana/k6build/pkg/client"

"github.com/grafana/k6deps"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -59,8 +60,8 @@ func Test_newBuildService(t *testing.T) {
svc, err := newBuildService(context.Background(), opts)

require.NoError(t, err)
require.IsType(t, new(k6build.BuildClient), svc)
require.Equal(t, "*k6build.BuildClient", fmt.Sprintf("%T", svc))
require.IsType(t, new(client.BuildClient), svc)
require.Equal(t, "*client.BuildClient", fmt.Sprintf("%T", svc))

srv := testWebServer(t)
defer srv.Close()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.4
require (
github.com/adrg/xdg v0.5.0
github.com/grafana/clireadme v0.1.0
github.com/grafana/k6build v0.2.3
github.com/grafana/k6build v0.3.0
github.com/grafana/k6deps v0.1.4
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/samber/slog-logrus/v2 v2.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/grafana/clireadme v0.1.0 h1:KYEYSnYdSzmHf3bufaK6fQZ5j4dzvM/T+G6Ba+qNnAM=
github.com/grafana/clireadme v0.1.0/go.mod h1:Wy4KIG2ZBGMYAYyF9l7qAy+yoJVasqk/txsRgoRI3gc=
github.com/grafana/k6build v0.2.3 h1:nRNfOZbIABcoOgqOs+PWbzGVPbG6wWbwN8dACfF5mFo=
github.com/grafana/k6build v0.2.3/go.mod h1:LOlIAeWzZWR3Zff3Q6o4/spO2ROhvkLws8OgmEgGmVA=
github.com/grafana/k6build v0.3.0 h1:Td2GHtjqm8UhNBQnLEZvn/d9QOUvdrmWRNxj0QVy6/8=
github.com/grafana/k6build v0.3.0/go.mod h1:FPyo1ROpcST4zR4v0U+OcZQvairv+vIn4dKnHxHMCic=
github.com/grafana/k6catalog v0.1.0 h1:jLmbmB3EUJ+zyQG3hWy6dWbtMjvTkvJNx1d4LX8it6I=
github.com/grafana/k6catalog v0.1.0/go.mod h1:8R9eXAh2nb69+drkj0rZ4aemso0jcwCbPP6Q3E5LqCw=
github.com/grafana/k6deps v0.1.4 h1:rFlp2IMTSNk2RuztIfy17X5MO6HbQ6EebgvKvVPg+Po=
Expand Down

0 comments on commit a34efde

Please sign in to comment.