mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-17 17:31:15 +03:00
gate strict error mode on E2E_STRICT_ERRORS=1
This commit is contained in:
parent
6abf401a2f
commit
fdc8e90c40
@ -91,13 +91,24 @@ type FrigateFixtures = {
|
|||||||
export const test = base.extend<FrigateFixtures>({
|
export const test = base.extend<FrigateFixtures>({
|
||||||
expectedErrors: [[], { option: true }],
|
expectedErrors: [[], { option: true }],
|
||||||
|
|
||||||
errorCollector: async ({ page, expectedErrors }, use) => {
|
errorCollector: async ({ page, expectedErrors }, use, testInfo) => {
|
||||||
const collector = installErrorCollector(page, [
|
const collector = installErrorCollector(page, [
|
||||||
...GLOBAL_ALLOWLIST,
|
...GLOBAL_ALLOWLIST,
|
||||||
...expectedErrors,
|
...expectedErrors,
|
||||||
]);
|
]);
|
||||||
await use(collector);
|
await use(collector);
|
||||||
collector.assertClean();
|
if (process.env.E2E_STRICT_ERRORS === "1") {
|
||||||
|
collector.assertClean();
|
||||||
|
} else if (collector.errors.length > 0) {
|
||||||
|
// Soft mode: attach errors to the test report so they're visible
|
||||||
|
// without failing the run. Used during the rollout phase.
|
||||||
|
await testInfo.attach("collected-errors.txt", {
|
||||||
|
body: collector.errors
|
||||||
|
.map((e) => `[${e.kind}] ${e.message}${e.url ? ` (${e.url})` : ""}`)
|
||||||
|
.join("\n"),
|
||||||
|
contentType: "text/plain",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
frigateApp: async ({ page, errorCollector }, use, testInfo) => {
|
frigateApp: async ({ page, errorCollector }, use, testInfo) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user