Skip to content

Commit 681cb76

Browse files
committed
scratch: ATLAS screenshots on f264e2a
1 parent f264e2a commit 681cb76

2 files changed

Lines changed: 70 additions & 247 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 27 additions & 247 deletions
Original file line numberDiff line numberDiff line change
@@ -1,266 +1,46 @@
11
name: tests
22

33
on:
4-
# main tests each merged commit. scratch/ branches run CI on a branch with no
5-
# pull request; every other branch runs through pull_request.
64
push:
7-
branches: [main, "scratch/**"]
8-
pull_request:
5+
branches: ["scratch/**"]
96

107
permissions:
118
contents: read
129

13-
# A newer commit on a pull request cancels the run for the older one. Each push
14-
# gets a group of its own: runs that share a group wait one at a time, and a
15-
# newer one cancels any still waiting, so runs on main would skip commits.
16-
concurrency:
17-
group: tests-${{ github.event.pull_request.number || github.run_id }}
18-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19-
2010
jobs:
21-
test:
22-
runs-on: ubuntu-latest
23-
timeout-minutes: 30
24-
strategy:
25-
matrix:
26-
python-version: ["3.10", "3.13"]
27-
steps:
28-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29-
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
30-
with:
31-
node-version: "22.23.2"
32-
- name: Install pinned explorer compiler
33-
run: |
34-
timeout --signal=TERM --kill-after=30s 3m npm ci --ignore-scripts --no-audit --no-fund --prefer-offline \
35-
--fetch-timeout=30000 --fetch-retries=2 --fetch-retry-mintimeout=2000 --fetch-retry-maxtimeout=10000
36-
- run: npm run check:explorer
37-
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
38-
with:
39-
version: "0.12.1"
40-
python-version: ${{ matrix.python-version }}
41-
enable-cache: true
42-
- run: uv sync --extra dev --extra repl
43-
- run: uv run ruff check autoform_cli servers tests
44-
- run: uv run pytest -q
45-
- run: make check-example
46-
47-
browser:
48-
name: WebKit integrated book and explorer regressions
49-
runs-on: ubuntu-latest
50-
timeout-minutes: 25
51-
steps:
52-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
53-
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
54-
with:
55-
version: "0.12.1"
56-
python-version: "3.13"
57-
enable-cache: true
58-
- name: Install locked browser test environment
59-
run: uv sync --frozen --extra dev --extra browser
60-
- name: Install WebKit and Linux system dependencies
61-
run: uv run --frozen --extra browser playwright install --with-deps webkit
62-
- name: Run integrated book, explorer and genuine MathJax regressions
63-
run: >-
64-
uv run --frozen --extra dev --extra browser pytest -q
65-
tests/test_dag_viewer_browser.py tests/test_integrated_explorer_browser.py
66-
tests/test_integrated_workspace_browser.py tests/test_integrated_continuity_browser.py
67-
env:
68-
AUTOFORM_REQUIRE_BROWSER_TESTS: "1"
69-
70-
real-lean:
71-
name: real Lean (fixture toolchain)
72-
runs-on: ubuntu-latest
73-
timeout-minutes: 75
74-
steps:
75-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
76-
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
77-
with:
78-
version: "0.12.1"
79-
python-version: "3.13"
80-
enable-cache: true
81-
- name: Install locked development environment
82-
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
83-
- name: Install pinned Elan
84-
run: |
85-
set -euo pipefail
86-
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
87-
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
88-
-o elan.tar.gz
89-
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
90-
| sha256sum --check --strict
91-
tar xzf elan.tar.gz
92-
./elan-init -y --default-toolchain none
93-
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
94-
- name: Install the fixture's Lean toolchain
95-
run: |
96-
set -euo pipefail
97-
timeout --signal=TERM --kill-after=30s 10m \
98-
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)"
99-
command -v lake
100-
- name: Install the library fixture's Lean toolchain
101-
run: |
102-
set -euo pipefail
103-
timeout --signal=TERM --kill-after=30s 10m \
104-
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/library-project/lean-toolchain)"
105-
- name: Build a project from the bundled creation release
106-
run: |
107-
set -euo pipefail
108-
generated_project="$RUNNER_TEMP/autoform-created-project"
109-
uv run autoform project new "$generated_project" \
110-
--package GeneratedProject \
111-
--release lean-v4.32.2-mathlib-v4.32.2
112-
cd "$generated_project"
113-
timeout --signal=TERM --kill-after=30s 20m lake exe cache get
114-
timeout --signal=TERM --kill-after=30s 10m lake build
115-
- name: Audit the created project as its workflow does
116-
run: |
117-
set -euo pipefail
118-
# The template's helper, so the step audits this checkout's probe on a
119-
# build that imports all of Mathlib.
120-
helper="$PWD/autoform_cli/templates/github/autoform_audit.py"
121-
archive="$RUNNER_TEMP/autoform-created-root.tgz"
122-
probe="$RUNNER_TEMP/autoform-created-probe.lean"
123-
output="$RUNNER_TEMP/autoform-created-probe.out"
124-
cd "$RUNNER_TEMP/autoform-created-project"
125-
lake pack "$archive"
126-
python3 "$helper" GeneratedProject "$archive" "$probe"
127-
lean_path="$(lake env printenv LEAN_PATH)"
128-
AUTOFORM_AUDIT_LEAN_PATH="$lean_path" LEAN_ABORT_ON_PANIC=1 \
129-
timeout --signal=TERM --kill-after=30s 15m lean "$probe" | tee "$output"
130-
if ! tail -n 1 "$output" | grep -Eq '^kernel trust clean \('; then
131-
echo "the audit probe did not end with its success line" >&2
132-
exit 1
133-
fi
134-
- name: Run the impact probe against real Lean
135-
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_impact.py
136-
env:
137-
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
138-
- name: Run the library index generator against real Lean
139-
run: timeout --signal=TERM --kill-after=30s 30m uv run pytest -q tests/test_library_generate.py
140-
env:
141-
AUTOFORM_REQUIRE_REAL_LIBRARY_TESTS: "1"
142-
- name: Run the open-statement audit and contract against real Lean
143-
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_lake_artifact_audit.py tests/test_contract.py
144-
env:
145-
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
146-
- name: Run the LSP lifecycle and diagnostics checks against real Lean
147-
run: >-
148-
timeout --signal=TERM --kill-after=30s 10m uv run pytest -q -k real_lean
149-
tests/test_lsp_protocol.py tests/test_batch_diagnostics.py
150-
env:
151-
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
152-
AUTOFORM_REAL_LEAN_MATHLIB_PROJECT: ${{ runner.temp }}/autoform-created-project
153-
154-
real-lean-skeleton:
155-
name: real Lean skeleton suite (fixture toolchain)
11+
atlas:
12+
name: ATLAS screenshots
15613
runs-on: ubuntu-latest
157-
timeout-minutes: 40
14+
timeout-minutes: 45
15815
steps:
15916
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16017
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
16118
with:
16219
version: "0.12.1"
16320
python-version: "3.13"
16421
enable-cache: true
165-
- name: Install locked development environment
166-
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
167-
- name: Install pinned Elan
168-
run: |
169-
set -euo pipefail
170-
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
171-
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
172-
-o elan.tar.gz
173-
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
174-
| sha256sum --check --strict
175-
tar xzf elan.tar.gz
176-
./elan-init -y --default-toolchain none
177-
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
178-
- name: Install the fixture's Lean toolchain
179-
run: |
180-
set -euo pipefail
181-
timeout --signal=TERM --kill-after=30s 10m \
182-
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/skeleton-project/lean-toolchain)"
183-
command -v lake
184-
- name: Run the skeleton suite against real Lean
22+
- run: uv sync --frozen --extra dev --extra browser
23+
- run: uv run --frozen --extra browser playwright install --with-deps webkit
24+
- name: Clone the ATLAS wiki
25+
run: |
26+
git clone --depth 1 --filter=blob:none --sparse --branch wiki/autoform-blueprint https://github.com/Deicyde/atlas-lean.git atlas
27+
git -C atlas sparse-checkout set --no-cone '/*' '!/v1/'
28+
git -C atlas log -1 --format='atlas %h %s'
29+
- name: Render
30+
run: uv run --frozen python -m autoform_cli render atlas/blueprint --output atlas/site-src --lean-root atlas
31+
- name: Build
32+
working-directory: atlas
18533
run: >-
186-
timeout --signal=TERM --kill-after=30s 35m uv run pytest -q
187-
tests/test_skeleton.py
188-
tests/test_project_inspect.py::test_stale_inherited_mathlib_is_ignored_by_real_lake
189-
env:
190-
AUTOFORM_REQUIRE_REAL_LEAN_TESTS: "1"
191-
192-
real-repl:
193-
name: real REPL (fixture toolchain)
194-
runs-on: ubuntu-latest
195-
timeout-minutes: 15
196-
steps:
197-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
198-
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
34+
uvx --from mkdocs==1.6.1 --with mkdocs-material==9.6.21
35+
--with mkdocs-literate-nav==0.6.2 --with pymdown-extensions==10.21.3
36+
mkdocs build --strict
37+
- name: Screenshot
38+
run: |
39+
(cd atlas/site && python3 -m http.server 8765 --bind 127.0.0.1 > /dev/null 2>&1 &)
40+
sleep 2
41+
uv run --frozen --extra browser python .scratch/atlas_shots.py
42+
- uses: actions/upload-artifact@v4
43+
if: always()
19944
with:
200-
version: "0.12.1"
201-
python-version: "3.13"
202-
enable-cache: true
203-
- name: Install pinned Elan
204-
run: |
205-
set -euo pipefail
206-
timeout --signal=TERM --kill-after=15s 2m curl -sSfL \
207-
https://github.com/leanprover/elan/releases/download/v4.2.3/elan-x86_64-unknown-linux-gnu.tar.gz \
208-
-o elan.tar.gz
209-
echo "df0b2b3a439961ffcbb3985214365ffe40f49bc871df04dff268c7d8e21ca8b2 elan.tar.gz" \
210-
| sha256sum --check --strict
211-
tar xzf elan.tar.gz
212-
./elan-init -y --default-toolchain none
213-
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
214-
- name: Build the REPL fixture
215-
working-directory: tests/fixtures/repl-smoke
216-
run: |
217-
set -euo pipefail
218-
timeout --signal=TERM --kill-after=30s 5m \
219-
elan toolchain install "$(tr -d '\r\n' < lean-toolchain)"
220-
timeout --signal=TERM --kill-after=30s 8m lake build Mathlib Secret @repl/repl
221-
- name: Install the minimum supported Lean toolchain
222-
run: |
223-
set -euo pipefail
224-
timeout --signal=TERM --kill-after=30s 5m \
225-
elan toolchain install "$(tr -d '\r\n' < tests/fixtures/minimum-lean/lean-toolchain)"
226-
- name: Install locked development environment
227-
run: timeout --signal=TERM --kill-after=30s 3m uv sync --frozen --extra dev --extra repl
228-
- name: Run the REPL suite against the pinned upstream REPL
229-
run: timeout --signal=TERM --kill-after=30s 10m uv run pytest -q tests/test_real_repl.py
230-
env:
231-
AUTOFORM_RUN_REAL_REPL_TESTS: "1"
232-
233-
windows-hardening:
234-
name: Windows inspection, subprocess, and publication hardening
235-
runs-on: windows-latest
236-
timeout-minutes: 15
237-
steps:
238-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
239-
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
240-
with:
241-
version: "0.12.1"
242-
python-version: "3.13"
243-
enable-cache: true
244-
- run: uv sync --frozen --extra dev --extra repl
245-
- name: Exercise inspection, bounded subprocesses, and transactional output
246-
run: >-
247-
uv run pytest -q
248-
tests/test_windows_source_boundary.py
249-
tests/test_tree_snapshot_limits.py
250-
tests/test_project_inspect.py
251-
tests/test_scaffold.py::test_scaffold_merges_autoform_rules_into_lake_gitignore
252-
tests/test_scaffold.py::test_windows_cross_interface_gitignore_identity_ignores_ctime_only
253-
tests/test_scaffold.py::test_scaffold_refuses_case_variants_of_managed_paths
254-
tests/test_skeleton.py::test_bounded_command_rejects_excess_output
255-
tests/test_skeleton.py::test_bounded_command_caps_stdout_and_stderr_together
256-
tests/test_skeleton.py::test_bounded_command_rejects_invalid_utf8
257-
tests/test_skeleton.py::test_bounded_command_timeout_kills_descendants
258-
tests/test_skeleton.py::test_bounded_command_rejects_a_successful_parent_with_a_live_descendant
259-
tests/test_skeleton.py::test_bounded_command_interruption_kills_the_process
260-
tests/test_skeleton.py::test_packet_publication_rolls_back_both_trees_on_commit_failure
261-
tests/test_skeleton.py::test_packet_publication_rolls_back_when_interrupted_after_backup_rename
262-
tests/test_skeleton.py::test_packet_publication_restores_old_trees_when_quarantine_cleanup_fails
263-
tests/test_skeleton.py::test_packet_publication_does_not_overwrite_during_backup_restore
264-
tests/test_claims.py::test_git_runs_without_terminal_prompts
265-
tests/test_claims.py::test_git_stops_at_the_deadline_and_names_the_step
266-
tests/test_claims.py::test_git_does_not_start_once_the_deadline_has_passed
45+
name: atlas-shots
46+
path: screenshots

‎.scratch/atlas_shots.py‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""Screenshot a few real ATLAS pages served on 127.0.0.1:8765 (evidence only)."""
2+
from pathlib import Path
3+
4+
from playwright.sync_api import sync_playwright
5+
6+
BASE = "http://127.0.0.1:8765"
7+
SHOTS = Path("screenshots")
8+
SHOTS.mkdir(exist_ok=True)
9+
PAGES = [
10+
("home", "/"),
11+
("roadmap", "/roadmap/"),
12+
("topic", "/roadmap/Algebra/"),
13+
("chapter", "/roadmap/Algebra/MathlibExt/"),
14+
("theorem", "/roadmap/Algebra/MathlibExt/#is-ladditive"),
15+
]
16+
17+
18+
def shoot(page, name: str, path: str, light: bool) -> None:
19+
try:
20+
page.goto(BASE + path, wait_until="load", timeout=90000)
21+
page.wait_for_timeout(3500)
22+
if light:
23+
page.evaluate("document.body.setAttribute('data-md-color-scheme', 'default')")
24+
page.wait_for_timeout(1200)
25+
page.screenshot(path=str(SHOTS / f"{name}.png"))
26+
except Exception as error: # evidence only
27+
(SHOTS / f"{name}.err.txt").write_text(repr(error)[:600], encoding="utf-8")
28+
29+
30+
with sync_playwright() as p:
31+
browser = p.webkit.launch()
32+
desktop = browser.new_context(viewport={"width": 1440, "height": 900})
33+
page = desktop.new_page()
34+
for name, path in PAGES:
35+
shoot(page, f"{name}-1440-dark", path, light=False)
36+
shoot(page, f"{name}-1440-light", path, light=True)
37+
desktop.close()
38+
phone = browser.new_context(viewport={"width": 390, "height": 844}, device_scale_factor=2, is_mobile=True, has_touch=True)
39+
page = phone.new_page()
40+
for name, path in PAGES:
41+
shoot(page, f"{name}-390-dark", path, light=False)
42+
phone.close()
43+
browser.close()

0 commit comments

Comments
 (0)