Skip to content

Commit 4a2236d

Browse files
mthrokmeta-codesync[bot]
authored andcommitted
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: D107140706
1 parent 8c651b2 commit 4a2236d

89 files changed

Lines changed: 19 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/_build_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
178178
python -c 'import spdl.io.utils;assert not spdl.io.utils.built_with_cuda()'
179179
pytest -v -n ${{ inputs.test-concurrency }} \
180-
tests/io/ \
180+
tests/io/core/ \
181181
tests/dataloader/ \
182182
tests/pipeline/ \
183183
tests/autoresearch/

.github/workflows/_build_linux_cuda.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ jobs:
221221
python -c 'import spdl.io.utils;assert spdl.io.utils.built_with_nvcodec()'
222222
fi
223223
pytest -v -n ${{ inputs.test-concurrency }} \
224-
tests/cuda/ \
225224
tests/io/
226225
227226
test-cpu:
@@ -284,7 +283,7 @@ jobs:
284283
set -ex
285284
286285
pytest -v -n ${{ inputs.test-concurrency }} \
287-
tests/io \
286+
tests/io/core \
288287
tests/dataloader \
289288
tests/pipeline \
290289
tests/autoresearch

.github/workflows/_build_macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
run: |
129129
set -ex
130130
pytest -v -n ${{ inputs.test-concurrency }} \
131-
tests/io \
131+
tests/io/core \
132132
tests/dataloader \
133133
tests/pipeline \
134134
tests/autoresearch

.github/workflows/_build_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
run: |
135135
set -ex
136136
pytest -v -n ${{ inputs.test-concurrency }} \
137-
tests/io \
137+
tests/io/core \
138138
tests/dataloader \
139139
tests/pipeline \
140140
tests/autoresearch

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
pull_request:
66
paths-ignore:
77
- "tests/**"
8+
- "src/spdl/**/tests/**"
89
- "third_party/**"
910
- "*.md"
1011
branches:
1112
- main
1213
push:
1314
paths-ignore:
1415
- "tests/**"
16+
- "src/spdl/**/tests/**"
1517
- "third_party/**"
1618
- "*.md"
1719
branches:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)