MPT-19892: add E2E tests for Extension base service - Includes renaming from extensibility -> integrations#277
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (5)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughThe PR renames the Extensibility API surface to Integration across the client and resource packages, updates API endpoints from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
d911034 to
0e44cd6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/extensibility/extensions/conftest.py`:
- Around line 37-40: The teardown currently swallows all MPTAPIError exceptions
when calling extensions_service.delete(extension.id); update the except block to
check error.status (not error.status_code) and only suppress the exception if
error.status == 404 (resource already deleted); for any other status re-raise
the exception so real cleanup failures are not masked, and keep the diagnostic
print/log mentioning extension.id and the error for the suppressed 404 case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: c4bbd156-85b2-49da-98eb-7a7eb1333520
📒 Files selected for processing (6)
e2e_config.test.jsontests/e2e/extensibility/__init__.pytests/e2e/extensibility/extensions/__init__.pytests/e2e/extensibility/extensions/conftest.pytests/e2e/extensibility/extensions/test_async_extensions.pytests/e2e/extensibility/extensions/test_sync_extensions.py
✅ Files skipped from review due to trivial changes (1)
- e2e_config.test.json
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/e2e/extensibility/extensions/test_sync_extensions.py
- tests/e2e/extensibility/extensions/test_async_extensions.py
0e44cd6 to
5c7c216
Compare
5c7c216 to
ac93e5e
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/unit/test_mpt_client.py (1)
43-44: Consider adding compatibility assertions for legacy client attributeIf backward compatibility is intended, add regression coverage for
.extensibility(deprecated alias) so this doesn’t regress silently in later changes.Also applies to: 76-77
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/unit/test_mpt_client.py` around lines 43 - 44, Add regression assertions that the deprecated alias .extensibility still maps to the same object as the new attribute for Integration in tests: after instantiating or collecting the ("integration", Integration) case, assert that instance.extensibility is present and equal (is or == depending on intended semantics) to the current attribute (e.g., instance.extensibility is instance.extensible_attribute_or_name); repeat the same assertion for the other occurrence referenced around lines 76-77 so the legacy alias cannot regress silently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@mpt_api_client/mpt_client.py`:
- Around line 96-99: Add a backward-compatible deprecated alias for the renamed
property by adding an extensibility property that returns the same
AsyncIntegration instance as integration but emits a DeprecationWarning;
specifically, keep the existing integration(self) -> AsyncIntegration method
unchanged and implement a new extensibility(self) -> AsyncIntegration that
calls/returns AsyncIntegration(http_client=self.http_client) (or reuses
self.integration()) and uses the warnings module to warn users about the rename
to integration; apply the same pattern for the other duplicate location where
the alias was removed (the second integration/extensibility occurrence).
In `@mpt_api_client/resources/integration/integration.py`:
- Around line 8-9: The rename from Extensibility/AsyncExtensibility to
Integration/AsyncIntegration breaks existing imports; restore backwards
compatibility by adding compatibility aliases: keep the new classes Integration
and AsyncIntegration as-is and define Extensibility = Integration and
AsyncExtensibility = AsyncIntegration (and emit a DeprecationWarning in their
__init__ or module import path) so downstream code can still import the old
names while signaling deprecation; update the module docstring or comments to
note the alias and planned removal.
---
Nitpick comments:
In `@tests/unit/test_mpt_client.py`:
- Around line 43-44: Add regression assertions that the deprecated alias
.extensibility still maps to the same object as the new attribute for
Integration in tests: after instantiating or collecting the ("integration",
Integration) case, assert that instance.extensibility is present and equal (is
or == depending on intended semantics) to the current attribute (e.g.,
instance.extensibility is instance.extensible_attribute_or_name); repeat the
same assertion for the other occurrence referenced around lines 76-77 so the
legacy alias cannot regress silently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 512bc115-d865-44a1-8cbf-7d77e87e1a46
📒 Files selected for processing (23)
e2e_config.test.jsonmpt_api_client/mpt_client.pympt_api_client/resources/__init__.pympt_api_client/resources/extensibility/__init__.pympt_api_client/resources/integration/__init__.pympt_api_client/resources/integration/extensions.pympt_api_client/resources/integration/integration.pympt_api_client/resources/integration/mixins/__init__.pympt_api_client/resources/integration/mixins/extension_mixin.pypyproject.tomltests/e2e/integration/__init__.pytests/e2e/integration/extensions/__init__.pytests/e2e/integration/extensions/conftest.pytests/e2e/integration/extensions/test_async_extensions.pytests/e2e/integration/extensions/test_sync_extensions.pytests/unit/resources/extensibility/test_extensibility.pytests/unit/resources/integration/__init__.pytests/unit/resources/integration/conftest.pytests/unit/resources/integration/mixins/__init__.pytests/unit/resources/integration/mixins/test_extension_mixin.pytests/unit/resources/integration/test_extensions.pytests/unit/resources/integration/test_integration.pytests/unit/test_mpt_client.py
💤 Files with no reviewable changes (2)
- tests/unit/resources/extensibility/test_extensibility.py
- mpt_api_client/resources/extensibility/init.py
✅ Files skipped from review due to trivial changes (1)
- mpt_api_client/resources/integration/mixins/init.py
🚧 Files skipped from review as they are similar to previous changes (1)
- e2e_config.test.json
- Add sync and async E2E tests for /public/v1/extensibility/extensions - Tests cover: create, get, not_found, update, delete, filter, download_icon, publish, unpublish - Add extensibility.extension.id placeholder to e2e_config.test.json Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ac93e5e to
f3f16bc
Compare
|



Summary
Adds E2E tests for the Extension base service (
/public/v1/extensibility/extensions).Changes
New files
tests/e2e/extensibility/extensions/conftest.py— fixtures:extensions_service,async_extensions_service,extension_id,extension_data,created_extension(with icon upload + auto-cleanup), async variantstests/e2e/extensibility/extensions/test_sync_extensions.pytests/e2e/extensibility/extensions/test_async_extensions.pyModified
e2e_config.test.json— addextensibility.extension.idplaceholder (update with real ID before running)Tests (sync + async)
test_create_extensiontest_get_extensiontest_get_extension_not_foundMPTAPIError404test_update_extensiontest_delete_extensiontest_filter_extensionstest_download_iconFileModeltest_publish_extensionPublictest_unpublish_extensionPrivateCloses MPT-19892