Commit 6594150
Move per-module tests under each module (#1500)
Summary:
Pull Request resolved: #1500
Reorganize SPDL tests so each module owns its own tests. Tests previously lived under `fbcode/spdl/tests/<module>/` and depended on a shared root for fixtures and Buck macros. After this change, each module's tests live in `<module>/tests/`, which makes `buck test fbcode//spdl/<module>/...` run every test for that module without enumerating sibling test paths.
New layout:
- `spdl/io/tests/` (was `spdl/tests/io/`) — also hosts the shared `fixture.py` + `fb/__init__.py` (FFmpeg helpers), since only `io` and `cuda` tests use them and `cuda` tests already depend only on `spdl.io`.
- `spdl/cuda/tests/` (was `spdl/tests/cuda/`) — `PACKAGE` moved with it; depends on `//spdl/io/tests:fixture` and imports `from spdl.io.tests.fixture`.
- `spdl/pipeline/tests/` (was `spdl/tests/pipeline/`, including `fb/`).
- `spdl/dataloader/tests/` (was `spdl/tests/dataloader/`).
- `spdl/autoresearch/tests/` (was `spdl/tests/autoresearch/`, including `fb/`).
- `spdl/def.bzl` — new file holding the `spdl_tests_with_ffmpeg_variants` and `spdl_tests_with_python_variants` macros that were previously in `spdl/tests/def.bzl`.
- `fbcode/spdl/tests/` deleted entirely.
Other updates:
- `from ..fixture` (relative) is now `from .fixture` for `io` tests and `from spdl.io.tests.fixture` (absolute) for `cuda` tests.
- `spdl.io.tests/fb/__init__.py` resolves the FFmpeg resource via `importlib.resources.path("spdl.io.tests", "ffmpeg")`.
- Visibility lists in module BUCKs (`spdl/io/...`, `spdl/io/lib/...`, `spdl/io/utils/...`, `spdl/pipeline/...`, `spdl/pipeline/_iter_utils/...`, `spdl/pipeline/fb/...`, `spdl/pipeline/fb/lib/...`, `spdl/autoresearch/...`, `spdl/autoresearch/_app/...`, `spdl/autoresearch/_common/fb/...`, `spdl/autoresearch/core/...`, `spdl/autoresearch/pipeline_optimization/...`) updated to point to the new per-module test paths.
- `fbcode/spdl/PACKAGE` comments updated to reference the new `tests/` paths.
- `fbcode/spdl/.llms/skills/code-authoring/SKILL.md` updated to describe the new layout convention.
- GitHub workflows (`_build_linux.yml`, `_build_linux_cuda.yml`, `_build_macos.yml`, `_build_windows.yml`) updated so each pytest invocation lists the new per-module paths under the OSS `src/spdl/` prefix; `docs.yml` `paths-ignore` updated to `src/spdl/**/tests/**`.
- Hydra `_target_` string in `pipeline_hydra_test.py` updated from `spdl.tests.pipeline.fb...` to `spdl.pipeline.tests.fb...`.
Differential Revision: D1071407061 parent 67ee959 commit 6594150
90 files changed
Lines changed: 56 additions & 30 deletions
File tree
- .github/workflows
- src/spdl
- autoresearch/tests
- dataloader/tests
- io/tests
- core
- cuda
- pipeline/tests
- tests
- cuda
- io
- pipeline
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | 224 | | |
226 | 225 | | |
227 | 226 | | |
| |||
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments