propagate --onlyChanged through UI

This commit is contained in:
Simon Knott 2024-07-17 16:24:44 +02:00
parent 2251e6a6d2
commit 7bb2780760
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
5 changed files with 8 additions and 0 deletions

View file

@ -39,6 +39,7 @@ export type TraceViewerRedirectOptions = {
args?: string[]; args?: string[];
grep?: string; grep?: string;
grepInvert?: string; grepInvert?: string;
onlyChanged?: string;
project?: string[]; project?: string[];
workers?: number | string; workers?: number | string;
headed?: boolean; headed?: boolean;
@ -123,6 +124,8 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
params.append('grep', options.grep); params.append('grep', options.grep);
if (options.grepInvert) if (options.grepInvert)
params.append('grepInvert', options.grepInvert); params.append('grepInvert', options.grepInvert);
if (options.onlyChanged)
params.append('onlyChanged', options.onlyChanged);
for (const project of options.project || []) for (const project of options.project || [])
params.append('project', project); params.append('project', project);
if (options.workers) if (options.workers)

View file

@ -88,6 +88,7 @@ export interface TestServerInterface {
locations?: string[]; locations?: string[];
grep?: string; grep?: string;
grepInvert?: string; grepInvert?: string;
onlyChanged?: string;
testIds?: string[]; testIds?: string[];
headed?: boolean; headed?: boolean;
workers?: number | string; workers?: number | string;

View file

@ -179,6 +179,7 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
args, args,
grep: opts.grep as string | undefined, grep: opts.grep as string | undefined,
grepInvert: opts.grepInvert as string | undefined, grepInvert: opts.grepInvert as string | undefined,
onlyChanged: getOnlyChangedArg(opts.onlyChanged),
project: opts.project || undefined, project: opts.project || undefined,
headed: opts.headed, headed: opts.headed,
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : undefined, reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : undefined,

View file

@ -335,6 +335,7 @@ class TestServerDispatcher implements TestServerInterface {
config.cliArgs = params.locations || []; config.cliArgs = params.locations || [];
config.cliGrep = params.grep; config.cliGrep = params.grep;
config.cliGrepInvert = params.grepInvert; config.cliGrepInvert = params.grepInvert;
config.cliOnlyChanged = params.onlyChanged;
config.cliProjectFilter = params.projects?.length ? params.projects : undefined; config.cliProjectFilter = params.projects?.length ? params.projects : undefined;
config.testIdMatcher = testIdSet ? id => testIdSet.has(id) : undefined; config.testIdMatcher = testIdSet ? id => testIdSet.has(id) : undefined;

View file

@ -56,6 +56,7 @@ const queryParams = {
args: searchParams.getAll('arg'), args: searchParams.getAll('arg'),
grep: searchParams.get('grep') || undefined, grep: searchParams.get('grep') || undefined,
grepInvert: searchParams.get('grepInvert') || undefined, grepInvert: searchParams.get('grepInvert') || undefined,
onlyChanged: searchParams.get('onlyChanged') || undefined,
projects: searchParams.getAll('project'), projects: searchParams.getAll('project'),
workers: searchParams.get('workers') || undefined, workers: searchParams.get('workers') || undefined,
timeout: searchParams.has('timeout') ? +searchParams.get('timeout')! : undefined, timeout: searchParams.has('timeout') ? +searchParams.get('timeout')! : undefined,
@ -282,6 +283,7 @@ export const UIModeView: React.FC<{}> = ({
locations: queryParams.args, locations: queryParams.args,
grep: queryParams.grep, grep: queryParams.grep,
grepInvert: queryParams.grepInvert, grepInvert: queryParams.grepInvert,
onlyChanged: queryParams.onlyChanged,
testIds: [...testIds], testIds: [...testIds],
projects: [...projectFilters].filter(([_, v]) => v).map(([p]) => p), projects: [...projectFilters].filter(([_, v]) => v).map(([p]) => p),
workers: queryParams.workers, workers: queryParams.workers,