From dc284e41addc40914b7af8bd4683d1d830754132 Mon Sep 17 00:00:00 2001 From: esanuandra <63001299+esanuandra@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:08:30 +0200 Subject: [PATCH] PCF-562 Consider adding the OS version to the name of the platform in the "Platform" column (#816) * Add os version * Refactor * Fix tests * Add os version on subtests * fix typescript error * Address code review, nit changes --- .../CompareResults/ResultsTable.test.tsx | 102 +++++++++--------- .../CompareResults/RevisionRow.test.tsx | 6 +- .../OverTimeResultsView.test.tsx.snap | 8 +- .../__snapshots__/ResultsTable.test.tsx.snap | 12 +-- .../__snapshots__/ResultsView.test.tsx.snap | 8 +- .../SubtestsResultsView.test.tsx.snap | 6 +- .../SubtestsRevisionHeader.tsx | 8 +- src/utils/platform.ts | 43 +++++++- 8 files changed, 116 insertions(+), 77 deletions(-) diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index bebbb018a..15a24956a 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -147,9 +147,9 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - OSX, Improvement, Low', + ' - OS X 10.15, Improvement, Low', ' rev: devilrabbit', - ' - OSX, Improvement, Low', + ' - OS X 10.15, Improvement, Low', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -165,10 +165,10 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ' - Android, Improvement, Low', ]); @@ -178,8 +178,8 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, /Windows/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', ' - Android, Improvement, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -189,7 +189,7 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, /Linux/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', + ' - OS X 10.15, Improvement, Low', ' - Android, Improvement, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -199,8 +199,8 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, /Linux/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', ' - Android, Improvement, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -210,10 +210,10 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, 'Select all values'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ' - Android, Improvement, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -221,9 +221,9 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, /OSX/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ' - Android, Improvement, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -233,9 +233,9 @@ describe('Results Table', () => { await clickMenuItem(user, /Platform/, /Android/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux'], @@ -258,10 +258,10 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -269,8 +269,8 @@ describe('Results Table', () => { await clickMenuItem(user, /Status/, /No changes/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -280,9 +280,9 @@ describe('Results Table', () => { await clickMenuItem(user, /Status/, /Improvement/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['none', 'regression'], @@ -291,8 +291,8 @@ describe('Results Table', () => { await clickMenuItem(user, /Status/, /Regression/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Windows, -, High', - ' - Windows, -, -', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['none'], @@ -301,7 +301,7 @@ describe('Results Table', () => { await clickMenuItem(user, /Status/, /Select only.*Regression/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', + ' - Linux 18.04, Regression, Medium', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -315,10 +315,10 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -326,9 +326,9 @@ describe('Results Table', () => { await clickMenuItem(user, /Confidence/, /Low/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ confidence: ['none', 'medium', 'high'], @@ -337,8 +337,8 @@ describe('Results Table', () => { await clickMenuItem(user, /Confidence/, /High/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux, Regression, Medium', - ' - Windows, -, -', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ confidence: ['none', 'medium'], @@ -347,7 +347,7 @@ describe('Results Table', () => { await clickMenuItem(user, /Confidence/, /Medium/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Windows, -, -', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ confidence: ['none'], @@ -356,19 +356,19 @@ describe('Results Table', () => { await clickMenuItem(user, /Confidence/, /Select all values/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', - ' - Windows, -, -', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', + ' - Windows 10, -, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, /Confidence/, /No value/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - OSX, Improvement, Low', - ' - Linux, Regression, Medium', - ' - Windows, -, High', + ' - OS X 10.15, Improvement, Low', + ' - Linux 18.04, Regression, Medium', + ' - Windows 10, -, High', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ confidence: ['low', 'medium', 'high'], @@ -377,7 +377,7 @@ describe('Results Table', () => { await clickMenuItem(user, /Confidence/, /Select only.*High/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Windows, -, High', + ' - Windows 10, -, High', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ confidence: ['high'], diff --git a/src/__tests__/CompareResults/RevisionRow.test.tsx b/src/__tests__/CompareResults/RevisionRow.test.tsx index f32552d40..2e4b1f661 100644 --- a/src/__tests__/CompareResults/RevisionRow.test.tsx +++ b/src/__tests__/CompareResults/RevisionRow.test.tsx @@ -29,17 +29,17 @@ describe('', () => { it.each([ { platform: 'linux1804-32-shippable-qr', - shortName: 'Linux', + shortName: 'Linux 18.04', hasIcon: true, }, { platform: 'macosx1014-64-shippable-qr', - shortName: 'OSX', + shortName: 'OS X 10.14', hasIcon: true, }, { platform: 'windows2012-64-shippable', - shortName: 'Windows', + shortName: 'Windows 2012', hasIcon: true, }, { diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index 8e69ea466..e54a3399f 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -506,7 +506,7 @@ exports[`Results View The table should match snapshot and other elements should /> - OSX + OS X 10.15 @@ -729,7 +729,7 @@ exports[`Results View The table should match snapshot and other elements should /> - Linux + Linux 18.04 @@ -953,7 +953,7 @@ exports[`Results View The table should match snapshot and other elements should - Windows + Windows 10 @@ -1166,7 +1166,7 @@ exports[`Results View The table should match snapshot and other elements should - Windows + Windows 10 diff --git a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap index 7680024cc..5384b1261 100644 --- a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap @@ -1230,7 +1230,7 @@ exports[`Results Table Should match snapshot 1`] = ` /> - OSX + OS X 10.15 @@ -1453,7 +1453,7 @@ exports[`Results Table Should match snapshot 1`] = ` /> - Linux + Linux 18.04 @@ -1677,7 +1677,7 @@ exports[`Results Table Should match snapshot 1`] = ` - Windows + Windows 10 @@ -1943,7 +1943,7 @@ exports[`Results Table Should match snapshot 1`] = ` - Windows + Windows 10 @@ -2224,7 +2224,7 @@ exports[`Results Table should render different blocks when rendering several rev /> - OSX + OS X 10.15 @@ -2460,7 +2460,7 @@ exports[`Results Table should render different blocks when rendering several rev /> - OSX + OS X 10.15 diff --git a/src/__tests__/CompareResults/__snapshots__/ResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/ResultsView.test.tsx.snap index bc4383898..d7fae9724 100644 --- a/src/__tests__/CompareResults/__snapshots__/ResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/ResultsView.test.tsx.snap @@ -1316,7 +1316,7 @@ exports[`Results View The table should match snapshot and other elements should /> - OSX + OS X 10.15 @@ -1539,7 +1539,7 @@ exports[`Results View The table should match snapshot and other elements should /> - Linux + Linux 18.04 @@ -1763,7 +1763,7 @@ exports[`Results View The table should match snapshot and other elements should - Windows + Windows 10 @@ -1976,7 +1976,7 @@ exports[`Results View The table should match snapshot and other elements should - Windows + Windows 10 diff --git a/src/__tests__/CompareResults/__snapshots__/SubtestsResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/SubtestsResultsView.test.tsx.snap index 1c18d8bf1..1a7973830 100644 --- a/src/__tests__/CompareResults/__snapshots__/SubtestsResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/SubtestsResultsView.test.tsx.snap @@ -222,9 +222,8 @@ exports[`SubtestsResultsView Component Tests should render the subtests results d="M15.6 8.1c0 .1-.1.1-.1.1h-.1c-.1 0-.1-.1-.2-.2 0 0-.1-.1-.1-.2s0-.1.1-.1l.2.1c.1.1.2.2.2.3m-1.9-1c0-.5-.2-.8-.5-.8 0 0 0 .1-.1.1v.2h.3c0 .2.1.3.1.5h.2m3.6-.5c.2 0 .3.2.4.5h.2c-.1-.1-.1-.2-.1-.3 0-.1 0-.2-.1-.3-.1-.1-.2-.2-.3-.2 0 0-.1.1-.2.1 0 .1.1.1.1.2m-3.1 1.6c-.1 0-.1 0-.1-.1s0-.2.1-.3c.2 0 .3-.1.3-.1.1 0 .1.1.1.1 0 .1-.1.2-.3.4h-.1m-1.1-.1c-.4-.2-.5-.5-.5-1 0-.3 0-.5.2-.7.1-.2.3-.3.5-.3s.3.1.5.3c.1.3.2.6.2.9v.2h.1v-.1c.1 0 .1-.2.1-.6 0-.3 0-.6-.2-.9-.2-.3-.4-.5-.8-.5-.3 0-.6.2-.7.5-.2.4-.2.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components/CompareResults/SubtestsResults/SubtestsRevisionHeader.tsx index 56d196301..6a1a3e6c4 100644 --- a/src/components/CompareResults/SubtestsResults/SubtestsRevisionHeader.tsx +++ b/src/components/CompareResults/SubtestsResults/SubtestsRevisionHeader.tsx @@ -20,7 +20,10 @@ import { truncateHash, getDocsURL, } from '../../../utils/helpers'; -import { getPlatformShortName } from '../../../utils/platform'; +import { + getPlatformAndVersion, + getPlatformShortName, +} from '../../../utils/platform'; import AndroidIcon from '../../Shared/Icons/AndroidIcon'; import LinuxIcon from '../../Shared/Icons/LinuxIcon'; import WindowsIcon from '../../Shared/Icons/WindowsIcon'; @@ -151,7 +154,8 @@ function SubtestsRevisionHeader(props: SubtestsRevisionHeaderProps) { {getSuite(header, docsURL, isLinkSupported)} | {baseInfo} {getRevLink(header.new_rev, header.new_repo, '- New')} | {framework} |{' '} - {platformIcon} {platformShortName} |{' '} + {platformIcon} + {getPlatformAndVersion(header.platform)} |{' '}
{header.option_name} diff --git a/src/utils/platform.ts b/src/utils/platform.ts index 4a90465cc..7034c690e 100644 --- a/src/utils/platform.ts +++ b/src/utils/platform.ts @@ -14,12 +14,49 @@ export const getPlatformShortName = ( return 'Unspecified'; }; +// Link to the os examples that were used +// https://github.com/mozilla/treeherder/blob/master/ui/helpers/constants.js#L29 +const osMapping = { + linux64: 'Linux x64', + linux1804: 'Linux 18.04', + linux2204: 'Linux 22.04', + osx: 'OS X', + macosx1014: 'OS X 10.14', + macosx1015: 'OS X 10.15', + macosx1100: 'OS X 11', + macosx1300: 'macOS 13', + macosx1400: 'macOS 14.00', + macosx1470: 'macOS 14.70', + win32: 'Windows x86', + win64: 'Windows x64', + windows7: 'Windows 7', + windows10: 'Windows 10', + windows11: 'Windows 11', + windows2012: 'Windows 2012', + windows: 'Windows', +}; + +type PlatformOS = keyof typeof osMapping; + +const extractPlatformWithOs = (platform: string) => { + const system = platform.split('-')[0]; + + if (system in osMapping) { + return osMapping[system as PlatformOS]; + } + + return getPlatformShortName(platform); +}; + export const getPlatformAndVersion = (platform: string): string => { - const platformShortName = getPlatformShortName(platform); // Example of android platform, the split is specific for this platform // Other platforms are built differently // android-hw-p6-13-0-android-aarch64-shippable-qr - if (platform.startsWith('android-hw-')) + if (platform.startsWith('android-hw-')) { + const platformShortName = getPlatformShortName(platform); + return `${platformShortName}\u00a0${platform.split('-')[2]}`; - return platformShortName; + } + + return extractPlatformWithOs(platform); };