Skip to content

Commit

Permalink
fix: artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyoboieltr committed Dec 17, 2024
1 parent d46960d commit 2e703a4
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions development/metamaskbot-build-announce.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node

const { promises: fs } = require('fs');
const path = require('path');
// Fetch is part of node js in future versions, thus triggering no-shadow
// eslint-disable-next-line no-shadow
const fetch = require('node-fetch');
Expand Down Expand Up @@ -199,14 +197,12 @@ async function start() {

const benchmarkResults = {};
for (const platform of platforms) {
const benchmarkPath = path.resolve(
__dirname,
'..',
path.join('test-artifacts', platform, 'benchmark', 'pageload.json'),
);
try {
const data = await fs.readFile(benchmarkPath, 'utf8');
const benchmark = JSON.parse(data);
const benchmark = await (
await fetch(
`https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/${platform}/benchmark/pageload.json`,
)
).json();
benchmarkResults[platform] = benchmark;
} catch (error) {
if (error.code === 'ENOENT') {
Expand Down Expand Up @@ -303,22 +299,12 @@ async function start() {
}

try {
const prBundleSizeStats = JSON.parse(
await fs.readFile(
path.resolve(
__dirname,
'..',
path.join('test-artifacts', 'chrome', 'bundle_size.json'),
),
'utf-8',
),
);

const devBundleSizeStats = await (
await fetch(bundleSizeDataUrl, {
method: 'GET',
})
const prBundleSizeStats = await (
await fetch(
`https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json`,
)
).json();
const devBundleSizeStats = await (await fetch(bundleSizeDataUrl)).json();

const prSizes = {
background: prBundleSizeStats.background.size,
Expand Down

0 comments on commit 2e703a4

Please sign in to comment.