Skip to content

Commit 05fd7fa

Browse files
mthrokmeta-codesync[bot]
authored andcommitted
Move per-module tests under each module
Summary: 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 fa5e934 commit 05fd7fa

83 files changed

Lines changed: 38 additions & 1477 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ 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/ \
181-
tests/dataloader/ \
182-
tests/pipeline/ \
183-
tests/autoresearch/
180+
src/spdl/io/tests/ \
181+
src/spdl/dataloader/tests/ \
182+
src/spdl/pipeline/tests/ \
183+
src/spdl/autoresearch/tests/
184184
185185
stub-check:
186186
needs: ["build"]

.github/workflows/_build_linux_cuda.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ 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/ \
225-
tests/io/
224+
src/spdl/cuda/tests/ \
225+
src/spdl/io/tests/
226226
227227
test-cpu:
228228
if: "${{ inputs.run-test == 'true' }}"
@@ -284,10 +284,10 @@ jobs:
284284
set -ex
285285
286286
pytest -v -n ${{ inputs.test-concurrency }} \
287-
tests/io \
288-
tests/dataloader \
289-
tests/pipeline \
290-
tests/autoresearch
287+
src/spdl/io/tests \
288+
src/spdl/dataloader/tests \
289+
src/spdl/pipeline/tests \
290+
src/spdl/autoresearch/tests
291291
292292
stub-check:
293293
needs: ["build"]

.github/workflows/_build_macos.yml

Lines changed: 4 additions & 4 deletions
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 \
132-
tests/dataloader \
133-
tests/pipeline \
134-
tests/autoresearch
131+
src/spdl/io/tests \
132+
src/spdl/dataloader/tests \
133+
src/spdl/pipeline/tests \
134+
src/spdl/autoresearch/tests

.github/workflows/_build_windows.yml

Lines changed: 4 additions & 4 deletions
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 \
138-
tests/dataloader \
139-
tests/pipeline \
140-
tests/autoresearch
137+
src/spdl/io/tests \
138+
src/spdl/dataloader/tests \
139+
src/spdl/pipeline/tests \
140+
src/spdl/autoresearch/tests

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
workflow_dispatch:
55
pull_request:
66
paths-ignore:
7-
- "tests/**"
7+
- "src/spdl/**/tests/**"
88
- "third_party/**"
99
- "*.md"
1010
branches:
1111
- main
1212
push:
1313
paths-ignore:
14-
- "tests/**"
14+
- "src/spdl/**/tests/**"
1515
- "third_party/**"
1616
- "*.md"
1717
branches:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)