Files
noitu/web/playwright.config.js
T
tiennm99 39ef45730f feat(dict): derive the corpus from undertheseanlp's wiktionary rows
Replace the 179 MB minhqnd SQLite aggregate with the 4.8 MB
undertheseanlp/dictionary JSONL, pinned by commit and SHA-256, reading
only rows tagged "wiktionary". The two other wordlists in that file are
never read: hongocduc is GPL and would force a relicense, tudientv is an
unlicensed derivative of a commercial dictionary.

build-dictionary gains --merged and --sources (names validated, default
wiktionary), a shared finish() tail, and meta rows for the source commit
and the sources kept and excluded. The SQLite --in path, its schema
auto-detection and their tests are removed. Fixture builds now record
that they carry no upstream data instead of inheriting a licence string.
The --min-words floor moves from 40,000 to 20,000; the corpus is 26,845
words, down from 48,216, all of the loss being words absent from the
2018 Wiktionary scrape. Capitalization is not a filter.

The data licence follows the source text: CC BY-SA 3.0 Unported, which
is what vi.wiktionary.org carried in 2018. LICENSE, NOTICE, ATTRIBUTION,
the README, the image docs, the builder's meta string and the in-game
footer all name Wiktionary tiếng Việt's contributors as the authors and
undertheseanlp as the intermediary. The Makefile/Dockerfile pin test now
also checks the commit the builder stamps into the database.
2026-09-08 16:37:34 +07:00

60 lines
2.0 KiB
JavaScript

import { defineConfig, devices } from '@playwright/test';
const PORT = 4173;
/**
* CI installs Playwright's own Chromium. Some machines cannot reach that
* download, so a locally installed browser can be used instead by setting
* PLAYWRIGHT_CHANNEL=chrome (or msedge). Both drive the same engine.
*/
const channel = process.env.PLAYWRIGHT_CHANNEL;
export default defineConfig({
testDir: './e2e',
// A whole game per test, including a bot that deliberately pauses to think.
timeout: 60_000,
expect: { timeout: 10_000 },
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: process.env.CI ? [['github'], ['list']] : [['list']],
use: {
baseURL: `http://localhost:${PORT}`,
trace: 'retain-on-failure',
...devices['Desktop Chrome'],
...(channel ? { channel } : {})
},
projects: [{ name: 'chromium' }],
// The real binary, serving the real built frontend, against the fixture
// dictionary. Nothing here downloads the upstream wordlist.
webServer: {
command: 'go run ./cmd/noitu-server',
cwd: '../server',
url: `http://localhost:${PORT}/healthz`,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: 'pipe',
stderr: 'pipe',
env: {
// Loopback rather than every interface. The suite only ever talks to
// localhost, and a listener on 0.0.0.0 is what makes Windows
// Firewall ask to allow the binary — which `go run` rebuilds to a
// new temporary path every time, so answering never sticks.
NOITU_ADDR: `127.0.0.1:${PORT}`,
NOITU_DB_PATH: '../data/fixture.db',
NOITU_WEB_DIR: '../web/build',
// Long enough that no test races the turn clock. Timeout behaviour
// has its own server-side test; here it would only cause flakes.
NOITU_TURN_LIMIT: '120s',
// Long enough that a client which notices a dead socket on its own
// liveness check still has time to come back, and short enough to
// wait out in the forfeit test.
NOITU_GRACE: '25s'
}
}
});