chore(test): add unit test scaffold with testcase harness#6
chore(test): add unit test scaffold with testcase harness#6abhijeet-dhumal wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
d81b052 to
fe3db3c
Compare
11d63da to
21b0fdc
Compare
There was a problem hiding this comment.
Pull request overview
Expands unit-test coverage and supporting infrastructure for core and Trainer MCP components.
Changes:
- Adds validation, security, resilience, policy, auth, and Trainer tests.
- Introduces shared mocks, fixtures, and table-driven test helpers.
- Updates pytest configuration and contributor testing guidance.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/trainer/test_training.py |
Tests training validation and helpers. |
tests/unit/trainer/test_platform.py |
Tests runtime validation. |
tests/unit/trainer/test_planning.py |
Adds planning helper tests. |
tests/unit/trainer/test_monitoring.py |
Tests failure-pattern detection. |
tests/unit/trainer/test_lifecycle.py |
Tests lifecycle validation. |
tests/unit/trainer/test_discovery.py |
Tests job discovery behavior. |
tests/unit/core/test_tool_integrity.py |
Adds metadata integrity checks. |
tests/unit/core/test_security.py |
Expands security tests. |
tests/unit/core/test_resilience.py |
Tests resilience primitives. |
tests/unit/core/test_policy.py |
Tests policy filtering and state. |
tests/unit/core/test_config.py |
Tests configuration loading. |
tests/unit/core/test_auth.py |
Tests authentication helpers. |
tests/unit/conftest.py |
Adds SDK and Kubernetes mocks. |
tests/unit/common/test_utils.py |
Adds utility tests. |
tests/unit/common/test_types.py |
Tests response and exception types. |
tests/unit/common/test_constants.py |
Tests error classification. |
tests/unit/common/__init__.py |
Defines the common test package. |
tests/conftest.py |
Adds global test-state fixtures. |
tests/common.py |
Adds shared test utilities. |
pyproject.toml |
Registers pytest markers. |
kubeflow_mcp/cli_test.py |
Stabilizes an auth-provider assertion. |
CONTRIBUTING.md |
Documents test layout and commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @abhijeet-dhumal I'll help review this PR. |
|
@andreyvelich @thesuperzapper @szaher @astefanutti @modichika |
|
Hey @abhijeet-dhumal I have reviewed every files in tests/ folder that you have changed and it's amazing to see the work.
I have included comments in two files, lmk your thoughts! |
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
Signed-off-by: abhijeet-dhumal <abhijeetdhumal652@gmail.com>
636d5a8 to
e453c35
Compare
@modichika Glad you liked the LLD used for scaffold 😊 I don’t see the two file comments you added on the PR yet (might still be in an unsubmitted review draft). Mind pasting them here or re-submitting the review so I can address them? 👀 Also just rebased onto main after #46 landed .. ✅ |
|
|
||
| ### Unit Testing | ||
| To run unit tests locally, use the following `make` command: | ||
| ```bash |
There was a problem hiding this comment.
Hey @abhijeet-dhumal great work with the CONTRIBUTIING.md file it sets clear tests/ structure for new contributors.
Is it ok to add a prerequisite note thatuvneeds to be installed(acc. to thier local env like macos/linux or windows) in the environment for these make commands to work?
Because when I first tried it, it gave an error as you can see in the image.
There was a problem hiding this comment.
Thanks @modichika for reviewing the PR 🙌
Agreed! I will mention in docs accordingly ..
| def test_returns_false_for_module_not_found(self): | ||
| assert is_k8s_not_found(ModuleNotFoundError("not found")) is False | ||
|
|
||
| # TODO(test): test chained exception (__cause__) with ApiException 404 |
There was a problem hiding this comment.
These chained exception tests look important for debugging do you have a rough idea of when you'd like to get those covered? Because cause and context must be known of 404 Not Found API Error.
There was a problem hiding this comment.
Agreed they’re useful for 404 debugging left as TODO(test) so this PR can land the scaffold without growing further.
Aiming at a follow-up under #9 right after this merges (ApiException cause/context on the discovery/monitoring mocks). If you’d rather track it as its own issue, I can open one 👍
There was a problem hiding this comment.
Yeah I can take up on that and solve it?
|
Now it will be showing! |
Description
Checklist
make test-python)make verify)Related Issues
Fixes. : #9