diff --git a/go.mod b/go.mod index 8550732..8109c6a 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module github.com/grafana/k6provider go 1.22.4 require ( - github.com/grafana/k6build v0.4.0 + github.com/grafana/k6build v0.5.0 github.com/grafana/k6deps v0.1.8 ) require ( github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/evanw/esbuild v0.24.0 // indirect - github.com/grafana/k6catalog v0.2.3 // indirect + github.com/grafana/k6catalog v0.2.4 // indirect github.com/grafana/k6foundry v0.3.0 // indirect github.com/grafana/k6pack v0.2.3 // indirect golang.org/x/mod v0.21.0 // indirect diff --git a/go.sum b/go.sum index ab0267c..d6a839e 100644 --- a/go.sum +++ b/go.sum @@ -6,10 +6,10 @@ github.com/evanw/esbuild v0.24.0 h1:GZ78naTLp7FKr+K7eNuM/SLs5maeiHYRPsTg6kmdsSE= github.com/evanw/esbuild v0.24.0/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48= 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/k6build v0.4.0 h1:HSWmacenUqeyWd+4syxFJzqPwC6Ke1mf7JJMwr7rzOM= -github.com/grafana/k6build v0.4.0/go.mod h1:9e3IPYKatismMUV3Oq0V7auStNxoiVuiuk2uZrmRqhg= -github.com/grafana/k6catalog v0.2.3 h1:Gol46qra9yjPYSrxLj6CDKcdY/DUEprM4Xd4TCNPkfA= -github.com/grafana/k6catalog v0.2.3/go.mod h1:ozCf9+KBw63lNrRiZtp7CvzA7V0ATQuOQN2IoG2irw4= +github.com/grafana/k6build v0.5.0 h1:eeq+vcvRbA/DeoRYLhKLXbgESITBh0uyTXYhAjlQ9Bc= +github.com/grafana/k6build v0.5.0/go.mod h1:ATaInvRPNPmM+M6CAgprPBFCIZkn6c2GA8s2KPurbEM= +github.com/grafana/k6catalog v0.2.4 h1:P5wdlqz2APGZhe6qinwQCZXe+z/Rm65VQ7zP/djb4Ng= +github.com/grafana/k6catalog v0.2.4/go.mod h1:nYzfIw6c3o1CEN1YlbUAkqtzIK2hoNWYF0lfYOk+RPg= github.com/grafana/k6deps v0.1.8 h1:8ZrkAQR8aWQlYPoRlEqbWVHghhGpSHtOQ42fBL++cmo= github.com/grafana/k6deps v0.1.8/go.mod h1:8szhtnOzNmxwOzJ2diu+wPc9J2Vxvq69Lcyh2WvdVA8= github.com/grafana/k6foundry v0.3.0 h1:C+6dPbsOv7Uq4hEhBFNuYqmTdE9jQ0VqhXqBDtMkVTE= diff --git a/provider_test.go b/provider_test.go index cec3a67..77d48d9 100644 --- a/provider_test.go +++ b/provider_test.go @@ -11,10 +11,12 @@ import ( "path/filepath" "testing" - "github.com/grafana/k6build/pkg/local" + "github.com/grafana/k6build/pkg/builder" "github.com/grafana/k6build/pkg/server" + "github.com/grafana/k6build/pkg/store/client" filestore "github.com/grafana/k6build/pkg/store/file" storesrv "github.com/grafana/k6build/pkg/store/server" + "github.com/grafana/k6catalog" "github.com/grafana/k6deps" ) @@ -42,11 +44,6 @@ func Test_Provider(t *testing.T) { //nolint:paralleltest // 2. start an object store server storeSrv := httptest.NewServer(storesrv.NewStoreServer(storeConfig)) - buildConfig := local.BuildServiceConfig{ - Catalog: "testdata/catalog.json", - CopyGoEnv: true, - StoreURL: storeSrv.URL, - } // 3. start a download proxy storeURL, _ := url.Parse(storeSrv.URL) @@ -55,7 +52,24 @@ func Test_Provider(t *testing.T) { //nolint:paralleltest defer proxy.Close() // 4. configure a local builder - builder, err := local.NewBuildService(context.TODO(), buildConfig) + storeClient, err := client.NewStoreClient(client.StoreClientConfig{Server: storeSrv.URL}) + if err != nil { + t.Fatalf("store client setup %v", err) + } + catalog, err := k6catalog.NewCatalog(context.TODO(), "testdata/catalog.json") + if err != nil { + t.Fatalf("build server setup %v", err) + } + buildConfig := builder.Config{ + Opts: builder.Opts{ + GoOpts: builder.GoOpts{ + CopyGoEnv: true, + }, + }, + Catalog: catalog, + Store: storeClient, + } + builder, err := builder.New(context.TODO(), buildConfig) if err != nil { t.Fatalf("setup %v", err) }