cherry-pick(#21830): chore(ui): use test backlog when chaining
This commit is contained in:
parent
497c89dcfb
commit
e75fe015cf
|
|
@ -75,6 +75,7 @@ export const WatchModeView: React.FC<{}> = ({
|
||||||
const [watchAll, setWatchAll] = useSetting<boolean>('watch-all', false);
|
const [watchAll, setWatchAll] = useSetting<boolean>('watch-all', false);
|
||||||
const [watchedTreeIds, setWatchedTreeIds] = React.useState<{ value: Set<string> }>({ value: new Set() });
|
const [watchedTreeIds, setWatchedTreeIds] = React.useState<{ value: Set<string> }>({ value: new Set() });
|
||||||
const runTestPromiseChain = React.useRef(Promise.resolve());
|
const runTestPromiseChain = React.useRef(Promise.resolve());
|
||||||
|
const runTestBacklog = React.useRef<Set<string>>(new Set());
|
||||||
|
|
||||||
const inputRef = React.useRef<HTMLInputElement>(null);
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
|
@ -117,7 +118,13 @@ export const WatchModeView: React.FC<{}> = ({
|
||||||
if (mode === 'bounce-if-busy' && runningState)
|
if (mode === 'bounce-if-busy' && runningState)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
runTestBacklog.current = new Set([...runTestBacklog.current, ...testIds]);
|
||||||
runTestPromiseChain.current = runTestPromiseChain.current.then(async () => {
|
runTestPromiseChain.current = runTestPromiseChain.current.then(async () => {
|
||||||
|
const testIds = runTestBacklog.current;
|
||||||
|
runTestBacklog.current = new Set();
|
||||||
|
if (!testIds.size)
|
||||||
|
return;
|
||||||
|
|
||||||
// Clear test results.
|
// Clear test results.
|
||||||
{
|
{
|
||||||
for (const test of testModel.rootSuite?.allTests() || []) {
|
for (const test of testModel.rootSuite?.allTests() || []) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue