feat(scripts): add an ignore file for the explain script
Some of our existing stored procedures fail in the explain script but we don't want those failures to show up. In the future we may have reasons for wanting to ignore other procedures too. This change lets us ignore them while still running the script in CI.
This commit is contained in:
Родитель
9e9457c39a
Коммит
b90688cbc0
|
@ -0,0 +1,4 @@
|
||||||
|
accountEmails_4
|
||||||
|
fetchVerificationReminders_2
|
||||||
|
prune_7
|
||||||
|
sessionWithDevice_15
|
|
@ -68,7 +68,9 @@ Mysql(log, require('../db-server').errors)
|
||||||
.then(db => {
|
.then(db => {
|
||||||
return populateDatabase(db, 0)
|
return populateDatabase(db, 0)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
const ignore = parseIgnoreFile()
|
||||||
return getProcedureNames()
|
return getProcedureNames()
|
||||||
|
.filter(procedure => ! ignore.has(procedure))
|
||||||
.map(procedure => ({
|
.map(procedure => ({
|
||||||
procedure,
|
procedure,
|
||||||
path: getPath(procedure)
|
path: getPath(procedure)
|
||||||
|
@ -272,6 +274,15 @@ function createAccountResetToken (db, uid, tokenId) {
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseIgnoreFile () {
|
||||||
|
return new Set(
|
||||||
|
fs.readFileSync('.explain-ignore', RETURN_STRING)
|
||||||
|
.split('\n')
|
||||||
|
.map(procedure => procedure.trim())
|
||||||
|
.filter(procedure => !! procedure)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function getProcedureNames () {
|
function getProcedureNames () {
|
||||||
return cp.execSync(
|
return cp.execSync(
|
||||||
// eslint-disable-next-line quotes
|
// eslint-disable-next-line quotes
|
||||||
|
|
Загрузка…
Ссылка в новой задаче