Files
orca/config/scripts/packaged-browser-lane-contract.test.mjs
T
681f3ca1ba perf: stream the packaged browser installer checksum in CI (#23082)
* perf: stream the packaged browser installer checksum in CI

* fix(i18n): restore diff note draft catalog entries

---------

Co-authored-by: OrcaWin <alpha-eng@stably.ai>
Co-authored-by: m4air <m4air@m4airs-Air.localdomain>
2026-09-26 13:44:12 -07:00

47 lines
2.2 KiB
JavaScript

import { readFileSync } from 'node:fs'
import { describe, expect, it } from 'vitest'
import { parse } from 'yaml'
const workflow = parse(
readFileSync(new URL('../../.github/workflows/packaged-browser-e2e.yml', import.meta.url), 'utf8')
)
const steps = workflow.jobs.compatibility.steps
describe('packaged browser compatibility lane', () => {
it('runs weekly and supports immutable manual or reusable revisions', () => {
expect(workflow.on.schedule).toHaveLength(1)
for (const trigger of ['workflow_dispatch', 'workflow_call']) {
expect(workflow.on[trigger].inputs.ref).toMatchObject({ type: 'string', required: false })
}
expect(steps[0].with.ref).toBe('${{ inputs.ref || github.sha }}')
expect(workflow.permissions).toEqual({ contents: 'read' })
})
it('verifies the pinned package before selecting the desktop executable', () => {
const download = steps.find((step) => step.name === 'Download pinned old release').run
expect(download).toContain('gh release download v1.4.188')
expect(download).toContain('hashlib.sha512()')
expect(download).not.toContain('package.read_bytes()')
expect(download).toContain("extracted/'opt'/'Orca'/'orca-ide'")
expect(download).toContain('assert base64.')
expect(download).toContain('decode()==expected')
expect(download).toContain("['dpkg-deb'")
expect(download.indexOf('assert base64.')).toBeLessThan(download.indexOf("['dpkg-deb'"))
})
it('requires both directions three times and rejects silent skips', () => {
const run = steps.find((step) => step.name === 'Run both mixed-version directions')
expect(run.run).toContain('tests/e2e/packaged-mixed-version-browser-placement.spec.ts')
expect(run.run).toContain('--repeat-each=3')
expect(run.run).toContain('--retries=0')
expect(run.run).toContain('--reporter=list,json')
const verify = steps.find((step) => step.name === 'Require all six compatibility executions')
expect(verify.if).toBe('always()')
expect(verify.run).toBe(
`node config/scripts/verify-packaged-browser-participation.mjs ${run.env.PLAYWRIGHT_JSON_OUTPUT_FILE}`
)
expect(steps.at(-1).if).toBe('always()')
expect(steps.at(-1).with.path).toBe('test-results/')
})
})