99 "strings"
1010 "testing"
1111
12+ "github.com/bazelbuild/bazelisk/config"
1213 "github.com/bazelbuild/bazelisk/core"
1314 "github.com/bazelbuild/bazelisk/httputil"
1415 "github.com/bazelbuild/bazelisk/repositories"
@@ -42,7 +43,7 @@ func TestResolveVersion(t *testing.T) {
4243
4344 gcs := & repositories.GCSRepo {}
4445 repos := core .CreateRepositories (nil , gcs , nil , nil , nil , false )
45- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.0.0" )
46+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.0.0" , config . Null () )
4647
4748 if err != nil {
4849 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -60,7 +61,7 @@ func TestResolvePatchVersion(t *testing.T) {
6061
6162 gcs := & repositories.GCSRepo {}
6263 repos := core .CreateRepositories (nil , gcs , nil , nil , nil , false )
63- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.0.0-patch1" )
64+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.0.0-patch1" , config . Null () )
6465
6566 if err != nil {
6667 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -82,7 +83,7 @@ func TestResolveLatestRcVersion(t *testing.T) {
8283
8384 gcs := & repositories.GCSRepo {}
8485 repos := core .CreateRepositories (nil , gcs , nil , nil , nil , false )
85- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "last_rc" )
86+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "last_rc" , config . Null () )
8687
8788 if err != nil {
8889 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -100,7 +101,7 @@ func TestResolveLatestRcVersion_WithFullRelease(t *testing.T) {
100101
101102 gcs := & repositories.GCSRepo {}
102103 repos := core .CreateRepositories (nil , gcs , nil , nil , nil , false )
103- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "last_rc" )
104+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "last_rc" , config . Null () )
104105
105106 if err != nil {
106107 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -120,7 +121,7 @@ func TestResolveLatestVersion_TwoLatestVersionsDoNotHaveAReleaseYet(t *testing.T
120121
121122 gcs := & repositories.GCSRepo {}
122123 repos := core .CreateRepositories (gcs , nil , nil , nil , nil , false )
123- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest" )
124+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest" , config . Null () )
124125
125126 if err != nil {
126127 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -142,7 +143,7 @@ func TestResolveLatestVersion_ShouldOnlyReturnStableReleases(t *testing.T) {
142143
143144 gcs := & repositories.GCSRepo {}
144145 repos := core .CreateRepositories (gcs , nil , nil , nil , nil , false )
145- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest-1" )
146+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest-1" , config . Null () )
146147
147148 if err != nil {
148149 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
@@ -161,7 +162,7 @@ func TestResolveLatestVersion_ShouldFailIfNotEnoughReleases(t *testing.T) {
161162
162163 gcs := & repositories.GCSRepo {}
163164 repos := core .CreateRepositories (gcs , nil , nil , nil , nil , false )
164- _ , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest-1" )
165+ _ , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest-1" , config . Null () )
165166
166167 if err == nil {
167168 t .Fatal ("Expected ResolveVersion() to fail." )
@@ -178,7 +179,7 @@ func TestResolveLatestVersion_GCSIsDown(t *testing.T) {
178179
179180 gcs := & repositories.GCSRepo {}
180181 repos := core .CreateRepositories (gcs , nil , nil , nil , nil , false )
181- _ , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest" )
182+ _ , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "latest" , config . Null () )
182183
183184 if err == nil {
184185 t .Fatal ("Expected resolveLatestVersion() to fail." )
@@ -196,7 +197,7 @@ func TestResolveLatestVersion_GitHubIsDown(t *testing.T) {
196197 gh := repositories .CreateGitHubRepo ("test_token" )
197198 repos := core .CreateRepositories (nil , nil , gh , nil , nil , false )
198199
199- _ , _ , err := repos .ResolveVersion (tmpDir , "some_fork" , "latest" )
200+ _ , _ , err := repos .ResolveVersion (tmpDir , "some_fork" , "latest" , config . Null () )
200201
201202 if err == nil {
202203 t .Fatal ("Expected resolveLatestVersion() to fail." )
@@ -212,7 +213,7 @@ func TestAcceptRollingReleaseName(t *testing.T) {
212213 repos := core .CreateRepositories (nil , nil , nil , nil , gcs , false )
213214
214215 for _ , version := range []string {"10.0.0-pre.20201103.4" , "10.0.0-pre.20201103.4.2" } {
215- resolvedVersion , _ , err := repos .ResolveVersion (tmpDir , "" , version )
216+ resolvedVersion , _ , err := repos .ResolveVersion (tmpDir , "" , version , config . Null () )
216217
217218 if err != nil {
218219 t .Fatalf ("ResolveVersion(%q, \" \" , %q): expected no error, but got %v" , tmpDir , version , err )
@@ -233,7 +234,7 @@ func TestResolveLatestRollingRelease(t *testing.T) {
233234 gcs := & repositories.GCSRepo {}
234235 repos := core .CreateRepositories (nil , nil , nil , nil , gcs , false )
235236
236- version , _ , err := repos .ResolveVersion (tmpDir , "" , rollingReleaseIdentifier )
237+ version , _ , err := repos .ResolveVersion (tmpDir , "" , rollingReleaseIdentifier , config . Null () )
237238
238239 if err != nil {
239240 t .Fatalf ("ResolveVersion(%q, \" \" , %q): expected no error, but got %v" , tmpDir , rollingReleaseIdentifier , err )
@@ -257,7 +258,7 @@ func TestAcceptFloatingReleaseVersions(t *testing.T) {
257258
258259 gcs := & repositories.GCSRepo {}
259260 repos := core .CreateRepositories (gcs , nil , nil , nil , nil , false )
260- version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.x" )
261+ version , _ , err := repos .ResolveVersion (tmpDir , versions .BazelUpstream , "4.x" , config . Null () )
261262
262263 if err != nil {
263264 t .Fatalf ("Version resolution failed unexpectedly: %v" , err )
0 commit comments