Conversation
Reviewer's GuideAdds comprehensive pytest-based coverage for multiple ibutsu_client API modules, introducing reusable test data factory fixtures and replacing minimal unittest stubs with detailed success and error-path tests that mock api_client.call_api and validate both standard and *_with_http_info endpoints. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
a841ea2 to
df12dea
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates API module test coverage from unittest to pytest and implements comprehensive test coverage to reach 85% coverage. The migration includes replacing unittest.TestCase classes with pytest-style test classes and adding extensive test cases for success paths, error conditions, and HTTP status code handling.
Key Changes:
- Migration from unittest to pytest framework across 8 API test modules
- Addition of comprehensive test data factory fixtures in conftest.py
- Expanded test coverage including success cases, error handling, and
_with_http_infomethod variants
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| test/conftest.py | Added factory fixtures for generating sample test data (projects, runs, results, artifacts, pagination, users, dashboards, widget configs, groups, tokens) |
| test/test_widget_config_api.py | Migrated to pytest; added 17 comprehensive test cases covering CRUD operations, error handling, and HTTP status codes |
| test/test_widget_api.py | Migrated to pytest; added 12 test cases covering widget data generation and widget types with various parameters |
| test/test_user_api.py | Migrated to pytest; added 16 test cases covering token and user management operations |
| test/test_task_api.py | Migrated to pytest; added 11 test cases covering task status monitoring (pending, running, completed, failed) |
| test/test_login_api.py | Migrated to pytest; added 20 test cases covering authentication, registration, password recovery, and login configuration |
| test/test_import_api.py | Migrated to pytest; added 13 test cases covering file import operations with JUnit and Ibutsu archive formats |
| test/test_group_api.py | Migrated to pytest; added 13 test cases covering group CRUD operations with pagination and filtering |
| test/test_admin_user_management_api.py | Migrated to pytest; added 16 test cases covering admin-level user management operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
df12dea to
0a0dba4
Compare
d872afc to
29b2e14
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
===========================================
+ Coverage 68.68% 84.57% +15.88%
===========================================
Files 58 58
Lines 4783 4783
Branches 496 496
===========================================
+ Hits 3285 4045 +760
+ Misses 1338 496 -842
- Partials 160 242 +82
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Use sample_* functions to provide data during parametrization into the mock_response fixture
29b2e14 to
9c20c02
Compare
Move API module test coverage to pytest.
implement coverage for all the stubs.
Summary by Sourcery
Improve test coverage for multiple Ibutsu client APIs using pytest-based tests and shared test data factories.
Tests: