Skip to content

MPT-19892: add E2E tests for Extension base service - Includes renaming from extensibility -> integrations#277

Merged
albertsola merged 1 commit intomainfrom
MPT-19892/e2e-extension-base-service
Apr 7, 2026
Merged

MPT-19892: add E2E tests for Extension base service - Includes renaming from extensibility -> integrations#277
albertsola merged 1 commit intomainfrom
MPT-19892/e2e-extension-base-service

Conversation

@albertsola
Copy link
Copy Markdown
Contributor

@albertsola albertsola commented Apr 3, 2026

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 variants
  • tests/e2e/extensibility/extensions/test_sync_extensions.py
  • tests/e2e/extensibility/extensions/test_async_extensions.py

Modified

  • e2e_config.test.json — add extensibility.extension.id placeholder (update with real ID before running)

Tests (sync + async)

Test Description
test_create_extension Create with icon file, assert name
test_get_extension Get by config ID
test_get_extension_not_found Bogus ID raises MPTAPIError 404
test_update_extension Update name + logo
test_delete_extension Delete (act only)
test_filter_extensions Iterate with filter
test_download_icon Returns FileModel
test_publish_extension Status becomes Public
test_unpublish_extension Status becomes Private

regenerate and token excluded — sensitive credential operations.

Closes MPT-19892

  • Renamed the extensibility resource to integration across the codebase:
    • Classes: Extensibility → Integration, AsyncExtensibility → AsyncIntegration
    • Public exports and imports updated accordingly
  • Updated API endpoints and service paths:
    • /public/v1/extensibility/extensions → /public/v1/integration/extensions
    • Service mixins and endpoint constants updated
  • Added E2E tests for the Integration (extensions) service (sync + async):
    • tests/e2e/integration/extensions/conftest.py — fixtures and create-with-teardown (icon upload + auto-cleanup)
    • tests/e2e/integration/extensions/test_sync_extensions.py — get, get-not-found, filter, plus skipped create/update/delete/download/publish/unpublish tests
    • tests/e2e/integration/extensions/test_async_extensions.py — async equivalents (same coverage and skipped tests)
    • e2e_config.test.json — added integration.extension.id placeholder
  • Unit tests and fixtures migrated to integration:
    • Removed old extensibility unit tests; added/updated tests under tests/unit/resources/integration/ (conftest, test_integration, test_extensions, mixins tests)
  • Packaging/lint config updates:
    • pyproject.toml per-file-ignores updated to target mpt_api_client/resources/integration/* and new E2E integration test paths
  • Misc:
    • New package mpt_api_client/resources/integration with re-exports and mixins adjustments
    • Sensitive operations (regenerate/token) intentionally excluded from E2E

@albertsola albertsola requested a review from a team as a code owner April 3, 2026 10:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c29f13ea-86aa-44cb-8f05-01bc9d058c67

📥 Commits

Reviewing files that changed from the base of the PR and between ac93e5e and f3f16bc.

📒 Files selected for processing (23)
  • e2e_config.test.json
  • mpt_api_client/mpt_client.py
  • mpt_api_client/resources/__init__.py
  • mpt_api_client/resources/extensibility/__init__.py
  • mpt_api_client/resources/integration/__init__.py
  • mpt_api_client/resources/integration/extensions.py
  • mpt_api_client/resources/integration/integration.py
  • mpt_api_client/resources/integration/mixins/__init__.py
  • mpt_api_client/resources/integration/mixins/extension_mixin.py
  • pyproject.toml
  • tests/e2e/integration/__init__.py
  • tests/e2e/integration/extensions/__init__.py
  • tests/e2e/integration/extensions/conftest.py
  • tests/e2e/integration/extensions/test_async_extensions.py
  • tests/e2e/integration/extensions/test_sync_extensions.py
  • tests/unit/resources/extensibility/test_extensibility.py
  • tests/unit/resources/integration/__init__.py
  • tests/unit/resources/integration/conftest.py
  • tests/unit/resources/integration/mixins/__init__.py
  • tests/unit/resources/integration/mixins/test_extension_mixin.py
  • tests/unit/resources/integration/test_extensions.py
  • tests/unit/resources/integration/test_integration.py
  • tests/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 (5)
  • mpt_api_client/resources/integration/mixins/init.py
  • tests/unit/resources/integration/conftest.py
  • tests/unit/resources/integration/test_integration.py
  • tests/e2e/integration/extensions/test_sync_extensions.py
  • e2e_config.test.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • tests/unit/resources/integration/test_extensions.py
  • mpt_api_client/resources/integration/extensions.py
  • tests/unit/test_mpt_client.py
  • mpt_api_client/resources/init.py
  • tests/unit/resources/integration/mixins/test_extension_mixin.py
  • mpt_api_client/resources/integration/integration.py
  • mpt_api_client/mpt_client.py
  • tests/e2e/integration/extensions/test_async_extensions.py

📝 Walkthrough

Walkthrough

The PR renames the Extensibility API surface to Integration across the client and resource packages, updates API endpoints from /public/v1/extensibility/... to /public/v1/integration/..., adjusts exports/imports, updates flake8 ignores, and adds/updates unit and e2e tests and fixtures to target the new Integration resources and config key.

Changes

Cohort / File(s) Summary
Configuration & Lints
e2e_config.test.json, pyproject.toml
Added integration.extension.id to e2e config; updated flake8 per-file-ignores to reference mpt_api_client/resources/integration/... and tests under tests/e2e/integration/..., and added/adjusted WPS ignores for new paths.
Client API
mpt_api_client/mpt_client.py
Replaced client property extensibilityintegration on AsyncMPTClient/MPTClient, switching return types from AsyncExtensibility/Extensibility to AsyncIntegration/Integration.
Resource package exports
mpt_api_client/resources/__init__.py, mpt_api_client/resources/extensibility/__init__.py, mpt_api_client/resources/integration/__init__.py
Removed re-exports of AsyncExtensibility/Extensibility; added new integration package and re-exports for AsyncIntegration/Integration.
Integration resource implementation
mpt_api_client/resources/integration/integration.py, mpt_api_client/resources/integration/extensions.py, mpt_api_client/resources/integration/mixins/__init__.py, mpt_api_client/resources/integration/mixins/...
Introduced Integration/AsyncIntegration (renamed from Extensibility types), updated imports to integration mixins, and changed ExtensionsServiceConfig._endpoint and related docstrings/paths to /public/v1/integration/extensions.
Unit tests (resources & client)
tests/unit/resources/integration/*, tests/unit/test_mpt_client.py, removed tests/unit/resources/extensibility/test_extensibility.py
Replaced extensibility unit tests with integration equivalents, added fixtures for Integration/AsyncIntegration, updated mocked endpoints from /extensibility/.../integration/..., and adjusted parametrized client tests to reference integration.
E2E integration tests
tests/e2e/integration/extensions/conftest.py, tests/e2e/integration/extensions/test_sync_extensions.py, tests/e2e/integration/extensions/test_async_extensions.py
Added e2e fixtures and sync/async test modules for extension operations; fixtures read integration.extension.id, create/delete extensions (with teardown error handling), and many tests present (several skipped due to environment limitations).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed The PR title contains exactly one Jira issue key MPT-19892 in the required format.
Test Coverage Required ✅ Passed PR modifies 9 code files and includes 9 test file changes across tests/ folder, satisfying test coverage requirements.
Single Commit Required ✅ Passed The PR contains exactly one commit (f3f16bc MPT-19892: add E2E tests for Extension base service), meeting the requirement for a single commit and clean git history.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@albertsola albertsola force-pushed the MPT-19892/e2e-extension-base-service branch from d911034 to 0e44cd6 Compare April 6, 2026 08:54
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d911034 and 0e44cd6.

📒 Files selected for processing (6)
  • e2e_config.test.json
  • tests/e2e/extensibility/__init__.py
  • tests/e2e/extensibility/extensions/__init__.py
  • tests/e2e/extensibility/extensions/conftest.py
  • tests/e2e/extensibility/extensions/test_async_extensions.py
  • tests/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

@albertsola albertsola force-pushed the MPT-19892/e2e-extension-base-service branch from 0e44cd6 to 5c7c216 Compare April 6, 2026 10:43
@albertsola albertsola force-pushed the MPT-19892/e2e-extension-base-service branch from 5c7c216 to ac93e5e Compare April 7, 2026 09:00
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/unit/test_mpt_client.py (1)

43-44: Consider adding compatibility assertions for legacy client attribute

If 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5c7c216 and ac93e5e.

📒 Files selected for processing (23)
  • e2e_config.test.json
  • mpt_api_client/mpt_client.py
  • mpt_api_client/resources/__init__.py
  • mpt_api_client/resources/extensibility/__init__.py
  • mpt_api_client/resources/integration/__init__.py
  • mpt_api_client/resources/integration/extensions.py
  • mpt_api_client/resources/integration/integration.py
  • mpt_api_client/resources/integration/mixins/__init__.py
  • mpt_api_client/resources/integration/mixins/extension_mixin.py
  • pyproject.toml
  • tests/e2e/integration/__init__.py
  • tests/e2e/integration/extensions/__init__.py
  • tests/e2e/integration/extensions/conftest.py
  • tests/e2e/integration/extensions/test_async_extensions.py
  • tests/e2e/integration/extensions/test_sync_extensions.py
  • tests/unit/resources/extensibility/test_extensibility.py
  • tests/unit/resources/integration/__init__.py
  • tests/unit/resources/integration/conftest.py
  • tests/unit/resources/integration/mixins/__init__.py
  • tests/unit/resources/integration/mixins/test_extension_mixin.py
  • tests/unit/resources/integration/test_extensions.py
  • tests/unit/resources/integration/test_integration.py
  • tests/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

@albertsola albertsola changed the title MPT-19892: add E2E tests for Extension base service MPT-19892: add E2E tests for Extension base service - Includes renaming from extensibility -> integrations Apr 7, 2026
- 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>
@albertsola albertsola force-pushed the MPT-19892/e2e-extension-base-service branch from ac93e5e to f3f16bc Compare April 7, 2026 09:37
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@albertsola albertsola merged commit 914a22d into main Apr 7, 2026
4 checks passed
@albertsola albertsola deleted the MPT-19892/e2e-extension-base-service branch April 7, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants