diff --git a/multidim-interop/src/generator.ts b/multidim-interop/src/generator.ts index 525ea5c..9e0f4ec 100644 --- a/multidim-interop/src/generator.ts +++ b/multidim-interop/src/generator.ts @@ -8,7 +8,7 @@ function buildExtraEnv(timeoutOverride: { [key: string]: number }, test1ID: stri return maxTimeout > 0 ? { "test_timeout_seconds": maxTimeout.toString(10) } : {} } -export async function buildTestSpecs(versions: Array, nameFilter: string | null): Promise> { +export async function buildTestSpecs(versions: Array, nameFilter: string | null, nameIgnore: string | null): Promise> { const containerImages: { [key: string]: () => string } = {} const timeoutOverride: { [key: string]: number } = {} versions.forEach(v => containerImages[v.id] = () => { @@ -86,7 +86,7 @@ export async function buildTestSpecs(versions: Array, nameFilter: strin muxer: test.muxer, security: test.sec, extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2) - }, nameFilter) + }, nameFilter, nameIgnore) )).concat( standaloneTransportsQueryResults .map((test): ComposeSpecification => buildSpec(containerImages, { @@ -95,15 +95,18 @@ export async function buildTestSpecs(versions: Array, nameFilter: strin listenerID: test.id2, transport: test.transport, extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2) - }, nameFilter))).filter((spec): spec is ComposeSpecification => spec !== null) + }, nameFilter, nameIgnore))).filter((spec): spec is ComposeSpecification => spec !== null) return testSpecs } -function buildSpec(containerImages: { [key: string]: () => string }, { name, dialerID, listenerID, transport, muxer, security, extraEnv }: { name: string, dialerID: string, listenerID: string, transport: string, muxer?: string, security?: string, extraEnv?: { [key: string]: string } }, nameFilter: string | null): ComposeSpecification | null { +function buildSpec(containerImages: { [key: string]: () => string }, { name, dialerID, listenerID, transport, muxer, security, extraEnv }: { name: string, dialerID: string, listenerID: string, transport: string, muxer?: string, security?: string, extraEnv?: { [key: string]: string } }, nameFilter: string | null, nameIgnore: string | null): ComposeSpecification | null { if (nameFilter && !name.includes(nameFilter)) { return null } + if (nameIgnore && name.includes(nameIgnore)) { + return null + } return { name, services: { diff --git a/multidim-interop/testplans.ts b/multidim-interop/testplans.ts index fe2f190..6fbed6e 100644 --- a/multidim-interop/testplans.ts +++ b/multidim-interop/testplans.ts @@ -12,7 +12,11 @@ import path from "path"; const argv = await yargs(process.argv.slice(2)) .options({ 'name-filter': { - description: 'Only run named test', + description: 'Only run tests including this name', + default: "", + }, + 'name-ignore': { + description: 'Do not run any tests including this name ', default: "", }, 'emit-only': { @@ -60,7 +64,11 @@ import path from "path"; if (nameFilter === "") { nameFilter = null } - let testSpecs = await buildTestSpecs(versions.concat(extraVersions), nameFilter) + let nameIgnore: string | null = argv["name-ignore"] + if (nameIgnore === "") { + nameIgnore = null + } + let testSpecs = await buildTestSpecs(versions.concat(extraVersions), nameFilter, nameIgnore) if (argv["emit-only"]) {