Skip to content

fix(restapi): combined review follow-ups (A+B+C)#141

Merged
Lenajava1 merged 4 commits into
devfrom
vcst-restapi-review-followups
Apr 17, 2026
Merged

fix(restapi): combined review follow-ups (A+B+C)#141
Lenajava1 merged 4 commits into
devfrom
vcst-restapi-review-followups

Conversation

@Lenajava1
Copy link
Copy Markdown
Collaborator

A — blockers from overall review:

  • CI: add new 'Run drop-search-index (destructive)' stage before restart-platform so test_index_drop actually runs (was orphaned by the destructive marker filter)
  • CI: register new restapi-index-drop-junit.xml in all summary collection steps
  • orders/test_orders.py: fix **overrides: dict -> **overrides: Any type-hint bug
  • orders/test_orders.py: replace silent 'unknown-user' fallback with pytest.skip when dataset has no users

B — pattern / assertion tightening:

  • orders/test_orders.py: tighten test_order_search (dict+results/totalCount) and test_order_indexed_search_enabled (dict with result boolean)
  • orders/test_orders.py + contacts/test_contact.py: remove permissive .get('id') fallback in get_not_found tests; now strictly require 404 or empty body
  • platform/test_changelog.py: tighten lastmodifieddate (dict with lastModifiedDate), changelog/search (list), and rewrite test_changelog_verify_log_after_entity_change as a meaningful filter test (ApplicationUser is always tracked; Catalog isn't)
  • platform/test_dynamic_properties.py: isinstance dict with results/totalCount
  • search/test_search.py + content/test_content.py: replace assert result is not None with structural isinstance checks matching the actual backend response shapes (list vs dict)
  • catalog_personalisation/test_personalisation.py: remove duplicate test_tag_settings_get (identical to test_tag_get)

C — coverage:

  • platform/test_roles.py: add test_role_assign_to_user — creates user + role, verifies initial login, assigns role via user update, verifies role ID on reload, revokes role, verifies removal

Results: 265 passed, 5 skipped, 2 destructive deselected. Same count as before (-1 dup, +1 new, net 0).

A — blockers from overall review:
- CI: add new 'Run drop-search-index (destructive)' stage before restart-platform so test_index_drop actually runs (was orphaned by the destructive marker filter)
- CI: register new restapi-index-drop-junit.xml in all summary collection steps
- orders/test_orders.py: fix **overrides: dict -> **overrides: Any type-hint bug
- orders/test_orders.py: replace silent 'unknown-user' fallback with pytest.skip when dataset has no users

B — pattern / assertion tightening:
- orders/test_orders.py: tighten test_order_search (dict+results/totalCount) and test_order_indexed_search_enabled (dict with result boolean)
- orders/test_orders.py + contacts/test_contact.py: remove permissive .get('id') fallback in get_not_found tests; now strictly require 404 or empty body
- platform/test_changelog.py: tighten lastmodifieddate (dict with lastModifiedDate), changelog/search (list), and rewrite test_changelog_verify_log_after_entity_change as a meaningful filter test (ApplicationUser is always tracked; Catalog isn't)
- platform/test_dynamic_properties.py: isinstance dict with results/totalCount
- search/test_search.py + content/test_content.py: replace assert result is not None with structural isinstance checks matching the actual backend response shapes (list vs dict)
- catalog_personalisation/test_personalisation.py: remove duplicate test_tag_settings_get (identical to test_tag_get)

C — coverage:
- platform/test_roles.py: add test_role_assign_to_user — creates user + role, verifies initial login, assigns role via user update, verifies role ID on reload, revokes role, verifies removal

Results: 265 passed, 5 skipped, 2 destructive deselected. Same count as before (-1 dup, +1 new, net 0).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2026

REST API Test Results

272 tests   272 ✅  24s ⏱️
  4 suites    0 💤
  4 files      0 ❌

Results for commit b6bd839.

♻️ This comment has been updated with latest results.

Lenajava1 and others added 3 commits April 17, 2026 15:28
Root causes uncovered via direct endpoint probes:
1. Personalisation PUT /api/personalization/taggeditem returned 500 because required 'label' field was missing from payload (DB column is NOT NULL).
2. PUT of a second tag assignment for the same entity returned 500 'already exists' because the create-vs-update branching needs the existing row id.
3. /api/seoinfos/batchresolve no longer accepts POST (405) on this backend version; /api/seoinfos/duplicates (GET) is the stable read.
4. /api/platform/security/externalsigninproviders genuinely absent on this platform version (404 on every variant tried); replace with /api/platform/security/currentuser which is functionally more valuable (verifies admin identity + auth round-trip).

Fixes:

catalog_personalisation/test_personalisation.py:
- add _find_tagged_item + _put_tagged_item helpers; the PUT is idempotent — looks up existing row id for the entity and includes it so the same test can run repeatedly
- test_tag_put_assign_product/category now real: PUT + search + assert label appears on the row
- test_tag_put_unassign_product now real: assign, unassign via tags=[], assert tags==[]
- mark all three as serial (they mutate shared personalisation rows for seeded entities)

core/test_core.py::test_seo_info_get:
- switch from POST /api/seoinfos/batchresolve to GET /api/seoinfos/duplicates?objectType=Catalog&objectId=...
- use seed_catalog_id fixture so test works against any seeded catalog
- drop HTTPError import (no longer needed)

platform/test_authorization.py::test_auth_external_sign_in_providers -> test_auth_current_user:
- rename and retarget to GET /api/platform/security/currentuser
- assert userName=admin and isAdministrator=true (verifies auth round-trip)

Results: 270 passed, 0 skipped, 2 destructive deselected. Up from 265 pass + 5 skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… tests

Add pytest-xdist dependency and use -n auto in the CI parallel-safe
phase so isolated factory-based tests run across multiple workers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Lenajava1 Lenajava1 merged commit 65956a5 into dev Apr 17, 2026
3 checks passed
@Lenajava1 Lenajava1 deleted the vcst-restapi-review-followups branch April 29, 2026 18:52
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