test: add unit test suite and CI workflow#68
Open
adi-suresh01 wants to merge 2 commits into
Open
Conversation
neuralset 0.0.2 references exca.steps.base.NoValue, which was removed in
exca 0.5.26 (the symbol moved to exca.steps.identity). neuralset 0.0.2
declares exca>=0.5.20, so a fresh install resolves exca 0.5.26 and fails
at import time:
AttributeError: module 'exca.steps.base' has no attribute 'NoValue'
(neuralset/events/study.py, in StudyLoader.run)
tribev2 also imports exca directly (exca.ConfDict, exca.TaskInfra) without
declaring it. This adds exca as an explicit dependency, capped to the range
that exposes the API neuralset 0.0.2 relies on (0.5.20 through 0.5.25).
Verified in a clean Python 3.12 venv: install now resolves exca 0.5.25 and
'from tribev2.demo_utils import TribeModel' imports successfully.
Closes facebookresearch#65
Adds the first tests/ for the project and a GitHub Actions workflow. Tests (CPU only, no model weights, datasets, or network): - TemporalSmoothing: depthwise conv shape, Gaussian kernel normalization and symmetry, length preservation, constant-signal invariance. - demo_utils.VALID_SUFFIXES: modality set, non-empty lowercase dot-prefixed suffixes, no cross-modality overlap. - ExtractWordsFromAudio: unsupported-language guard and default language. CI: pytest on Python 3.11 and 3.12, plus black and isort checks scoped to tests/ for now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the project's first automated tests and a CI workflow. The repo currently has a
testextra but notests/directory and no CI, so regressions (including install breaks) go uncaught.What this adds
tests/(CPU only, no model weights, datasets, network, or theuvx/whisperxtoolchain):test_temporal_smoothing.py:TemporalSmoothingbuilds a depthwiseConv1d; the Gaussian kernel is normalized per channel and symmetric; output length is preserved; a constant signal is unchanged in the padding-free interior.test_demo_utils.py: theVALID_SUFFIXEScontract (expected modalities, non-empty lowercase dot-prefixed suffixes, no cross-modality overlap).test_eventstransforms.py:ExtractWordsFromAudiorejects unsupported languages before any transcription subprocess, and defaults to English..github/workflows/ci.yml:testjob: pytest on Python 3.11 and 3.12.lintjob: black and isort (settings read frompyproject.toml), scoped totests/for now to avoid failing on pre-existing formatting in the package; widening is left as a follow-up.permissions: contents: read, concurrency cancel-in-progress, and pip caching keyed onpyproject.toml.Also adds
[tool.pytest.ini_options] testpaths = ["tests"]so discovery is explicit.The full
pip install -e ".[test]"in thetestjob doubles as a clean-install smoke test for the dependency resolution fixed in #65.Stacking note
This branch is stacked on #67 (the exca cap that repairs the clean install). Without that fix the package cannot be imported, so the suite would not run. The
pyproject.tomlchange shown here therefore includes the one-line exca cap from #67; once #67 merges, this branch rebases ontomainand that line drops out, leaving only the tests, CI, and pytest config. Please review or merge #67 first.Verification
Local run on Python 3.12:
13 passed.black --check tests/andisort --check-only tests/both clean.