diff --git a/.github/workflows/binance-orderbook-ui.yml b/.github/workflows/binance-orderbook-ui.yml index e798eac..39a6ed9 100644 --- a/.github/workflows/binance-orderbook-ui.yml +++ b/.github/workflows/binance-orderbook-ui.yml @@ -9,7 +9,11 @@ on: - "playwright.config.js" - "src/binance-orderbook-trade/**" - "scripts/binance-orderbook-trade.user.js" + - "scripts/binance-*.mjs" - "e2e/binance-orderbook/**" + - "test/unit/binance-*.test.js" + - "test/unit/binance-orderbook-trade/**" + - "test/dom/binance-orderbook-trade/**" push: branches: - main @@ -20,7 +24,11 @@ on: - "playwright.config.js" - "src/binance-orderbook-trade/**" - "scripts/binance-orderbook-trade.user.js" + - "scripts/binance-*.mjs" - "e2e/binance-orderbook/**" + - "test/unit/binance-*.test.js" + - "test/unit/binance-orderbook-trade/**" + - "test/dom/binance-orderbook-trade/**" permissions: contents: read @@ -37,7 +45,7 @@ jobs: cache: npm - run: npm ci - run: npx playwright install --with-deps chromium - - run: npm run test:binance-orderbook-trade + - run: npm run test:binance-orderbook-ui-toolchain - run: npm run build:binance-orderbook-trade - run: git diff --exit-code -- scripts/binance-orderbook-trade.user.js - run: npm run test:ui diff --git a/docs/binance-orderbook-trade-ui-automation.md b/docs/binance-orderbook-trade-ui-automation.md index 6597fa5..9045812 100644 --- a/docs/binance-orderbook-trade-ui-automation.md +++ b/docs/binance-orderbook-trade-ui-automation.md @@ -127,7 +127,10 @@ test orders from count changes alone. lifecycle. - Add a deterministic Binance Futures fixture with React-style subtree replacement. - Add scenario data, interaction probes, and the core cancel-current-symbol matrix. -- Run L2 in the PR gate. +- Run the complete Binance orderbook unit/DOM toolchain and L2 in the PR gate. + This includes the Stage 3/4 capture utilities without coupling the gate to + unrelated userscript suites. Changes limited to Stage 3/4 scripts or their unit + tests must still trigger this workflow. ### Stage 2: Expanded Host and Fault Matrix diff --git a/package.json b/package.json index 1853e72..ff62a26 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "check:m3u8-downloader": "node --check scripts/m3u8-downloader.user.js", "test": "node --test", "test:binance-orderbook-trade": "node --test test/unit/binance-orderbook-trade/*.test.js test/dom/binance-orderbook-trade/*.test.js", + "test:binance-orderbook-ui-toolchain": "node --test test/unit/binance-orderbook-trade/*.test.js test/dom/binance-orderbook-trade/*.test.js test/unit/binance-*.test.js", "test:ui": "playwright test", "test:ui:headed": "playwright test --headed", "test:ui:debug": "playwright test --debug" diff --git a/test/unit/binance-ui-workflow.test.js b/test/unit/binance-ui-workflow.test.js new file mode 100644 index 0000000..0c58d78 --- /dev/null +++ b/test/unit/binance-ui-workflow.test.js @@ -0,0 +1,21 @@ +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; +import test from 'node:test'; + +const WORKFLOW_PATH = new URL('../../.github/workflows/binance-orderbook-ui.yml', import.meta.url); + +test('Binance UI workflow gates the complete deterministic and live test toolchain', async () => { + const workflow = await readFile(WORKFLOW_PATH, 'utf8'); + + for (const pathPattern of [ + 'scripts/binance-*.mjs', + 'test/unit/binance-*.test.js', + 'test/unit/binance-orderbook-trade/**', + 'test/dom/binance-orderbook-trade/**', + ]) { + assert.ok(workflow.includes(`- "${pathPattern}"`), `Missing workflow path: ${pathPattern}`); + } + assert.match(workflow, /- run: npm run test:binance-orderbook-ui-toolchain\n/); + assert.doesNotMatch(workflow, /- run: npm test\n/); + assert.match(workflow, /- run: npm run test:ui\n/); +});