Files
orca/config/scripts/verify-wsl-e2e-participation.test.mjs
Neil f952f1ac96 test: run real WSL terminal launch and paste in PR CI (#19072)
* test: continuously exercise real WSL terminal launch and paste

* test: establish live WSL reader before changing default shell

* ci: pin WSL kernel installer and participation selectors

* ci: route deleted WSL paths and record immutable run evidence

* test: require exactly three WSL repetitions in lane contract
2026-09-06 05:24:54 -07:00

53 lines
1.8 KiB
JavaScript

import { describe, expect, it } from 'vitest'
import { verifyWslParticipation, WSL_TEST_TITLES } from './verify-wsl-e2e-participation.mjs'
function report() {
return {
stats: { expected: 9, skipped: 0, unexpected: 0, flaky: 0 },
suites: [
{
suites: [
{
specs: WSL_TEST_TITLES.map((title) => ({
title,
tests: Array.from({ length: 3 }, () => ({
expectedStatus: 'passed',
results: [{ status: 'passed' }]
}))
}))
}
]
}
]
}
}
describe('WSL participation', () => {
it('accepts all three named scenarios executed three times', () => {
expect(() => verifyWslParticipation(report())).not.toThrow()
})
it.each(['skipped', 'unexpected', 'flaky'])('rejects a nonzero %s result', (key) => {
const value = report()
value.stats[key] = 1
expect(() => verifyWslParticipation(value)).toThrow('participation failed')
})
it('rejects missing scenarios even when aggregate counts claim nine passes', () => {
const value = report()
value.suites[0].suites[0].specs.pop()
expect(() => verifyWslParticipation(value)).toThrow('requires three executions')
})
it('rejects an unrelated scenario substituted for an expected scenario', () => {
const value = report()
value.suites[0].suites[0].specs[0].title = 'native shell passes'
expect(() => verifyWslParticipation(value)).toThrow('Unexpected WSL scenario')
})
it('rejects a pass obtained after a failed attempt', () => {
const value = report()
value.suites[0].suites[0].specs[0].tests[0].results.unshift({ status: 'failed' })
expect(() => verifyWslParticipation(value)).toThrow('without retries')
})
it('rejects missing report content', () => {
expect(() => verifyWslParticipation({})).toThrow('participation failed')
})
})