Make e2e tests independent and run them in parallel
Each test builds its pages in its own sandbox folder (search tests use a random word), so tests no longer rely on earlier tests' leftovers and run alone, in any order, or in parallel. The seed is just the home page. Parallel load hid the htmx settle race from the timing-based tests, so a dedicated test now submits a dialog in the task right after it is inserted, which fails deterministically without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+3
-12
@@ -16,18 +16,9 @@ mkdirSync(wiki, { recursive: true });
|
||||
|
||||
execFileSync("go", ["build", "-o", bin, "."], { cwd: join(here, ".."), stdio: "inherit" });
|
||||
|
||||
const pages = {
|
||||
"index.md": "# Home\n\nWelcome.\n",
|
||||
"Projects/index.md": "# Projects\n\n## Todo\n\n- [ ] first task\n- [x] second task\n",
|
||||
"Projects/Alpha/index.md": "# Alpha\n\nAlpha page.\n",
|
||||
"Projects/Beta/index.md": "# Beta\n\nBeta page.\n",
|
||||
"Notes/index.md": "# Notes\n\nSome notes.\n",
|
||||
};
|
||||
for (const [p, body] of Object.entries(pages)) {
|
||||
mkdirSync(dirname(join(wiki, p)), { recursive: true });
|
||||
writeFileSync(join(wiki, p), body);
|
||||
}
|
||||
writeFileSync(join(wiki, "Projects", "readme.txt"), "a file\n");
|
||||
// Tests create their own pages (see sandbox in tests/pages.spec.js); the seed
|
||||
// is only the home page.
|
||||
writeFileSync(join(wiki, "index.md"), "# Home\n\nWelcome.\n");
|
||||
|
||||
const srv = spawn(bin, ["-dir", wiki, "-cache", join(tmp, "cache"), "-addr", "127.0.0.1:" + port, "-calendars", ""], {
|
||||
stdio: "inherit",
|
||||
|
||||
Reference in New Issue
Block a user