multidim-interop: Add name ignore option (#225)
* Add name ignore option * Update multidim-interop/testplans.ts Co-authored-by: Thomas Eizinger <thomas@eizinger.io> --------- Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
parent
ba8169f189
commit
81e78aed34
|
@ -8,7 +8,7 @@ function buildExtraEnv(timeoutOverride: { [key: string]: number }, test1ID: stri
|
||||||
return maxTimeout > 0 ? { "test_timeout_seconds": maxTimeout.toString(10) } : {}
|
return maxTimeout > 0 ? { "test_timeout_seconds": maxTimeout.toString(10) } : {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function buildTestSpecs(versions: Array<Version>, nameFilter: string | null): Promise<Array<ComposeSpecification>> {
|
export async function buildTestSpecs(versions: Array<Version>, nameFilter: string | null, nameIgnore: string | null): Promise<Array<ComposeSpecification>> {
|
||||||
const containerImages: { [key: string]: () => string } = {}
|
const containerImages: { [key: string]: () => string } = {}
|
||||||
const timeoutOverride: { [key: string]: number } = {}
|
const timeoutOverride: { [key: string]: number } = {}
|
||||||
versions.forEach(v => containerImages[v.id] = () => {
|
versions.forEach(v => containerImages[v.id] = () => {
|
||||||
|
@ -86,7 +86,7 @@ export async function buildTestSpecs(versions: Array<Version>, nameFilter: strin
|
||||||
muxer: test.muxer,
|
muxer: test.muxer,
|
||||||
security: test.sec,
|
security: test.sec,
|
||||||
extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2)
|
extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2)
|
||||||
}, nameFilter)
|
}, nameFilter, nameIgnore)
|
||||||
)).concat(
|
)).concat(
|
||||||
standaloneTransportsQueryResults
|
standaloneTransportsQueryResults
|
||||||
.map((test): ComposeSpecification => buildSpec(containerImages, {
|
.map((test): ComposeSpecification => buildSpec(containerImages, {
|
||||||
|
@ -95,15 +95,18 @@ export async function buildTestSpecs(versions: Array<Version>, nameFilter: strin
|
||||||
listenerID: test.id2,
|
listenerID: test.id2,
|
||||||
transport: test.transport,
|
transport: test.transport,
|
||||||
extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2)
|
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
|
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)) {
|
if (nameFilter && !name.includes(nameFilter)) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
if (nameIgnore && name.includes(nameIgnore)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
services: {
|
services: {
|
||||||
|
|
|
@ -12,7 +12,11 @@ import path from "path";
|
||||||
const argv = await yargs(process.argv.slice(2))
|
const argv = await yargs(process.argv.slice(2))
|
||||||
.options({
|
.options({
|
||||||
'name-filter': {
|
'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: "",
|
default: "",
|
||||||
},
|
},
|
||||||
'emit-only': {
|
'emit-only': {
|
||||||
|
@ -60,7 +64,11 @@ import path from "path";
|
||||||
if (nameFilter === "") {
|
if (nameFilter === "") {
|
||||||
nameFilter = null
|
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"]) {
|
if (argv["emit-only"]) {
|
||||||
|
|
Loading…
Reference in New Issue