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
1 change: 1 addition & 0 deletions doc/newsfragments/3668_changed.add_unstable_counter.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added an unstable counter (xpass + xfail) alongside the passed/failed counter in web UI.
7 changes: 6 additions & 1 deletion testplan/web_ui/testing/src/Common/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ const STATUS_CATEGORY = {
error: "error",
failed: "failed",
incomplete: "failed",
"xpass-strict": "failed",
passed: "passed",
skipped: "unstable",
xfail: "unstable",
xpass: "unstable",
"xpass-strict": "unstable",
unstable: "unstable",
unknown: "unknown",
};
Expand Down Expand Up @@ -288,6 +288,10 @@ const FILTER_STATUS_GROUPS = [

const FILTER_STATUSES = FILTER_STATUS_GROUPS.flatMap((g) => g.statuses);

const NAV_ENTRY_TOOLTIPS = {
testcaseCounter: "passed/unstable/failed testcases",
};

export {
BLUE,
DARK_BLUE,
Expand Down Expand Up @@ -338,4 +342,5 @@ export {
LOCALHOST,
FILTER_STATUS_GROUPS,
FILTER_STATUSES,
NAV_ENTRY_TOOLTIPS,
};
9 changes: 8 additions & 1 deletion testplan/web_ui/testing/src/Nav/InteractiveNavEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
RUNTIME_STATUS,
ENV_STATUSES,
NAV_ENTRY_ACTIONS,
NAV_ENTRY_TOOLTIPS,
} from "../Common/defaults";
import { navStyles } from "../Common/Styles";
import { generateNavTimeInfo, GetStatusIcon } from "./navUtils";
Expand Down Expand Up @@ -109,9 +110,13 @@ const InteractiveNavEntry = (props) => {
</span>
<span className={
css(navStyles.entryIcon)
} title="passed/failed testcases">
} title={NAV_ENTRY_TOOLTIPS.testcaseCounter}>
<span className={css(navStyles.passed)}>{props.caseCountPassed}</span>
/
<span className={css(navStyles.unstable)}>
{props.caseCountUnstable}
</span>
/
<span className={css(navStyles.failed)}>{props.caseCountFailed}</span>
</span>
{resetReportIcon}
Expand Down Expand Up @@ -440,6 +445,8 @@ InteractiveNavEntry.propTypes = {
type: PropTypes.oneOf(ENTRY_TYPES),
/** Number of passing testcases entry has */
caseCountPassed: PropTypes.number,
/** Number of unstable (xpass + xfail + skipped) testcases entry has */
caseCountUnstable: PropTypes.number,
/** Number of failing testcases entry has */
caseCountFailed: PropTypes.number,
/** Execution time measured in seconds */
Expand Down
7 changes: 6 additions & 1 deletion testplan/web_ui/testing/src/Nav/NavBreadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { statusStyles } from "../Common/Styles";
import { generateURLWithParameters } from "../Common/utils";
import { isReportLeaf } from "../Report/reportUtils";
import { computeUnstableCount, computeFailedCount } from "./navUtils";

library.add(faHome);

Expand Down Expand Up @@ -212,8 +213,12 @@ const MenuEntry = (props) => {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span className={classes.passed}>{props.counter.passed}</span>
<span className={classes.unknown}>/</span>
<span className={classes.unstable}>
{computeUnstableCount(props.counter)}
</span>
<span className={classes.unknown}>/</span>
<span className={classes.failed}>
{props.counter.failed + (props.counter.error || 0)}
{computeFailedCount(props.counter)}
</span>
</>
);
Expand Down
9 changes: 8 additions & 1 deletion testplan/web_ui/testing/src/Nav/NavEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ENTRY_TYPES,
STATUS,
STATUS_CATEGORY,
NAV_ENTRY_TOOLTIPS,
} from "../Common/defaults";
import { navStyles } from "../Common/Styles";
import { generateNavTimeInfo, GetStatusIcon } from "./navUtils";
Expand Down Expand Up @@ -70,9 +71,13 @@ const NavEntry = (props) => {
</span>
<span className={
css(navStyles.entryIcon)
} title="passed/failed testcases">
} title={NAV_ENTRY_TOOLTIPS.testcaseCounter}>
<span className={css(navStyles.passed)}>{props.caseCountPassed}</span>
/
<span className={css(navStyles.unstable)}>
{props.caseCountUnstable}
</span>
/
<span className={css(navStyles.failed)}>{props.caseCountFailed}</span>
</span>
</div>
Expand All @@ -91,6 +96,8 @@ NavEntry.propTypes = {
type: PropTypes.oneOf(ENTRY_TYPES),
/** Number of passing testcases entry has */
caseCountPassed: PropTypes.number,
/** Number of unstable (xpass + xfail + skipped) testcases entry has */
caseCountUnstable: PropTypes.number,
/** Number of failing testcases entry has */
caseCountFailed: PropTypes.number,
/** Execution time measured in seconds */
Expand Down
13 changes: 10 additions & 3 deletions testplan/web_ui/testing/src/Nav/NavList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import base64url from "base64url";

import InteractiveNavEntry from "./InteractiveNavEntry";
import NavEntry from "./NavEntry";
import { CreateNavButtons, GetNavColumn } from "./navUtils.js";
import {
CreateNavButtons,
GetNavColumn,
computeUnstableCount,
computeFailedCount,
} from "./navUtils.js";
import { STATUS, RUNTIME_STATUS, NAV_ENTRY_ACTIONS, CATEGORIES } from "../Common/defaults";
import { calcExecutionTime, calcElapsedTime } from "./../Common/utils";

Expand All @@ -26,7 +31,8 @@ const NavList = (props) => {
envStatus={entry.env_status}
type={entry.category}
caseCountPassed={entry.counter.passed}
caseCountFailed={entry.counter.failed + (entry.counter.error || 0)}
caseCountUnstable={computeUnstableCount(entry.counter)}
caseCountFailed={computeFailedCount(entry.counter)}
handleClick={(e, action) => props.handleClick(e, entry, action)}
envCtrlCallback={(e, action) =>
props.envCtrlCallback(e, entry, action)
Expand All @@ -51,7 +57,8 @@ const NavList = (props) => {
status={entry.status}
type={entry.category}
caseCountPassed={entry.counter.passed}
caseCountFailed={entry.counter.failed + (entry.counter.error || 0)}
caseCountUnstable={computeUnstableCount(entry.counter)}
caseCountFailed={computeFailedCount(entry.counter)}
executionTime={calcExecutionTime(entry)}
setupTime={calcElapsedTime(entry?.timer?.setup)}
teardownTime={calcElapsedTime(entry?.timer?.teardown)}
Expand Down
12 changes: 9 additions & 3 deletions testplan/web_ui/testing/src/Nav/TreeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import { css, StyleSheet } from "aphrodite";
import Column from "./Column";
import NavEntry from "./NavEntry";
import InteractiveNavEntry from "./InteractiveNavEntry";
import { applyAllFilters } from "./navUtils";
import {
applyAllFilters,
computeUnstableCount,
computeFailedCount,
} from "./navUtils";
import {
STATUS,
MEDIUM_GREY,
Expand Down Expand Up @@ -340,7 +344,8 @@ const createNavEntry = (props, entry) => {
envStatus={entry.env_status}
type={entry.category}
caseCountPassed={entry.counter.passed}
caseCountFailed={entry.counter.failed + (entry.counter.error || 0)}
caseCountUnstable={computeUnstableCount(entry.counter)}
caseCountFailed={computeFailedCount(entry.counter)}
handleClick={(e, action) => props.handleClick(e, entry, action)}
envCtrlCallback={(e, action) => props.envCtrlCallback(e, entry, action)}
suiteRelated={entry.category === CATEGORIES.synthesized}
Expand All @@ -359,7 +364,8 @@ const createNavEntry = (props, entry) => {
status={entry.status}
type={entry.category}
caseCountPassed={entry.counter.passed}
caseCountFailed={entry.counter.failed + (entry.counter.error || 0)}
caseCountUnstable={computeUnstableCount(entry.counter)}
caseCountFailed={computeFailedCount(entry.counter)}
executionTime={calcExecutionTime(entry)}
setupTime={calcElapsedTime(entry?.timer?.setup)}
teardownTime={calcElapsedTime(entry?.timer?.teardown)}
Expand Down
Loading
Loading