Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/src/components/case.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Prop {
githubState: Map<string, any>;
}

const getRate = (
export const getRate = (
commits: SiteCommitTooltip[],
includeFlaky: boolean = false
) => {
Expand Down
9 changes: 8 additions & 1 deletion js/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TestCase from "../components/case";
import StatsPane from "../components/stat";
import { SiteDisplayRoot } from "../interface";
import rawData from "../data.json";

import { getRate } from "../components/case";
const displayData = rawData as SiteDisplayRoot;

export const query = graphql`
Expand Down Expand Up @@ -74,6 +74,13 @@ const App: React.FC<PageProps<DataProps>> = ({ data, location }) => {
testsToDisplay = testsToDisplay.filter(t => t.name.indexOf("release://") == -1);
}

// Sort by failure rate (highest first)
testsToDisplay = testsToDisplay.sort((a, b) => {
const rateA = getRate(a.status_segment_bar, false);
const rateB = getRate(b.status_segment_bar, false);
return rateB - rateA;
});

let numHidden = 0;
if (!showAll) {
numHidden = testsToDisplay.length - 100;
Expand Down