test(ci): [CI-JASSUB-SOURCE-01] include source in native JASSUB checks

This commit is contained in:
Harvey Zhao committed 2026-09-15 22:14:36 +08:00
1 parent 5862f60b0e
commit 5e0447fc51
12 files changed
+6113 -31

No files matched your search

+12 -6
View File
@@ -326,10 +326,14 @@ candidate plugins to the exact main/legacy files being tested.
Frozen-plugin retained DOM, candidate cleanup and unsupported API outcomes remain
distinct; the old plugin's observed loss is not complete-delivery acceptance.
`jassub-native.spec.js` runs actual published JASSUB 1.1.0, its native Worker,
fixed local WASM/font and authored ASS cues with offscreenRender=false. It checks
real canvas pixels before/after seek, CSS web fullscreen and normal destruction.
Windows WebKit currently fails the default frame-clock path; the explicitly
`jassub-native.spec.js` runs both published JASSUB 1.1.0 and current source by
default, each on three cores, with native Worker, fixed local WASM/font and
authored ASS cues with offscreenRender=false. It checks real canvas pixels
before/after seek, CSS web fullscreen and destruction. Source candidates use
direct instance destruction before host cleanup, just like explicit/installed
candidates. Selected-input attachments distinguish source-build from published
and installed artifacts; a missing source file path is not a historical identity.
Windows WebKit currently fails the published default frame-clock path; the explicitly
selected ARTPLAYER_JASSUB_ON_DEMAND=false diagnostic passes on the candidate core.
This is a retained historical failure, not a waived browser gate. The server must
serve WASM as application/wasm for native streaming compilation. Archive failed
@@ -339,8 +343,10 @@ For candidate registration regressions, set ARTPLAYER_JASSUB_ARTIFACT to a built
main/legacy global file. Those runs also destroy the exposed instance before host
cleanup. ARTPLAYER_JASSUB_CUSTOM_CANVAS=true supplies a caller-owned canvas and
asserts it remains connected after destroy(false). The native report records the
artifact hash and both mode choices. This does not change the default published
baseline or establish ESM/offscreen/device acceptance.
artifact hash and both mode choices. An explicit file selects that input alone;
normal source/installed runs retain the historical control alongside the candidate.
The original historical failure is not waived. These checks do not establish
ESM/offscreen/device acceptance.
`jassub-render-failure.spec.js` uses an actual Worker/WASM bitmap and native copies.
It intentionally closes one bitmap to provoke native Canvas InvalidStateError,
+17 -6
View File
@@ -14,8 +14,8 @@ const publishedCode = readMember(archive, member).toString()
if (hash(publishedCode) !== release.files[member])
throw new Error('Published JASSUB artifact changed')
const published = { code: publishedCode, provenance: { kind: 'published', version: release.version, integrity: release.integrity, member, sha256: hash(publishedCode) } }
const candidate = process.env.ARTPLAYER_BROWSER_ARTIFACTS || explicitArtifact ? await browserCandidate('artplayer-plugin-jassub', explicitArtifact) : null
const inputs = process.env.ARTPLAYER_BROWSER_ARTIFACTS ? [published, candidate] : [candidate || published]
const candidate = await browserCandidate('artplayer-plugin-jassub', explicitArtifact)
const inputs = explicitArtifact ? [candidate] : [published, candidate]
const customCanvas = process.env.ARTPLAYER_JASSUB_CUSTOM_CANVAS === 'true'
const onDemandRender = process.env.ARTPLAYER_JASSUB_ON_DEMAND !== 'false'
const defaultOffscreen = process.env.ARTPLAYER_JASSUB_OFFSCREEN === 'default'
@@ -57,9 +57,10 @@ Dialogue: 0,${screenshotReadback ? '0:00:40.00,0:01:50.00' : '0:00:05.00,0:00:30
const testedSubtitles = screenshotReadback ? subtitles.replace('&H00FFFFFF', '&H0000FF00') : subtitles
for (const { code, provenance } of inputs) {
const artifact = provenance.kind !== 'published' ? provenance.file : null
const isCandidate = provenance.kind !== 'published'
const label = isCandidate ? (provenance.kind === 'source-build' ? 'candidate source-build' : 'candidate artifact') : `published ${release.version}`
for (const core of ['candidate', 'published', 'published-5.3.1-beta.1']) {
test(`JASSUB ${artifact ? 'candidate artifact' : `published ${release.version}`} renders actual WASM subtitles through seek and layout with ${core} core, customCanvas=${customCanvas}, defaultOffscreen=${defaultOffscreen}`, async ({ page, context }, testInfo) => {
test(`JASSUB ${label} renders actual WASM subtitles through seek and layout with ${core} core, customCanvas=${customCanvas}, defaultOffscreen=${defaultOffscreen}`, async ({ page, context }, testInfo) => {
await testInfo.attach('jassub-selected-input', { contentType: 'application/json', body: JSON.stringify({ core, provenance }) })
const resources = []
const external = []
@@ -228,8 +229,18 @@ for (const { code, provenance } of inputs) {
await pixels(page, 'restored')
}
await testInfo.attach('actual-jassub-page', { body: await page.screenshot(), contentType: 'image/png' })
if (artifact)
await page.evaluate(() => window.jassub.destroy())
if (isCandidate) {
const directDestroy = await page.evaluate(() => {
window.jassub.destroy()
return {
coreAlive: !window.art.isDestroy && window.Artplayer.instances.includes(window.art),
workers: window.jassubNative.workers.map(worker => worker.terminated),
canvases: document.querySelectorAll('.JASSUB').length,
}
})
await testInfo.attach('jassub-direct-destroy', { body: JSON.stringify(directDestroy), contentType: 'application/json' })
expect(directDestroy).toEqual({ coreAlive: true, workers: [1], canvases: 0 })
}
await page.evaluate(() => window.art.destroy(false))
if (customCanvas)
expect(await page.evaluate(() => window.jassubUserCanvas.isConnected)).toBe(true)