@@ -15,22 +15,6 @@ const auth = Buffer.from(`${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY}`).toString(
15
15
'base64' ,
16
16
) ;
17
17
18
- /**
19
- * @param {string } url
20
- * @return {Promise<boolean> }
21
- */
22
- async function isRemoteAssetOk ( url ) {
23
- try {
24
- const { ok, status, headers } = await fetch ( url ) ;
25
- const { 'Content-Length' : contentLength } = headers ;
26
- console . log ( `isRemoteAssetOk ${ url } ` , { ok, status, contentLength } ) ;
27
- return ok ;
28
- } catch ( err ) {
29
- console . error ( `Error on isRemoteAssetOk for ${ url } ` , err ) ;
30
- return false ;
31
- }
32
- }
33
-
34
18
async function collectSauceLabResults ( build ) {
35
19
try {
36
20
const buildJobs = await fetch (
@@ -60,7 +44,7 @@ async function collectSauceLabResults(build) {
60
44
const tests = await Promise . all (
61
45
buildJobs . map ( async buildJob => {
62
46
// just the file names, not absolute paths
63
- const assetBaseUrl = `https://${ SAUCE_USERNAME } : ${ SAUCE_ACCESS_KEY } @ assets.saucelabs.com/jobs/${ buildJob . id } ` ;
47
+ const assetBaseUrl = `https://assets.saucelabs.com/jobs/${ buildJob . id } ` ;
64
48
/** @type {{ 'sauce-log': string, 'video': string, 'selenium-log': string, screenshots: string[], 'video.mp4': string } } */
65
49
const assets = await fetch (
66
50
// https://wiki.saucelabs.com/display/DOCS/Job+Methods
@@ -104,17 +88,6 @@ async function collectSauceLabResults(build) {
104
88
}
105
89
} ) ;
106
90
return theAssets ;
107
- } )
108
- . then ( async allAssets => {
109
- return allAssets ;
110
- // not filtering them yet, just checking; perhaps requesting them will make them work for GitHub
111
- const validScreenshots = await Promise . all (
112
- allAssets . screenshots . map ( async s => ( {
113
- ...s ,
114
- ok : await isRemoteAssetOk ( s . url ) ,
115
- } ) ) ,
116
- ) ;
117
- return validScreenshots ;
118
91
} ) ;
119
92
120
93
return {
0 commit comments