fix(ci): запускать вложенные профили тестов backend
Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 10m55s
Docker images / frontend-image (push) Successful in 4m15s
Docker images / updater-image (push) Successful in 2m10s
Docker images / netflow-agent-image (push) Successful in 33s
Docker images / backend-image (push) Successful in 21m15s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s
Docker images / prepare-release (push) Successful in 11s
Docker images / backend-test (push) Successful in 10m55s
Docker images / frontend-image (push) Successful in 4m15s
Docker images / updater-image (push) Successful in 2m10s
Docker images / netflow-agent-image (push) Successful in 33s
Docker images / backend-image (push) Successful in 21m15s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s
This commit is contained in:
1 parent
44afc7982c
commit
f45b0f6afc
1 file changed
+7
-4
@@ -3,10 +3,13 @@ import { spawnSync } from "node:child_process"
|
||||
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"))
|
||||
const npmCli = process.env.npm_execpath
|
||||
if (!npmCli) throw new Error("Запускайте тесты через npm --prefix backend test")
|
||||
for (const command of pkg.scripts["test:all"].split(/\s*&&\s*/)) {
|
||||
const match = /^npm run (test:[\w-]+)$/.exec(command)
|
||||
if (!match) throw new Error("Неизвестный формат профиля backend tests")
|
||||
const result = spawnSync(process.execPath, [npmCli, "run", match[1]], {
|
||||
const profiles = pkg.scripts["test:all"].split(/\s*&&\s*/).map(command => {
|
||||
const match = /^npm run (test:[\w-]+(?::[\w-]+)*)$/.exec(command)
|
||||
if (!match || !Object.hasOwn(pkg.scripts, match[1])) throw new Error(`Неизвестный профиль тестов backend: ${command}`)
|
||||
return match[1]
|
||||
})
|
||||
for (const profile of profiles) {
|
||||
const result = spawnSync(process.execPath, [npmCli, "run", profile], {
|
||||
cwd: new URL("../", import.meta.url),
|
||||
env: { ...process.env, NODE_ENV: "test" },
|
||||
stdio: "inherit",
|
||||
|
||||
Reference in new issue
Block a user