Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
*.swo
*~

# Test directories
# Local scratch space for test infrastructure (see tests/README.md).
# Everything under tests/ is committed EXCEPT tests/local/, which is where
# throwaway clones of real lecture repos go. Keeping them under a directory
# that can never be a repo name avoids shadowing one.
tests/local/

# Legacy scratch patterns — kept so existing local clones stay ignored.
# Prefer tests/local/ for anything new.
test-*/
examples-*/

Expand Down
2 changes: 1 addition & 1 deletion PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The core infrastructure is complete, hardened, and in production:
|---|---|---|
| `lecture-dp` | Full chain: `restore-jupyter-cache`, `build-lectures`, `build-jupyter-cache`, `publish-gh-pages` | `@v0.8.0` |
| `lecture-python.myst` | `preview-netlify` (ci.yml) | `@v0.8.0` |
| `test-lecture-python-intro` | Full chain (test harness) | `@v0.6.0` |
| `test-actions-lecture-intro` | Full chain (canary — see #100 stage 2) | `@v0.6.0` ⚠️ stale, dormant |

Consumer/migration tracking lives in [QuantEcon/meta#321](https://github.com/QuantEcon/meta/issues/321); the preview-unification rollout is planned in [QuantEcon/meta#327](https://github.com/QuantEcon/meta/issues/327).

Expand Down
16 changes: 10 additions & 6 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ Fixtures are salted with `run_id`-`run_attempt` so cache keys are unique per run

## Local Test Fixtures

### `test-lecture-python-intro/` (git-ignored)
### `tests/local/` (git-ignored)

A local clone of `lecture-python-intro` used for testing workflows locally. This directory is excluded from version control via the `.gitignore` pattern `test-*/`.
Scratch space for local clones of real lecture repos, used to test workflows on your own machine against something larger than the committed fixture. Ignored via `tests/local/` in `.gitignore`, so it exists only in your working tree — never committed, and read by no workflow. See [tests/README.md](tests/README.md) for the wider layout.

> **Not to be confused with [`QuantEcon/test-actions-lecture-intro`](https://github.com/QuantEcon/test-actions-lecture-intro)**, the canary repo that runs the actions in real CI (#100 stage 2). This is a throwaway directory; that is a live repo.
>
> Local clones used to be documented at the repo root as `test-lecture-python-intro/`, one character away from the canary's old name — close enough that the two were repeatedly confused. A path under `tests/local/` cannot collide with a repo name. The old `test-*/` ignore pattern is retained, so existing local clones stay ignored where they are.

**Purpose:**
- Test container builds locally
Expand All @@ -49,8 +53,8 @@ A local clone of `lecture-python-intro` used for testing workflows locally. This

**Setup:**
```bash
# Clone test fixture (from actions repo root)
git clone https://github.com/QuantEcon/lecture-python-intro.git test-lecture-python-intro
# from the repo root
git clone https://github.com/QuantEcon/lecture-python-intro.git tests/local/lecture-python-intro
```

**Usage with local scripts:**
Expand Down Expand Up @@ -110,7 +114,7 @@ docker run --rm ghcr.io/quantecon/quantecon:latest pdflatex --version

## Phase 2: Test Repository Workflow

### 2.1 Update test-lecture-python-intro
### 2.1 Update test-actions-lecture-intro

Create container-based workflow:

Expand Down Expand Up @@ -248,7 +252,7 @@ Pick a test repository or create a fork:
2. Monitor for 1 week
3. Collect metrics (build times, success rate)

Complete testing with test-lecture-python-intro, validate all metrics.
Complete testing with `QuantEcon/test-actions-lecture-intro`, validate all metrics.

### Stage 2: CPU Lecture Repositories

Expand Down
34 changes: 34 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Tests

Home for this repo's test infrastructure. Today it holds the local scratch area; it exists as a named place so future test tooling has somewhere obvious to land instead of accumulating at the repo root.

See [TESTING.md](../TESTING.md) for the strategy and how to run things.

## What lives where

Test assets are currently spread across the repo, each next to what it tests. This table is the map — nothing has been moved.

| Location | What | Committed? |
|---|---|---|
| `.github/workflows/test-actions.yml` | The PR harness — 14 jobs exercising the cache, environment and build actions via `uses: ./` local paths (#100 stage 1) | yes |
| `.github/fixtures/mini-lectures/` | Fixture for the harness: a two-page book with a real executed code cell, so builds populate a genuine `_build/.jupyter_cache` | yes |
| `containers/quantecon/tests/` | Container smoke tests and their minimal book | yes |
| `tests/local/` | Throwaway clones of real lecture repos, for manual testing | **no** — git-ignored |
| [`QuantEcon/test-actions-lecture-intro`](https://github.com/QuantEcon/test-actions-lecture-intro) | The canary repo (#100 stage 2). Pinned `@v0`, so it exercises `publish-gh-pages` and `preview-netlify` — neither is testable in this repo | separate repo |

## `tests/local/`

Git-ignored. Clone real lecture repos here when you want to test against something larger than the committed fixture:

```bash
# from the repo root
git clone https://github.com/QuantEcon/lecture-python-intro.git tests/local/lecture-python-intro
```

Nothing in CI reads this directory — it exists only in your working tree.

Put local clones **here** rather than at the repo root. A root-level `test-lecture-python-intro/` shadowed the canary repo's old name closely enough that the two were repeatedly confused, including in the PR that wrote this file. A path under `tests/local/` cannot collide with a repo name.

## Adding test infrastructure

Fixtures that a workflow consumes should stay next to that workflow (`.github/fixtures/`, `containers/*/tests/`) so the `paths:` filters keep working. Use `tests/` for tooling that spans more than one of them — a shared harness runner, cross-action integration scripts, or fixture-generation tooling.