Testing: fix metrics job on push to trunk (#48893)

This PR fixes a failure in CI jobs (performance testing results publishing). The fix introduces a fallback path for the artifacts folder, similar to the command that performs the testing.
This commit is contained in:
Vladimir Reznichenko 2024-06-28 13:50:01 +02:00 committed by GitHub
parent c70750b85a
commit 8382731a57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 6 deletions

View File

@ -15,14 +15,11 @@ const resultsFiles = [
metricsPrefix: 'product-editor-',
},
];
const ARTIFACTS_PATH =
process.env.WP_ARTIFACTS_PATH || path.join( process.cwd(), 'artifacts' );
const performanceResults = resultsFiles.map( ( { file } ) =>
JSON.parse(
fs.readFileSync(
path.join( process.env.WP_ARTIFACTS_PATH, file ),
'utf8'
)
)
JSON.parse( fs.readFileSync( path.join( ARTIFACTS_PATH, file ), 'utf8' ) )
);
const data = new TextEncoder().encode(