QuantEcon / QuantEcon/actions

test: unify container smoke tests and make the fixture exercise the Dockerfiles

Open
#108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

infrastructure
Dominant language
Shell
Stars
0
Forks
1
Avg merge
32m
Merged PRs (30d)
3

Description

Three drifted copies of the container smoke test, and a fixture exercising none of the non-trivial Dockerfile behaviour (2026-07 audit). v0.11.0 (#125) shipped most of the fix; items 1-3 remain. containers/quantecon is the full image, containers/quantecon-build the lean one (containers/quantecon-build/README.md:1).

1. The fixture sidesteps the theme and the FreeSerif path

containers/quantecon/tests/minimal-jupyter-book/_config.yml:26 (html_theme: sphinx_book_theme) never imports the quantecon-book-theme both images ship; :28 (fontpkg: "") suppresses the FreeSerif path the .otf-symlink workaround exists to fix.

fontpkg matters most: both Dockerfiles symlink .otf for the FreeFont TTFs because Sphinx's default xelatex fontpkg wants Extension=.otf while Ubuntu ships .ttf (containers/quantecon/Dockerfile:54-61, stated :55-56; containers/quantecon-build/Dockerfile:54-59); emptying it takes the TeX-defaults path, so a symlink regression stays green. test-xelatex.tex:5 sets \setmainfont{DejaVu Serif}, so nothing else loads a FreeFont face through fontspec.

Theme versions can diverge too: full pins quantecon-book-theme==0.21.0 (containers/quantecon/environment.yml:17), lean a floor >=0.21.0 (containers/quantecon-build/environment.yml:66).

Real regression risk: dropping fontpkg can legitimately turn one image's pdflatex build red — the point of the change, so validate before merge (below).

2. test-container.sh is dead code the README still points at

containers/quantecon/tests/test-container.sh: untouched since 2025-11-20 (48d6a92), in no workflow, set -e only (:5, no -W), full image hardcoded at :14, :21, :29, :37 (lean invisible) — superseded by smoke-test.sh in a real container job. But containers/quantecon/README.md:223-228 still gives it as "To run all tests:", :230-234 presents its four steps as the test suite, and :241 demotes it only to an "Older…" entry. Deleting it loses no local Docker path: run-local-tests.sh:31-34 spells out the docker run … smoke-test.sh invocation, caveat HOME=/root so it cannot reproduce #85.

3. run-local-tests.sh drifts from the shared script

run-local-tests.sh:86 (html) and :99 (pdflatex) omit -W --keep-going, which smoke-test.sh:55 and :84 both pass, so a warning-level problem that fails CI passes locally. Align them, or comment that the divergence is deliberate for the macOS host toolchain.

Validating a fixture change (read before item 1)

test-container.yml fires only on workflow_dispatch or a completed Build QuantEcon Containers run (:6-11) — no pull_request trigger, so a fixture PR gets no CI signal. Dispatch on the branch with gh workflow run test-container.yml --ref <your-branch>; checkout uses github.event.workflow_run.head_sha || github.sha (:45), so it tests your fixture against the published :latest images. Otherwise the first signal is post-merge: build-containers.yml rebuilds on a push to main touching containers/**, then Test Container follows.

Not #100 (no automated tests for publish/preview/cache action logic), which stays open for that gap; this issue is the container tests being unable to fail.

Checklist

  • containers/tests/smoke-test.sh <image> — pull, marker, xelatex, html, pdflatex, size — done in v0.11.0 (#125) as containers/quantecon/tests/smoke-test.sh (marker :44-45, xelatex :48-50, html :55, pdflatex :84); keep it there, not the proposed containers/tests/; pull is now the container: job and size a separate job (test-container.yml:77-101, compressed manifest bytes, not the old docker images figure)
  • Collapse the two test-container.yml jobs into a matrix calling it — done in v0.11.0 (#125): .github/workflows/test-container.yml:22-25 matrix over quantecon/quantecon-build, :32-37 real container: jobs, :52-53 asserts HOME=/github/home so a silent revert to docker run is caught
  • Confirm the lean image now gets a pdflatex build — done in v0.11.0 (#125), shared script :84 on both legs
  • Fixture: execution on — done in v0.11.0 (#125): minimal-jupyter-book/_config.yml:10 execute_notebooks: "force", :16 raise_on_error: true; intro.md:33-44 numpy/scipy, :48-56 pandas, :63-81 a real matplotlib PNG, :92-102 plotly to_image; it can still fail — smoke-test.sh:40-42 stages a raising cell, :59-78 requires red and the sentinel, wired at test-container.yml:61-63 with if: always()
  • Verify the fixture would have caught the kaleido/Chrome regression from #85 — done in v0.11.0 (#125): the plotly to_image cell runs in a real container: job, the HOME=/github/home condition #85 needed
  • set -euo pipefail in run-local-tests.sh — done in v0.11.0 (#125): :5, plus a python/kaleido preflight at :24-42
  • Fixture: remove the fontpkg: "" override at _config.yml:28
  • Fixture: switch _config.yml:26 to quantecon_book_theme
  • Dispatch Test Container on the branch and confirm both images stay green with the fixture change
  • Delete containers/quantecon/tests/test-container.sh
  • Repoint containers/quantecon/README.md:223-234 at smoke-test.sh / the Test Container workflow and drop the :241 "Older…" entry
  • Align run-local-tests.sh:86 and :99 with -W --keep-going, or document why the macOS host toolchain differs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the remaining checklist in containers/quantecon/tests/minimal-jupyter-book/_config.yml, then compare containers/quantecon/tests/test-container.sh, smoke-test.sh, run-local-tests.sh, and containers/quantecon/README.md. Read .github/workflows/test-container.yml before changing the fixture, and dispatch it on the branch with gh workflow run test-container.yml --ref . Done means both images pass the fixture, the obsolete script is removed, the README points to the shared workflow, and local flags are aligned or their divergence is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions, shell
Domain
build-system, ci-cd, devops, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.