mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 10:01:20 -08:00
test(ci): [CI-01] centralize installed roster and cover ASR and Cast
This commit is contained in:
1 parent
b90de99bc2
commit
8379ac7bbf
30 files changed
+3028
-58
No files matched your search
@@ -14,8 +14,8 @@ also retains explicit historical and committed-artifact cases; its name does not
|
||||
promise that every dependency is rebuilt from current source in every test.
|
||||
|
||||
`yarn test:browser:installed` requires ARTPLAYER_BROWSER_ARTIFACTS from
|
||||
`yarn test:package --include=artplayer-plugin-ambilight,artplayer-proxy-canvas,artplayer-plugin-document-pip,artplayer-plugin-ads,artplayer-plugin-audio-track,artplayer-plugin-vtt-thumbnail,artplayer-plugin-multiple-subtitles,artplayer-plugin-hls-control,artplayer-plugin-dash-control,artplayer-plugin-auto-thumbnail`.
|
||||
Both launcher and config validate the selected twelve packages' installed hashes
|
||||
`yarn test:package --browser`.
|
||||
Both launcher and config validate the selected packages' installed hashes
|
||||
and source/build freshness. `scope.ts` lists the currently supported installed
|
||||
test files. This is a growing installed subset, not full ecosystem acceptance.
|
||||
Source checks remain complete when the installed list grows.
|
||||
@@ -83,3 +83,17 @@ rejects diagnostic SDK patches/debug replacements and synthetic recovery probes,
|
||||
while source diagnostics remain explicit. Auto Thumbnail uses native media/JPEG
|
||||
with a stub host and retains its presentation/fallback pixel limitations. See
|
||||
../../refactor/changes/2026-09-15-CI-01-adaptive-installed.md for executed results.
|
||||
|
||||
`yarn test:package --browser` derives additional packages from installedPackages
|
||||
in scope.ts, so CI preparation and browser preflight share one roster. The default
|
||||
command still prepares core/chapter; --include retains explicit subsets. Unknown,
|
||||
duplicate, empty or conflicting --browser/--release/--include options fail before
|
||||
building. --browser is preparation, never full release acceptance.
|
||||
|
||||
ASR adds six native audio/routing/CORS files, including a composition that checks
|
||||
ASR and Audio Track identities separately. Historical inputs, unsupported WebAudio
|
||||
and deliberately forced fallback branches remain labeled. Chromecast adds its
|
||||
controlled SDK lifecycle file with actual core DOM/local media; it does not run
|
||||
a Cast receiver. VAST controlled tests externalize and replace a dependency, so
|
||||
they are not advertised as installed bundle coverage. Its real IMA suite retains
|
||||
its independent gate. See ../../refactor/changes/2026-09-15-CI-01-asr-cast-installed.md.
|
||||
@@ -2,7 +2,7 @@ import type { PlaywrightTestConfig } from '@playwright/test'
|
||||
import assert from 'node:assert/strict'
|
||||
|
||||
export type BrowserScope = 'source' | 'installed'
|
||||
export const installedPackages = ['artplayer', 'artplayer-plugin-chapter', 'artplayer-plugin-ambilight', 'artplayer-proxy-canvas', 'artplayer-plugin-document-pip', 'artplayer-plugin-ads', 'artplayer-plugin-audio-track', 'artplayer-plugin-vtt-thumbnail', 'artplayer-plugin-multiple-subtitles', 'artplayer-plugin-hls-control', 'artplayer-plugin-dash-control', 'artplayer-plugin-auto-thumbnail']
|
||||
export const installedPackages = ['artplayer', 'artplayer-plugin-chapter', 'artplayer-plugin-ambilight', 'artplayer-proxy-canvas', 'artplayer-plugin-document-pip', 'artplayer-plugin-ads', 'artplayer-plugin-audio-track', 'artplayer-plugin-vtt-thumbnail', 'artplayer-plugin-multiple-subtitles', 'artplayer-plugin-hls-control', 'artplayer-plugin-dash-control', 'artplayer-plugin-auto-thumbnail', 'artplayer-plugin-asr', 'artplayer-plugin-chromecast']
|
||||
export const installedTests = [
|
||||
'playback.spec.js',
|
||||
'lifecycle.spec.js',
|
||||
@@ -36,6 +36,13 @@ export const installedTests = [
|
||||
'auto-thumbnail.spec.js',
|
||||
'auto-thumbnail-lifecycle.spec.js',
|
||||
'auto-thumbnail-pixels.spec.js',
|
||||
'asr-audio.spec.js',
|
||||
'asr-playback.spec.js',
|
||||
'asr-fallback.spec.js',
|
||||
'asr-cors.spec.js',
|
||||
'asr-capture-cors.spec.js',
|
||||
'asr-audio-track.spec.js',
|
||||
'chromecast-lifecycle.spec.js',
|
||||
]
|
||||
|
||||
export function browserInvocation(scope: string, args: string[], environment: NodeJS.ProcessEnv) {
|
||||
|
||||
@@ -5,8 +5,21 @@ import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { ensureArchive, hash, readMember } from '../refactor/scripts/releases.mjs'
|
||||
import { installedPackages } from './browser-validation/scope.ts'
|
||||
import { consumerDirectory, names as defaultNames, readJson, removeConsumer, run, runtimeConsumer, typeConsumers, workspace, writeJson } from './package-consumer.mjs'
|
||||
|
||||
export function packageOptions(args) {
|
||||
assert(args.every(arg => ['--release', '--browser'].includes(arg) || arg.startsWith('--include=')), 'Unknown package-check option')
|
||||
const includes = args.filter(arg => arg.startsWith('--include='))
|
||||
assert(includes.length <= 1 && new Set(args).size === args.length, 'Duplicate package-check option')
|
||||
const browser = args.includes('--browser')
|
||||
const release = args.includes('--release')
|
||||
assert(!browser || (!release && includes.length === 0), 'Browser preparation cannot be combined with release or explicit includes')
|
||||
const include = browser ? installedPackages.filter(name => !defaultNames.includes(name)) : includes[0]?.slice('--include='.length).split(',') || []
|
||||
assert(include.every(Boolean) && new Set(include).size === include.length, 'Empty or duplicate additional package')
|
||||
return { release, include }
|
||||
}
|
||||
|
||||
export function checkFiles(manifest, files, historical = []) {
|
||||
for (const field of ['main', 'module', 'types', 'legacy']) {
|
||||
assert(typeof manifest[field] === 'string', `Missing ${field}: ${manifest.name}`)
|
||||
@@ -80,6 +93,8 @@ export async function checkPackages({ release = false, include = [] } = {}) {
|
||||
'artplayer-plugin-hls-control': async () => (await import('../refactor/scripts/hls-contract.mjs')).verifyHlsContract(),
|
||||
'artplayer-plugin-dash-control': async () => (await import('../refactor/scripts/dash-contract.mjs')).verifyDashContract(),
|
||||
'artplayer-plugin-auto-thumbnail': async () => (await import('../refactor/scripts/auto-thumbnail-contract.mjs')).verifyAutoThumbnailContract(),
|
||||
'artplayer-plugin-asr': async () => (await import('../refactor/scripts/asr-contract.mjs')).verifyAsrContract(),
|
||||
'artplayer-plugin-chromecast': async () => (await import('../refactor/scripts/chromecast-contract.mjs')).verifyChromecastContract(),
|
||||
'artplayer-plugin-audio-track': async () => (await import('../refactor/scripts/audio-contract.mjs')).verifyAudioContract(),
|
||||
'artplayer-plugin-vtt-thumbnail': async () => (await import('../refactor/scripts/vtt-thumbnail-contract.mjs')).verifyVttThumbnailContract(),
|
||||
'artplayer-plugin-multiple-subtitles': async () => (await import('../refactor/scripts/multiple-subtitles-contract.mjs')).verifyMultipleSubtitlesContract(),
|
||||
@@ -164,8 +179,7 @@ export async function checkPackages({ release = false, include = [] } = {}) {
|
||||
}
|
||||
|
||||
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||
const include = process.argv.find(arg => arg.startsWith('--include='))?.slice('--include='.length).split(',') || []
|
||||
checkPackages({ release: process.argv.includes('--release'), include }).catch((error) => {
|
||||
checkPackages(packageOptions(process.argv.slice(2))).catch((error) => {
|
||||
console.error(error)
|
||||
process.exitCode = 1
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user