Add tests for web instance
This commit is contained in:
@@ -195,26 +195,19 @@
|
||||
const die = bool(core.getInput("plugins_errors_fatal"))
|
||||
console.log(`Plugin errors │ ${die ? "die" : "warn"}`)
|
||||
|
||||
//Verify svg
|
||||
const verify = bool(core.getInput("verify"))
|
||||
console.log(`Verify SVG │ ${verify}`)
|
||||
|
||||
//Build query
|
||||
const query = JSON.parse(core.getInput("query") || "{}")
|
||||
console.log(`Query additional params │ ${JSON.stringify(query)}`)
|
||||
q = {...query, ...q, base:false, ...base, ...config, repositories, template}
|
||||
|
||||
//Render metrics
|
||||
const rendered = await metrics({login:user, q, dflags}, {graphql, rest, plugins, conf, die}, {Plugins, Templates})
|
||||
const rendered = await metrics({login:user, q, dflags}, {graphql, rest, plugins, conf, die, verify}, {Plugins, Templates})
|
||||
console.log(`Render │ complete`)
|
||||
|
||||
//Verify svg
|
||||
const verify = bool(core.getInput("verify"))
|
||||
console.log(`Verify SVG │ ${verify}`)
|
||||
if (verify) {
|
||||
const [libxmljs] = [await import("libxmljs")].map(m => (m && m.default) ? m.default : m)
|
||||
const parsed = libxmljs.parseXml(rendered)
|
||||
if (parsed.errors.length)
|
||||
throw new Error(`Malformed SVG : \n${parsed.errors.join("\n")}`)
|
||||
console.log(`SVG valid │ yes`)
|
||||
}
|
||||
|
||||
//Commit to repository
|
||||
const dryrun = bool(core.getInput("dryrun"))
|
||||
if (dryrun)
|
||||
|
||||
Reference in New Issue
Block a user