diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index c663ada1d..9f6921cbf 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -722,9 +722,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,12 +748,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -762,9 +762,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,12 +775,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -788,8 +788,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -798,9 +798,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,22 +809,22 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'android', 'ios'], @@ -833,9 +833,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'ios'], @@ -844,7 +844,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,10 +883,10 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -894,8 +894,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -904,7 +904,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,9 +914,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['none', 'improvement'], @@ -925,17 +925,17 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -944,7 +944,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement'], @@ -961,12 +961,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ 'Platform(2)': ['macOS', 'Android'], - 'Sig(2)': ['Significant', 'Not Significant-'], + 'Sig(2)': ['SignificantS', 'Not SignificantNS'], 'Status(3)': ['No changes', 'Improvement', 'Regression'], }); @@ -997,26 +997,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, NS, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, NS, 24.00 %', + ' - Windows 10, -, , 1.2, S, 99.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Windows 10, -, , 2, , 98.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, NS, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, NS, 23.00 %', + ' - Windows 10, -, , 2, S, 98.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, NS, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, NS, 24.00 %', + ' - Windows 10, -, , 0.8, S, 99.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', ]); // It should have the "descending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1028,26 +1028,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Windows 10, -, , 2, , 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, NS, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, NS, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Windows 10, -, , 2, S, 98.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, NS, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, NS, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Windows 10, -, , 1.2, S, 99.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, NS, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, NS, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Windows 10, -, , 0.8, S, 99.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1060,28 +1060,28 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio }); await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'a11yr aria.html opt e10s fission stylo webrender', - ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - Windows 10, -, , 2, , 98.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', + ' rev: spam', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' rev: tictactoe', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1093,26 +1093,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Windows 10, -, , 2, , 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1127,26 +1127,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , -, , 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 2, , 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); @@ -1158,26 +1158,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Windows 10, -, , 2, , 98.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); // It should be persisted in the URL diff --git a/src/__tests__/CompareResults/RevisionRow.test.tsx b/src/__tests__/CompareResults/RevisionRow.test.tsx index ae86e4950..887545ff0 100644 --- a/src/__tests__/CompareResults/RevisionRow.test.tsx +++ b/src/__tests__/CompareResults/RevisionRow.test.tsx @@ -281,49 +281,6 @@ describe('Expanded row', () => { expect(cliffsDeltaHeader).toBeInTheDocument(); }); - it('should display mann_whitney_test.interpretation for significance for mann-whitney-u testVersion', async () => { - const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); - const { testCompareMannWhitneyData: rowData } = getTestData(); - - renderWithRoute( - , - ); - - const expandRowButton = await screen.findByTestId(/ExpandMoreIcon/); - await user.click(expandRowButton); - - const notSignificant = await screen.findAllByText(/Not significant/); - expect(notSignificant[0]).toBeInTheDocument(); - }); - - it('should handle empty mann_whitney_test.interpretation for significance for mann-whitney-u testVersion', async () => { - const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); - const { testCompareMannWhitneyData: rowData } = getTestData(); - const resultNoInterpretation = { ...rowData[0], mann_whitney_test: null }; - renderWithRoute( - , - ); - - const expandRowButton = await screen.findByTestId(/ExpandMoreIcon/); - await user.click(expandRowButton); - const emptySignificant = await screen.findAllByText(/-/); - expect(emptySignificant[0]).toBeInTheDocument(); - }); - it('should display median diff and 95% CI alerts when base/new runs are present', async () => { const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); const { testCompareMannWhitneyData: rowData } = getTestData(); diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 87e1b9081..1a86b53f1 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -527,11 +527,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting(); // Initial view (alphabetical ordered, even if "sort by subtests" isn't specified expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // Sort by Delta @@ -542,11 +542,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort descending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. @@ -557,11 +557,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort ascending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -574,11 +574,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "no sort" SVG. expect(deltaButton).toMatchSnapshot(); @@ -590,11 +590,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Significance ascending await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', ]); expectParameterToHaveValue('sort', 'significance|asc'); @@ -604,11 +604,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', ]); // It should have the "descending" SVG. @@ -619,11 +619,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Effect Size ascending await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', ]); expectParameterToHaveValue('sort', 'effects|asc'); }); @@ -632,11 +632,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta|asc' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', ]); // It should have the "ascending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -646,11 +646,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -659,11 +659,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( it('initializes the sort from the URL at load time for a descending sort', async () => { await setupForSorting({ extraParameters: 'sort=delta|desc' }); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); diff --git a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx index d8941e030..25ce9e6f7 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -193,8 +193,13 @@ describe('SubtestsRevisionRow Component', () => { const effects = roles[7]?.childNodes[0]; expect(effects).toHaveTextContent('60.00%'); + // The Sig cell renders lazily: when no CI has been cached on the row + // yet, it falls back to `mann_whitney_test.interpretation` from the + // backend. The fixture's interpretation is "significant", so the cell + // shows "S" here. First click on the Sig column header would trigger + // BCa and could flip this if the CI includes zero. const significanceCell = roles[8]; - expect(significanceCell?.querySelector('svg')).not.toBeNull(); + expect(significanceCell).toHaveTextContent('S'); const cliffs_delta = roles[6]?.childNodes[1]; expect(cliffs_delta).toHaveTextContent('0.02'); diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index dbd059e14..3adc84d11 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -824,7 +824,7 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- + S
- + S
- - + NS
- - + NS
- - - Significance (p-value) - - - - = - +9.00 + +8.74 ms (+1.5%) 95% CI [ - +0.00 + +3.57 , - +18.01 + +18.16 ]
@@ -332,12 +319,12 @@ exports[`Results View Should display Base, New and Common graphs with replicates : We are 95% confident the median difference is between - +0.00 + +3.57 and - +18.01 + +18.16 @@ -749,19 +736,6 @@ exports[`Results View Should display Base, New and Common graphs with tooltips 1 style="padding: 2px;" /> - - - Significance (p-value) - - - - : We are 95% confident the median difference is between - +3.27 + +3.57 and @@ -1979,7 +1953,7 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- + S
- + S
- + S
- - + NS
- - + NS
- + S
- + S
- + S
- - + NS
- - + NS
- + S
- + S
- + S
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
(BOOTSTRAP_SAMPLE_CAP); + const stride = values.length / BOOTSTRAP_SAMPLE_CAP; + for (let i = 0; i < BOOTSTRAP_SAMPLE_CAP; i++) { + out[i] = values[Math.floor(i * stride)]; + } + return out; +} + +// Resolve a row's KDE/BCa input sample set: prefer replicates over the +// aggregated runs. Mirrors RevisionRowExpandable's selection for the chart +// and KdeModesPanel so every view of the row uses the same underlying data. +// Returned arrays are NOT downsampled — callers feeding BCa should pass +// them through `downsampleForBootstrap` first. +function runsFor(result: MannWhitneyResultsItem): { + baseRuns: number[]; + newRuns: number[]; +} { + const baseRuns = + result.base_runs_replicates && result.base_runs_replicates.length + ? result.base_runs_replicates + : (result.base_runs ?? []); + const newRuns = + result.new_runs_replicates && result.new_runs_replicates.length + ? result.new_runs_replicates + : (result.new_runs ?? []); + return { baseRuns, newRuns }; +} + +/** + * Lazily compute (and cache) the bootstrap (BCa) [see + * src/utils/bootstrap-ci.ts#L163-L203] CI for the difference of medians + * on a single row. + * + * The lazy strategy: at load time we do NO BCa work (matches production + * speed). The Sig column's `matchesFunction`/`sortFunction`/cell-render + * call this helper as needed. Result is cached on `result.bootstrapCi` + * so the second click on the column is free. + * + * `undefined` vs `null`: + * - `undefined` ⇒ never computed + * - `null` ⇒ computed but couldn't produce a CI (< 2 samples) + * We check `=== undefined` instead of `?? null` to keep that distinction. + * + * Uses the replicates-preferred sample selection (via `runsFor`) and the + * downsampled-for-BCa cap so per-row cost stays bounded regardless of how + * many replicates the backend ships. See `BOOTSTRAP_SAMPLE_CAP` and + * `BOOTSTRAP_ITERATIONS` above. + */ +export function getBootstrapCi( + result: MannWhitneyResultsItem, +): BootstrapCI | null { + if (result.bootstrapCi !== undefined) return result.bootstrapCi; + const { baseRuns, newRuns } = runsFor(result); + const baseSamples = downsampleForBootstrap(baseRuns); + const newSamples = downsampleForBootstrap(newRuns); + const ci = + baseSamples.length >= 2 && newSamples.length >= 2 + ? bootstrapMedianDiffCI(baseSamples, newSamples, BOOTSTRAP_ITERATIONS) + : null; + result.bootstrapCi = ci; + return ci; +} + +// Decide whether the Sig cell should render "S" or "NS". +// +// Cell renders run for EVERY row on every render — we can't afford to +// compute BCa here at load time. So the cell uses whichever signal is +// available without forcing compute: +// - If the CI has been cached (filter/sort has been used, or the +// expanded-row alert ran), use it — keeps the column consistent with +// the rest of the UI on rows the user has engaged with. +// - Otherwise fall back to the backend's `mann_whitney_test.interpretation` +// — close to production's pre-branch behavior and free to read. +// +// First filter/sort click populates `bootstrapCi` for all rows; from then +// on the column reads the CI-based verdict everywhere. So you only see the +// fallback on first render before any Sig interaction. +function isSignificantForDisplay(result: MannWhitneyResultsItem): boolean { + if (result.bootstrapCi !== undefined) { + return result.bootstrapCi?.significant ?? false; + } + return result.mann_whitney_test?.interpretation === 'significant'; +} + export const mannWhitneyStrategy = { getColumns(isSubtestTable: boolean): TableConfig { const platformConfig = isSubtestTable @@ -222,25 +323,43 @@ export const mannWhitneyStrategy = { { label: 'Significant', key: 'significant', - icon: , + icon:
S
, }, { label: 'Not Significant', key: 'not significant', - icon:
-
, + icon:
NS
, }, ], matchesFunction(result: MannWhitneyResultsItem, valueKey: string) { - return result.mann_whitney_test?.interpretation === valueKey; + // Lazily compute and cache the CI on first filter-click. After + // that, the CI is read straight from `result.bootstrapCi` on + // every subsequent comparison/render (see getBootstrapCi above). + const ci = getBootstrapCi(result); + const isSig = ci?.significant ?? false; + return (isSig ? 'significant' : 'not significant') === valueKey; }, sortFunction( resultA: MannWhitneyResultsItem, resultB: MannWhitneyResultsItem, ) { - return ( - Math.abs(resultA.mann_whitney_test?.pvalue ?? 0) - - Math.abs(resultB.mann_whitney_test?.pvalue ?? 0) - ); + // ASC semantics — useTableSort swaps args for DESC. So in DESC mode + // this produces "significant first, then |medianDiff| desc"; in ASC + // mode the inverse. Significance is the primary key, magnitude the + // tie-breaker so the biggest changes float to the top of each group. + // + // First sort-click pays the BCa cost across all rows (the + // comparator is invoked O(n log n) times but each row is computed + // only once and cached via getBootstrapCi). Subsequent sorts are + // free. + const ciA = getBootstrapCi(resultA); + const ciB = getBootstrapCi(resultB); + const sigA = ciA?.significant ?? false; + const sigB = ciB?.significant ?? false; + if (sigA !== sigB) return sigA ? 1 : -1; + const magA = Math.abs(ciA?.medianDiff ?? 0); + const magB = Math.abs(ciB?.medianDiff ?? 0); + return magA - magB; }, }, @@ -264,17 +383,22 @@ export const mannWhitneyStrategy = { }, renderSubtestColumns(result: CombinedResultsItemType, expanded: boolean) { + const mwResult = result as MannWhitneyResultsItem; const { test, cliffs_delta, - mann_whitney_test, cles, direction_of_change, base_measurement_unit: baseUnit, new_measurement_unit: newUnit, base_app: baseApp, new_app: newApp, - } = result as MannWhitneyResultsItem; + } = mwResult; + // See `isSignificantForDisplay` above — uses the cached CI when one + // exists and falls back to the backend interpretation otherwise. + // Computing BCa here on every cell render would re-introduce the + // per-row load cost we just removed. + const sigDisplay = isSignificantForDisplay(mwResult) ? 'S' : 'NS'; const clesVal = ((cles?.cles ?? 0) * 100).toFixed(2); const baseAvgValue = (result as MannWhitneyResultsItem).base_standard_stats?.mean ?? 0; @@ -363,11 +487,7 @@ export const mannWhitneyStrategy = { {clesVal ? `${clesVal}% ` : '-'}
- {mann_whitney_test?.interpretation === 'significant' ? ( - - ) : ( - '-' - )} + {sigDisplay}
); @@ -403,17 +523,22 @@ export const mannWhitneyStrategy = { mann_whitney_u_cles: '', }; const { cliffs_delta, cliffs_interpretation } = mwResult; - const pValue = mwResult.mann_whitney_test?.pvalue; - const p_value_cles = mwResult.mann_whitney_test?.interpretation - ? capitalize(mwResult.mann_whitney_test.interpretation) - : ''; - const baseRuns = mwResult.base_runs ?? []; - const newRuns = mwResult.new_runs ?? []; - const ci = - baseRuns.length > 0 && newRuns.length > 0 - ? bootstrapMedianDiffCI(baseRuns, newRuns) + // Prefer the precomputed CI populated by the loader. Fall back to an + // inline compute for backwards compatibility (e.g. tests that mount the + // strategy without going through a loader, or stale results without the + // field). `baseRuns`/`newRuns` is the full replicates-preferred set + // (used for the median below); the BCa fallback runs on the capped + // downsample so it can't hang on rich-replicates rows. + const { baseRuns, newRuns } = runsFor(mwResult); + const ci = (() => { + if (mwResult.bootstrapCi !== undefined) return mwResult.bootstrapCi; + const baseSamples = downsampleForBootstrap(baseRuns); + const newSamples = downsampleForBootstrap(newRuns); + return baseSamples.length >= 2 && newSamples.length >= 2 + ? bootstrapMedianDiffCI(baseSamples, newSamples, BOOTSTRAP_ITERATIONS) : null; + })(); const rawUnit = mwResult.base_measurement_unit ?? mwResult.new_measurement_unit ?? 'ms'; const { fmt, displayUnit } = ci @@ -453,8 +578,6 @@ export const mannWhitneyStrategy = { @@ -480,14 +603,18 @@ export const mannWhitneyStrategy = { }, renderColumns(result: CombinedResultsItemType) { + const mwResult = result as MannWhitneyResultsItem; const { cliffs_delta, direction_of_change, - mann_whitney_test, cles, base_standard_stats, new_standard_stats, - } = result as MannWhitneyResultsItem; + } = mwResult; + // See `isSignificantForDisplay` — uses the cached CI if a filter/sort + // populated it, otherwise the backend's interpretation. Cell renders + // can't afford to trigger BCa on every row at load time. + const sigDisplay = isSignificantForDisplay(mwResult) ? 'S' : 'NS'; const clesValue = cles?.cles ? `${(cles.cles * 100).toFixed(2)} %` : '-'; const baseMedian = base_standard_stats?.median ?? 0; const newMedian = new_standard_stats?.median ?? 0; @@ -551,11 +678,7 @@ export const mannWhitneyStrategy = { {clesValue}
- {mann_whitney_test?.interpretation === 'significant' ? ( - - ) : ( - '-' - )} + {sigDisplay}
); diff --git a/src/components/CompareResults/PValCliffsDeltaComp.tsx b/src/components/CompareResults/PValCliffsDeltaComp.tsx index a430b63ac..9465d825f 100644 --- a/src/components/CompareResults/PValCliffsDeltaComp.tsx +++ b/src/components/CompareResults/PValCliffsDeltaComp.tsx @@ -5,21 +5,12 @@ import { capitalize } from '../../utils/helpers'; interface PValCliffsDeltaCompProps { cliffs_delta: number; cliffs_interpretation: string; - pValue: number | undefined | null; - p_value_cles: string; cles: number | string; cles_direction: string; } function PValCliffsDeltaComp(props: PValCliffsDeltaCompProps) { - const { - cliffs_delta, - cliffs_interpretation, - pValue, - p_value_cles, - cles, - cles_direction, - } = props; + const { cliffs_delta, cliffs_interpretation, cles, cles_direction } = props; return ( - - Significance (p-value) - {pValue} - {p_value_cles} - CLES {cles} diff --git a/src/components/CompareResults/loader.ts b/src/components/CompareResults/loader.ts index 06916b6e6..10ad9e944 100644 --- a/src/components/CompareResults/loader.ts +++ b/src/components/CompareResults/loader.ts @@ -197,6 +197,10 @@ export async function loader({ request }: { request: Request }) { const useFakeData = url.searchParams.has('fakedata'); if (useFakeData) { const results = await fetchAllFakeCompareResults(); + // No bootstrap CI precompute here — the Sig column lazily computes (and + // caches) on the first filter/sort interaction via `getBootstrapCi` in + // mannWhitney.tsx. Eagerly precomputing on every row was blocking the + // table render at load time. // They're all based on the same rev const baseRev = results[0][0].base_rev; // And the same repository @@ -293,6 +297,10 @@ export async function getComparisonInformation( testVersion, silvermanKDEEnabled, }); + // No bootstrap CI precompute here — see the lazy `getBootstrapCi` helper + // in mannWhitney.tsx. Eager precompute on every row was blocking table + // render; lazy compute defers the BCa cost to the first Sig filter/sort + // click (and caches per row from then on). // TODO what happens if there's no result? const baseRevInfoPromise = memoizedFetchRevisionForRepository({ diff --git a/src/components/CompareResults/overTimeLoader.ts b/src/components/CompareResults/overTimeLoader.ts index 206d04d04..2aa012276 100644 --- a/src/components/CompareResults/overTimeLoader.ts +++ b/src/components/CompareResults/overTimeLoader.ts @@ -229,6 +229,9 @@ export async function loader({ request }: { request: Request }) { testVersion, silvermanKDEEnabled, }); + // No bootstrap CI precompute — the Sig column lazily computes (and caches) + // via `getBootstrapCi` in mannWhitney.tsx on the first filter/sort click. + // Same change as the main loader, applied here to keep load time aligned. const newRevsInfoPromises = newRevs.map((newRev, i) => memoizedFetchRevisionForRepository({ diff --git a/src/components/CompareResults/subtestsLoader.ts b/src/components/CompareResults/subtestsLoader.ts index 2e381b7ea..f1aa44412 100644 --- a/src/components/CompareResults/subtestsLoader.ts +++ b/src/components/CompareResults/subtestsLoader.ts @@ -187,6 +187,9 @@ export function loader({ request }: { request: Request }) { testVersion, silvermanKDEEnabled, }); + // No bootstrap CI precompute — the Sig column lazily computes (and + // caches) on the first filter/sort interaction via `getBootstrapCi` in + // mannWhitney.tsx. Eager precompute was blocking table render at load. return { results, diff --git a/src/components/CompareResults/subtestsOverTimeLoader.tsx b/src/components/CompareResults/subtestsOverTimeLoader.tsx index 906926b21..415ec7469 100644 --- a/src/components/CompareResults/subtestsOverTimeLoader.tsx +++ b/src/components/CompareResults/subtestsOverTimeLoader.tsx @@ -213,6 +213,10 @@ export function loader({ request }: { request: Request }) { testVersion, silvermanKDEEnabled, }); + // No bootstrap CI precompute — the Sig column lazily computes (and + // caches) via `getBootstrapCi` in mannWhitney.tsx on the first + // filter/sort click. Same change as the other loaders to keep load + // time aligned with production. return { results, diff --git a/src/types/state.ts b/src/types/state.ts index 2091e09ef..b37182295 100644 --- a/src/types/state.ts +++ b/src/types/state.ts @@ -242,6 +242,10 @@ export type MannWhitneyResultsItem = { is_meaningful: boolean | null; more_runs_are_needed: boolean | null; warning_c_delta?: string | null; + // Bootstrap (BCa) [see src/utils/bootstrap-ci.ts#L163-L203] CI for the difference of medians. + // `null` means the CI couldn't be computed (e.g. + // missing base_runs/new_runs); callers treat that as "not significant". + bootstrapCi?: import('../utils/bootstrap-ci').BootstrapCI | null; /* Each test has a signature and each signature may or may not have a parent_signature. If a signature has a parent_signature then we are looking at a subtest. For regular tests this field will be null.