@@ -66,7 +66,7 @@ type releaseTestDeps struct {
66
66
versionTasks * task.VersionTasks
67
67
buildTasks * BuildReleaseTasks
68
68
milestoneTasks * task.MilestoneTasks
69
- publishedFiles map [string ]* WebsiteFile
69
+ publishedFiles map [string ]* task. WebsiteFile
70
70
outputListener func (taskName string , output interface {})
71
71
}
72
72
@@ -115,8 +115,8 @@ func newReleaseTestDeps(t *testing.T, wantVersion string) *releaseTestDeps {
115
115
116
116
// Set up the fake website to publish to.
117
117
var filesMu sync.Mutex
118
- files := map [string ]* WebsiteFile {}
119
- publishFile := func (f * WebsiteFile ) error {
118
+ files := map [string ]* task. WebsiteFile {}
119
+ publishFile := func (f * task. WebsiteFile ) error {
120
120
filesMu .Lock ()
121
121
defer filesMu .Unlock ()
122
122
files [strings .TrimPrefix (f .Filename , wantVersion + "." )] = f
@@ -197,20 +197,20 @@ func testRelease(t *testing.T, wantVersion string, kind task.ReleaseKind) {
197
197
}
198
198
199
199
dlURL , files := deps .buildTasks .DownloadURL , deps .publishedFiles
200
- checkTGZ (t , dlURL , files , "src.tar.gz" , & WebsiteFile {
200
+ checkTGZ (t , dlURL , files , "src.tar.gz" , & task. WebsiteFile {
201
201
OS : "" ,
202
202
Arch : "" ,
203
203
Kind : "source" ,
204
204
}, map [string ]string {
205
205
"go/VERSION" : wantVersion ,
206
206
"go/src/make.bash" : makeScript ,
207
207
})
208
- checkContents (t , dlURL , files , "windows-amd64.msi" , & WebsiteFile {
208
+ checkContents (t , dlURL , files , "windows-amd64.msi" , & task. WebsiteFile {
209
209
OS : "windows" ,
210
210
Arch : "amd64" ,
211
211
Kind : "installer" ,
212
212
}, "I'm an MSI!\n " )
213
- checkTGZ (t , dlURL , files , "linux-amd64.tar.gz" , & WebsiteFile {
213
+ checkTGZ (t , dlURL , files , "linux-amd64.tar.gz" , & task. WebsiteFile {
214
214
OS : "linux" ,
215
215
Arch : "amd64" ,
216
216
Kind : "archive" ,
@@ -219,23 +219,23 @@ func testRelease(t *testing.T, wantVersion string, kind task.ReleaseKind) {
219
219
"go/tool/something_orother/compile" : "" ,
220
220
"go/pkg/something_orother/race.a" : "" ,
221
221
})
222
- checkZip (t , dlURL , files , "windows-arm64.zip" , & WebsiteFile {
222
+ checkZip (t , dlURL , files , "windows-arm64.zip" , & task. WebsiteFile {
223
223
OS : "windows" ,
224
224
Arch : "arm64" ,
225
225
Kind : "archive" ,
226
226
}, map [string ]string {
227
227
"go/VERSION" : wantVersion ,
228
228
"go/tool/something_orother/compile" : "" ,
229
229
})
230
- checkTGZ (t , dlURL , files , "linux-armv6l.tar.gz" , & WebsiteFile {
230
+ checkTGZ (t , dlURL , files , "linux-armv6l.tar.gz" , & task. WebsiteFile {
231
231
OS : "linux" ,
232
232
Arch : "armv6l" ,
233
233
Kind : "archive" ,
234
234
}, map [string ]string {
235
235
"go/VERSION" : wantVersion ,
236
236
"go/tool/something_orother/compile" : "" ,
237
237
})
238
- checkContents (t , dlURL , files , "darwin-amd64.pkg" , & WebsiteFile {
238
+ checkContents (t , dlURL , files , "darwin-amd64.pkg" , & task. WebsiteFile {
239
239
OS : "darwin" ,
240
240
Arch : "amd64" ,
241
241
Kind : "installer" ,
@@ -312,7 +312,7 @@ func testSecurity(t *testing.T, mergeFixes bool) {
312
312
runToFailure (t , deps .ctx , w , "Check branch state matches source archive" , & verboseListener {t , deps .outputListener })
313
313
return
314
314
}
315
- checkTGZ (t , deps .buildTasks .DownloadURL , deps .publishedFiles , "src.tar.gz" , & WebsiteFile {
315
+ checkTGZ (t , deps .buildTasks .DownloadURL , deps .publishedFiles , "src.tar.gz" , & task. WebsiteFile {
316
316
OS : "" ,
317
317
Arch : "" ,
318
318
Kind : "source" ,
@@ -465,13 +465,13 @@ func serveTarball(pathMatch string, files map[string]string, w http.ResponseWrit
465
465
}
466
466
}
467
467
468
- func checkFile (t * testing.T , dlURL string , files map [string ]* WebsiteFile , filename string , meta * WebsiteFile , check func (* testing.T , []byte )) {
468
+ func checkFile (t * testing.T , dlURL string , files map [string ]* task. WebsiteFile , filename string , meta * task. WebsiteFile , check func (* testing.T , []byte )) {
469
469
t .Run (filename , func (t * testing.T ) {
470
470
f , ok := files [filename ]
471
471
if ! ok {
472
472
t .Fatalf ("file %q not published" , filename )
473
473
}
474
- if diff := cmp .Diff (meta , f , cmpopts .IgnoreFields (WebsiteFile {}, "Filename" , "Version" , "ChecksumSHA256" , "Size" )); diff != "" {
474
+ if diff := cmp .Diff (meta , f , cmpopts .IgnoreFields (task. WebsiteFile {}, "Filename" , "Version" , "ChecksumSHA256" , "Size" )); diff != "" {
475
475
t .Errorf ("file metadata mismatch (-want +got):\n %v" , diff )
476
476
}
477
477
resp , err := http .Get (dlURL + "/" + f .Filename )
@@ -486,15 +486,15 @@ func checkFile(t *testing.T, dlURL string, files map[string]*WebsiteFile, filena
486
486
})
487
487
}
488
488
489
- func checkContents (t * testing.T , dlURL string , files map [string ]* WebsiteFile , filename string , meta * WebsiteFile , contents string ) {
489
+ func checkContents (t * testing.T , dlURL string , files map [string ]* task. WebsiteFile , filename string , meta * task. WebsiteFile , contents string ) {
490
490
checkFile (t , dlURL , files , filename , meta , func (t * testing.T , b []byte ) {
491
491
if got , want := string (b ), contents ; got != want {
492
492
t .Errorf ("%v contains %q, want %q" , filename , got , want )
493
493
}
494
494
})
495
495
}
496
496
497
- func checkTGZ (t * testing.T , dlURL string , files map [string ]* WebsiteFile , filename string , meta * WebsiteFile , contents map [string ]string ) {
497
+ func checkTGZ (t * testing.T , dlURL string , files map [string ]* task. WebsiteFile , filename string , meta * task. WebsiteFile , contents map [string ]string ) {
498
498
checkFile (t , dlURL , files , filename , meta , func (t * testing.T , b []byte ) {
499
499
gzr , err := gzip .NewReader (bytes .NewReader (b ))
500
500
if err != nil {
@@ -528,7 +528,7 @@ func checkTGZ(t *testing.T, dlURL string, files map[string]*WebsiteFile, filenam
528
528
})
529
529
}
530
530
531
- func checkZip (t * testing.T , dlURL string , files map [string ]* WebsiteFile , filename string , meta * WebsiteFile , contents map [string ]string ) {
531
+ func checkZip (t * testing.T , dlURL string , files map [string ]* task. WebsiteFile , filename string , meta * task. WebsiteFile , contents map [string ]string ) {
532
532
checkFile (t , dlURL , files , filename , meta , func (t * testing.T , b []byte ) {
533
533
zr , err := zip .NewReader (bytes .NewReader (b ), int64 (len (b )))
534
534
if err != nil {
0 commit comments