devops: prepare flakiness dashboard cloud function to Android tests (#6129)

This commit is contained in:
Andrey Lushnikov 2021-04-07 14:09:17 -05:00 committed by GitHub
parent 09c175914e
commit 0c00891b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,11 +63,15 @@ function compressReports(reports) {
// In our case, all data will be identical - so pick // In our case, all data will be identical - so pick
// from the first result. // from the first result.
const testParameters = test.results[0].data; const testParameters = test.results[0].data;
// Overwrite test platform parameter with a more specific information from // Prefer test platform when it exists, and fallback to
// build run. // the host platform when it doesn't. This way we can attribute
const osName = report.metadata.osName.toUpperCase().startsWith('MINGW') ? 'Windows' : report.metadata.osName; // android tests to android.
const arch = report.metadata.arch && !report.metadata.arch.includes('x86') ? report.metadata.arch : ''; let platform = testParameters.platform;
const platform = (osName + ' ' + report.metadata.osVersion + ' ' + arch).trim(); if (!platform) {
const osName = report.metadata.osName.toUpperCase().startsWith('MINGW') ? 'Windows' : report.metadata.osName;
const arch = report.metadata.arch && !report.metadata.arch.includes('x86') ? report.metadata.arch : '';
platform = (osName + ' ' + report.metadata.osVersion + ' ' + arch).trim();
}
const browserName = testParameters.browserName || 'N/A'; const browserName = testParameters.browserName || 'N/A';
const testName = getTestName(browserName, platform, testParameters); const testName = getTestName(browserName, platform, testParameters);