Add Python SDK & model runner test framework (186 tests)#1
Merged
Conversation
Contributor
Jovonni
commented
Mar 1, 2026
- 29 test files across 4 categories: SDK unit (119), framework integration (22), model runner (37), E2E integration (8)
- Shared conftest.py with HTTP mocking, env fixtures, sample models, singleton reset
- CI workflow with 4 parallel jobs: SDK unit (Python 3.9/3.11/3.12 matrix), framework, model runner, integration
- Makefile targets: test-sdk, test-sdk-unit, test-sdk-frameworks, test-sdk-cov
- pyproject.toml test extras
- 29 test files across 4 categories: SDK unit (119), framework integration (22), model runner (37), E2E integration (8) - Shared conftest.py with HTTP mocking, env fixtures, sample models, singleton reset - CI workflow with 4 parallel jobs: SDK unit (Python 3.9/3.11/3.12 matrix), framework, model runner, integration - Makefile targets: test-sdk, test-sdk-unit, test-sdk-frameworks, test-sdk-cov - pyproject.toml test extras
- Fix: guard pandas/numpy imports with pytest.importorskip in test_datasets.py and test_features.py (caused CI collection errors) - Fix: add numpy/pandas to SDK unit test CI install step - Fix: add fix/** branch trigger to test-python.yml - Add TF/Keras detection tests to test_detect_framework.py - Add TF serialization roundtrip test to test_serialize_model.py - Add TF/Keras model registration test to test_models.py - Add register_model roundtrip integration tests: sklearn, pytorch, tensorflow — verifies full pipeline (detect → serialize → codegen → exec train/infer) through the SDK abstraction layer - Remove unnecessary _serialize_model mock from pytorch registration test (SimpleNet is now at module level, picklable by torch.save) 190 tests passing, 8 skipped.
test_create_dataset_from_dataframe_parquet requires pyarrow/fastparquet for pd.to_parquet() and pd.read_parquet(). Skip gracefully in CI environments that don't have it.
Tests the full roundtrip: serialize model → mock API artifact download → load_model() deserializes → verify usable model object. - sklearn: pickle.dumps → load_model → LogisticRegression with correct params - PyTorch: torch.save → load_model → nn.Module with working forward pass - TensorFlow: model.save(.keras) → load_model → working predict() - Unknown framework: raises ValueError This closes the last framework-aware SDK function that wasn't tested per model type. All framework-specific code paths now have coverage.
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.