Files
orca/config/scripts/ci/e2e-failures/ci-e2e-failure-summary.test.mjs
T
Neil 9bd6272fdf refactor(tooling): organize build, CI, and test owners (#38130)
* refactor(tooling): organize test runtime and maintenance owners

* test(tooling): preserve relocated runtime fixture dependency edges

* refactor(tooling): preserve xterm routing owner checks

* ci(tooling): include routing owner in sparse checkout

* test(tooling): preserve copied workflow dependency closures

* fix(tooling): normalize hashed JSON assets in release parity

* fix(tooling): distinguish asset aliases from literal references

* fix(tooling): frame normalized asset reference payloads

* fix(tooling): normalize decoded JSON asset references

* refactor(tooling): organize build, CI and release owners

* fix(tooling): align moved generator and workflow path contracts

* fix(tooling): update generated plugin bundle owner banners

* test(tooling): create relocated mobile verifier fixture directories

* test(tooling): copy headless detector dependency closure

* test(tooling): align native batch policy fixtures with owner path

* fix(tooling): link moved reliability command to historical evidence

* fix(tooling): preserve nested sandbox owners and canonical guide source

* fix(tooling): target release version owners in checkout fixture
2026-11-04 21:08:19 -08:00

80 lines
2.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { expect, it } from 'vitest'
import { e2eFailureSummary, renderE2eFailures } from './ci-e2e-failure-summary.mjs'
import { trackE2eFailures } from './ci-e2e-failure-tracking.mjs'
it('requires exact failures with an owner, issue and unexpired review date', () => {
const failure = {
file: 'test.spec.ts',
title: 'case',
project: 'electron',
message: 'expected focus failed'
}
const record = {
...failure,
message: 'expected focus',
owner: '@owner',
issue: 'https://github.com/stablyai/orca/issues/123',
expires: '2026-10-01'
}
const now = new Date('2026-09-28')
expect(trackE2eFailures([failure], [null, record], now)).toMatchObject({
known: [{ ...failure, tracking: record }],
invalid: [null]
})
expect(trackE2eFailures([failure], null, now).untracked).toEqual([failure])
for (const change of [
{ expires: '2026-09-27' },
{ expires: '2026-09-31' },
{ owner: '' },
{ issue: '' },
{ title: 'different' },
{ message: 'different' },
{ project: 'other' }
]) {
expect(trackE2eFailures([failure], [{ ...record, ...change }], now).untracked).toEqual([
failure
])
}
})
it('keeps failure, flaky, skipped and startup-error evidence separate', () => {
const report = {
errors: [{ message: 'startup failed' }],
suites: [
{
title: 'file',
file: 'tests/e2e/test.spec.ts',
suites: [
{
title: 'feature',
specs: [
{
title: 'case',
tests: [
{ status: 'expected' },
{ status: 'skipped' },
{
status: 'unexpected',
projectName: 'electron-headless',
results: [{ errors: [{ message: '<timeout>' }] }]
},
{
status: 'flaky',
results: [{ errors: [{ message: 'first try' }] }, { errors: [] }]
}
]
}
]
}
]
}
]
}
const summary = e2eFailureSummary(report)
expect(summary).toMatchObject({ passed: 1, skipped: 1, errors: report.errors })
expect(summary.failures).toHaveLength(2)
expect(summary.failures[0].title).toBe('file › feature › case')
expect(renderE2eFailures(summary)).toContain('&lt;timeout&gt;')
expect(renderE2eFailures(summary)).toContain('startup failed')
})