|
85 | 85 | for (const name in metadata.plugins) { |
86 | 86 | const cases = yaml |
87 | 87 | .load(fs.readFileSync(path.join(__dirname, "../source/plugins", name, "tests.yml"), "utf8")) |
88 | | - .map(({name:test, with:inputs, modes = []}) => { |
| 88 | + .map(({name:test, with:inputs, modes = [], timeout}) => { |
89 | 89 | const skip = new Set(Object.entries(metadata.templates).filter(([_, {readme:{compatibility}}]) => !compatibility[name]).map(([template]) => template)) |
90 | 90 | if (!(metadata.plugins[name].supports.includes("repository"))) |
91 | 91 | skip.add("repository") |
92 | | - return [test, inputs, {skip:[...skip], modes}] |
| 92 | + return [test, inputs, {skip:[...skip], modes, timeout}] |
93 | 93 | }) |
94 | 94 | tests.push(...cases) |
95 | 95 | } |
|
101 | 101 | ["terminal", {}], |
102 | 102 | ["repository", {repo:"metrics"}], |
103 | 103 | ])("Template : %s", (template, query) => { |
104 | | - for (const [name, input, {skip = [], modes = []} = {}] of tests) |
| 104 | + for (const [name, input, {skip = [], modes = []} = {}, timeout] of tests) |
105 | 105 | if ((skip.includes(template))||((modes.length)&&(!modes.includes("action")))) |
106 | 106 | test.skip(name, () => null) |
107 | 107 | else |
108 | | - test(name, async () => expect(await action.run({template, base:"", query:JSON.stringify(query), plugins_errors_fatal:true, dryrun:true, use_mocked_data:true, verify:true, ...input})).toBe(true)) |
| 108 | + test(name, async () => expect(await action.run({template, base:"", query:JSON.stringify(query), plugins_errors_fatal:true, dryrun:true, use_mocked_data:true, verify:true, ...input})).toBe(true), timeout) |
109 | 109 | }) |
110 | 110 | ) |
111 | 111 |
|
|
115 | 115 | ["terminal", {}], |
116 | 116 | ["repository", {repo:"metrics"}], |
117 | 117 | ])("Template : %s", (template, query) => { |
118 | | - for (const [name, input, {skip = [], modes = []} = {}] of tests) |
| 118 | + for (const [name, input, {skip = [], modes = []} = {}, timeout] of tests) |
119 | 119 | if ((skip.includes(template))||((modes.length)&&(!modes.includes("web")))) |
120 | 120 | test.skip(name, () => null) |
121 | 121 | else |
122 | | - test(name, async () => expect(await web.run({template, base:0, ...query, plugins_errors_fatal:true, verify:true, ...input})).toBe(true)) |
| 122 | + test(name, async () => expect(await web.run({template, base:0, ...query, plugins_errors_fatal:true, verify:true, ...input})).toBe(true), timeout) |
123 | 123 | }) |
124 | 124 | ) |
125 | 125 |
|
|
128 | 128 | ["classic", {}], |
129 | 129 | ["terminal", {}], |
130 | 130 | ])("Template : %s", (template, query) => { |
131 | | - for (const [name, input, {skip = [], modes = []} = {}] of tests) |
| 131 | + for (const [name, input, {skip = [], modes = []} = {}, timeout] of tests) |
132 | 132 | if ((skip.includes(template))||((modes.length)&&(!modes.includes("placeholder")))) |
133 | 133 | test.skip(name, () => null) |
134 | 134 | else |
135 | | - test(name, async () => expect(await placeholder.run({template, base:0, ...query, ...input})).toBe(true)) |
| 135 | + test(name, async () => expect(await placeholder.run({template, base:0, ...query, ...input})).toBe(true), timeout) |
136 | 136 | }) |
137 | 137 | ) |
0 commit comments