Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ Triggers `deploy.yaml` after successful processing via `repository_dispatch`.



### [cluster-tests.yaml](cluster-tests.yaml)
**Clusters parser regression tests and stated sub-cluster counts**
### [script-tests.yaml](script-tests.yaml)
**Unit tests for the scripts**

| Trigger | Runs on |
|---------|---------|
| Pull requests changing the clusters data, parser or tests | PR branches |
| Pull requests | PR branches |

Runs every test in `scripts/tests/` (including the SEO checks and the clusters parser and sub-cluster counts) and `scripts/test_parse_disciplines_gdoc.py`.

### [check_images.yaml](workflows/check_images.yaml)
**Image validation in PRs**
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/cluster-tests.yaml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/script-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Script Tests

# =======================
# Script unit tests
# =======================
# Purpose: Runs every unit test in scripts/tests/ (SEO checks, data and staging
# scripts, clusters parser and stated sub-cluster counts) and the
# disciplines parser test. The tests take a few seconds.
# Triggers: Every pull request, since tests also read data, content and workflows

on:
pull_request:

permissions:
contents: read

jobs:
script-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"

# pandas: resource.py; python-docx: the disciplines parser;
# playwright (imported only, no browsers): the Doors preview checks.
- name: Install test dependencies
run: python3 -m pip install pandas python-docx playwright

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Neither test suite imports Playwright, so installing it adds CI time and an unnecessary dependency without covering any check. Remove playwright from this install command unless a Playwright-based test is added.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/script-tests.yaml, line 33:

<comment>Neither test suite imports Playwright, so installing it adds CI time and an unnecessary dependency without covering any check. Remove `playwright` from this install command unless a Playwright-based test is added.</comment>

<file context>
@@ -0,0 +1,39 @@
+      # pandas: resource.py; python-docx: the disciplines parser;
+      # playwright (imported only, no browsers): the Doors preview checks.
+      - name: Install test dependencies
+        run: python3 -m pip install pandas python-docx playwright
+
+      - name: Run tests in scripts/tests
</file context>
Suggested change
run: python3 -m pip install pandas python-docx playwright
run: python3 -m pip install pandas python-docx


- name: Run tests in scripts/tests
run: python3 -m unittest discover -s scripts/tests

- name: Run the disciplines parser test
run: python3 -m unittest discover -s scripts -p 'test_parse_disciplines_gdoc.py'
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Run both against a build (`hugo -d <dir>`), as `deploy.yaml` does:
- `python3 scripts/check_seo_html.py <dir>`. Add a regression check here when you fix a template.
- `python3 scripts/check_sitemap_lastmod.py <dir>/sitemap.xml [--compare-source]` (needs full Git history).

Unit tests: `python3 -m unittest discover -s scripts/tests`. `scripts/test_parse_disciplines_gdoc.py` sits outside that folder and no CI job runs it: `python3 -m unittest discover -s scripts -p 'test_parse_disciplines_gdoc.py'`.
Unit tests: `python3 -m unittest discover -s scripts/tests` and `python3 -m unittest discover -s scripts -p 'test_parse_disciplines_gdoc.py'`; `script-tests.yaml` runs both on every PR.