CI: a plain uv run after uv sync --no-group e2e installs the browser group again #1135

Closed
opened 2026-10-31 03:04:16 +00:00 by tiagoagueda · 0 comments
Owner

What exists today

pyproject.toml:127-128 sets [tool.uv] default-groups = ["dev", "e2e"], and the e2e group (pyproject.toml:120-123) is playwright and pytest-playwright. Several jobs sync without it and then call plain uv run, which syncs the environment to the default groups before running (uv's documented behaviour unless --no-sync or UV_NO_SYNC is set):

  • .forgejo/workflows/ci.yml:257 (unit), :365 (Checks), :552 (PostgreSQL): uv sync --locked ... --no-group e2e, then uv run at :262, :369, :555 and after.
  • .forgejo/workflows/every-python.yml:107 then :112.
  • .forgejo/workflows/dependencies.yml:92 then :101.

The saved log ci-Database tests on PostgreSQL-5958.log (run of 2026-10-23) shows it: the sync installs 82 packages (line 260), then the first uv run downloads playwright (45.5MiB) (line 343) and reports Installed 7 packages in 178ms (line 348), 1.2 s after the sync ended; pytest then lists playwright-0.9.0 and base-url-2.1.0 among its plugins (line 356).

The candidate's premise that the unit jobs never need the group is wrong. tests/test_documents.py:611-676 (fake_playwright, used by the tests at :689-736) does import playwright.sync_api without an importorskip, so the unit suite passes today only because the re-sync puts Playwright back. The comment at ci.yml:255-256 and every-python.yml:105-106 ("Playwright is 136 MB of tool this job never starts") describes a saving that has not happened since default-groups and plain uv run met.

What would change

  • Checks, PostgreSQL and the Dependencies quick check: keep --no-group e2e on the sync and set UV_NO_SYNC: "1" in the job's env: (or uv run --no-sync on each call), so later steps use the environment the sync built. None of these jobs imports Playwright.
  • Unit jobs (ci.yml test, every-python.yml): say what is true. Either drop --no-group e2e and fix the comment, or sync --no-group e2e --extra chromium (the chromium extra is playwright alone, pyproject.toml:96) with UV_NO_SYNC: "1", which keeps the package the unit tests import and leaves the pytest-playwright plugin out of every unit worker. The second is tidier; it needs one unit run to confirm nothing in tests/e2e/conftest.py breaks collection without the plugin (the e2e tests are deselected by the default -m).
  • No new library; this is uv's own switch.

What it saves or protects

small: about 45 MB of download and 1 to 2 s per job in Checks, PostgreSQL and the monthly Dependencies job, and comments that stop saying something false

Accessibility

none

Decisions

  • Unit jobs: install Playwright openly, or keep the sync narrow with --extra chromium? Recommended: --no-group e2e --extra chromium plus UV_NO_SYNC, after one green run; fall back to dropping --no-group e2e if collection needs the plugin.
  • Side note, not this issue: tests/e2e/conftest.py:33 sets DJANGO_ALLOW_ASYNC_UNSAFE=true at import, and that conftest is imported when the unit suite collects tests/e2e, so the whole unit suite runs with Django's async-safety guard off. Worth a separate look.

Found by the efficiency and reliability audit of 2026-10-30 (finding C1; index postulo/postulo#1108). Checked against main at daee30b15 (2026-10-30).

## What exists today `pyproject.toml:127-128` sets `[tool.uv] default-groups = ["dev", "e2e"]`, and the `e2e` group (`pyproject.toml:120-123`) is `playwright` and `pytest-playwright`. Several jobs sync without it and then call plain `uv run`, which syncs the environment to the default groups before running (uv's documented behaviour unless `--no-sync` or `UV_NO_SYNC` is set): - `.forgejo/workflows/ci.yml:257` (unit), `:365` (Checks), `:552` (PostgreSQL): `uv sync --locked ... --no-group e2e`, then `uv run` at `:262`, `:369`, `:555` and after. - `.forgejo/workflows/every-python.yml:107` then `:112`. - `.forgejo/workflows/dependencies.yml:92` then `:101`. The saved log `ci-Database tests on PostgreSQL-5958.log` (run of 2026-10-23) shows it: the sync installs 82 packages (line 260), then the first `uv run` downloads `playwright (45.5MiB)` (line 343) and reports `Installed 7 packages in 178ms` (line 348), 1.2 s after the sync ended; pytest then lists `playwright-0.9.0` and `base-url-2.1.0` among its plugins (line 356). The candidate's premise that the unit jobs never need the group is wrong. `tests/test_documents.py:611-676` (`fake_playwright`, used by the tests at `:689-736`) does `import playwright.sync_api` without an `importorskip`, so the unit suite passes today only because the re-sync puts Playwright back. The comment at `ci.yml:255-256` and `every-python.yml:105-106` ("Playwright is 136 MB of tool this job never starts") describes a saving that has not happened since `default-groups` and plain `uv run` met. ## What would change - Checks, PostgreSQL and the Dependencies quick check: keep `--no-group e2e` on the sync and set `UV_NO_SYNC: "1"` in the job's `env:` (or `uv run --no-sync` on each call), so later steps use the environment the sync built. None of these jobs imports Playwright. - Unit jobs (`ci.yml` test, `every-python.yml`): say what is true. Either drop `--no-group e2e` and fix the comment, or sync `--no-group e2e --extra chromium` (the `chromium` extra is `playwright` alone, `pyproject.toml:96`) with `UV_NO_SYNC: "1"`, which keeps the package the unit tests import and leaves the `pytest-playwright` plugin out of every unit worker. The second is tidier; it needs one unit run to confirm nothing in `tests/e2e/conftest.py` breaks collection without the plugin (the e2e tests are deselected by the default `-m`). - No new library; this is uv's own switch. ## What it saves or protects small: about 45 MB of download and 1 to 2 s per job in Checks, PostgreSQL and the monthly Dependencies job, and comments that stop saying something false ## Accessibility none ## Decisions - **Unit jobs: install Playwright openly, or keep the sync narrow with `--extra chromium`?** Recommended: `--no-group e2e --extra chromium` plus `UV_NO_SYNC`, after one green run; fall back to dropping `--no-group e2e` if collection needs the plugin. - **Side note, not this issue:** `tests/e2e/conftest.py:33` sets `DJANGO_ALLOW_ASYNC_UNSAFE=true` at import, and that conftest is imported when the unit suite collects `tests/e2e`, so the whole unit suite runs with Django's async-safety guard off. Worth a separate look. --- Found by the efficiency and reliability audit of 2026-10-30 (finding C1; index postulo/postulo#1108). Checked against `main` at `daee30b15` (2026-10-30).
tiagoagueda added this to the 0.6.0 milestone 2026-10-31 03:04:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#1135
No description provided.