Skip to content

Commit f68548d

Browse files
committed
fix: removing auth-ed attempt at image loading
1 parent 22a3ead commit f68548d

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

scripts/report-nightwatch-results.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@ const auth = Buffer.from(`${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY}`).toString(
1515
'base64',
1616
);
1717

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-
3418
async function collectSauceLabResults(build) {
3519
try {
3620
const buildJobs = await fetch(
@@ -60,7 +44,7 @@ async function collectSauceLabResults(build) {
6044
const tests = await Promise.all(
6145
buildJobs.map(async buildJob => {
6246
// 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}`;
6448
/** @type {{ 'sauce-log': string, 'video': string, 'selenium-log': string, screenshots: string[], 'video.mp4': string }} */
6549
const assets = await fetch(
6650
// https://wiki.saucelabs.com/display/DOCS/Job+Methods
@@ -104,17 +88,6 @@ async function collectSauceLabResults(build) {
10488
}
10589
});
10690
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;
11891
});
11992

12093
return {

0 commit comments

Comments
 (0)