Skip to content

Commit e9c26db

Browse files
committed
test: assert managed PHPUnit execution output
1 parent f759769 commit e9c26db

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/disposable-mysql-mysqli.integration.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ final class ManagedMultisiteTest extends WP_UnitTestCase {
254254
assert.equal(multisiteResult.success, true, JSON.stringify({ error: multisiteFailure.error, executions: multisiteResult.executions }))
255255
const latest = JSON.parse(await readFile(join(multisiteArtifacts, "latest-runtime.json"), "utf8")) as { paths?: { runtimeDirectory?: string } }
256256
const diagnostic = await readFile(join(multisiteArtifacts, latest.paths?.runtimeDirectory ?? "", "files/phpunit/.pg-test-result.txt"), "utf8")
257-
assert.match(diagnostic, /TESTS: [1-9][0-9]* ASSERTIONS: [1-9][0-9]* FAILURES: 0 ERRORS: 0/, "managed multisite regression must execute nonzero tests and assertions")
257+
assert.match(diagnostic, /STAGE_BEGIN:run_tests[\s\S]*RUNNING [1-9][0-9]* TEST FILES/, "managed multisite diagnostics must prove test execution started")
258+
const phpunitOutput = multisiteResult.executions.filter((execution) => execution.command === "wordpress.phpunit").map((execution) => execution.stdout).join("\n")
259+
assert.match(phpunitOutput, /OK \([1-9][0-9]* tests?, [1-9][0-9]* assertions?\)/, "managed multisite regression must execute nonzero tests and assertions")
258260
console.log("disposable MySQL and MariaDB mysqli E2E passed")
259261
} finally {
260262
await rm(directory, { recursive: true, force: true })

0 commit comments

Comments
 (0)