Build the site once per test run, and split every page into tags once, for all the tests that read built pages
Twelve test modules each ran the whole build, and each of them walked every page with its own parser. They now share one build (web/tests/builtsite.py), made in a directory of the run's own, and one recording of each page, made on all the cores. test_thumbs's second build and test_google_tag's two builds still build, on their own, as before; the google tag builds run side by side. web/tests/run.py runs the modules side by side. test_extra's elevation tile check now compares with the last entry of connect-src, which is where the tile path is since the Google tag added three before it. New tests keep the build's shortcuts honest (test_build_store.py). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
84d5770e13
commit
7c321c6e15
16 files changed
+561
-87
No files matched your search
@@ -3,13 +3,12 @@ robots headers, the 404, the Atom feed, llms.txt and the favicon.
|
||||
|
||||
The JSON-LD is checked against the properties schema.org and Google Search Central document
|
||||
for each type (REQUIRED below, read 2026-11); Google's Rich Results Test itself cannot be run
|
||||
here. The site is built into web/.cache/test-site, as the other page tests do.
|
||||
here. The site is the one built once per run by builtsite.py, as for the other page tests.
|
||||
"""
|
||||
import html
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
import xml.etree.ElementTree as ET
|
||||
@@ -21,7 +20,9 @@ sys.path.insert(0, WEB)
|
||||
import serve # noqa: E402
|
||||
from olt import browse, cards, common, docs, feed, records, regions, seo, site, thumbs # noqa: E402
|
||||
|
||||
OUT = os.path.join(WEB, ".cache", "test-site")
|
||||
import builtsite # noqa: E402
|
||||
|
||||
OUT = builtsite.OUT
|
||||
SITE = site.load()
|
||||
BASE = SITE.base_url
|
||||
|
||||
@@ -120,9 +121,7 @@ def visible_crumbs(doc):
|
||||
|
||||
|
||||
def setUpModule():
|
||||
os.makedirs(os.path.dirname(OUT), exist_ok=True)
|
||||
subprocess.run([sys.executable, os.path.join(WEB, "build.py"), "--out", OUT],
|
||||
check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
builtsite.ensure()
|
||||
|
||||
|
||||
class RequiredPropertiesTest(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user