Acceptance and reference-environment test utilities for ShariX Open, including demo audit/reset and schema consistency checks.

Набор средств приёмочного тестирования и проверки эталонной среды ShariX Open, включая аудит и сброс demo-сценария и контроль согласованности схемы.

ShariX Developer 7f6bbcb955 Stage 19.7: suppress expected UI smoke HTTP error logs 1 month ago
legacy_migrations 59805c4e4c Stage 7.6.6-A canonical migration baselines 1 month ago
lib 7f6bbcb955 Stage 19.7: suppress expected UI smoke HTTP error logs 1 month ago
management 6ecd99e37c Post-Stage-9 Phase 1 runtime and demo integrity 1 month ago
migrations 59805c4e4c Stage 7.6.6-A canonical migration baselines 1 month ago
scenarios dee8369be4 Stage 15.1: contracts and module lifecycle 1 month ago
templates 3a4964162b base scenarios become working 5 months ago
tests 7f6bbcb955 Stage 19.7: suppress expected UI smoke HTTP error logs 1 month ago
.gitignore 59805c4e4c Stage 7.6.6-A canonical migration baselines 1 month ago
CODING_POLICY.md dee8369be4 Stage 15.1: contracts and module lifecycle 1 month ago
LICENSE f3b815e0e5 stage 16.1 1 month ago
README.md 174f47e3ec Stage 12.8 final live acceptance closeout 1 month ago
RELEASE_POLICY.md 247c4e4033 Stage 19.6 release policy and system release projection 1 month ago
__init__.py 351841be82 module initialization 5 months ago
apps.py 351841be82 module initialization 5 months ago
models.py 473645d76f new scenarios 5 months ago
services.py 3a4964162b base scenarios become working 5 months ago
sharix_health.py f8d5f878fd sharix health 1 month ago
sharix_management.py 962187bb07 adding coding policy 1 month ago
sharix_pages.py 10987c2cbb Stage 10.1 page registry navigation and communications 1 month ago
urls.py 3a4964162b base scenarios become working 5 months ago
views.py 3a4964162b base scenarios become working 5 months ago

README.md

sharix-open-testkit

Migrations

When testkit models are installed, their schema is owned by committed canonical migrations. Stage 7.6.6 can create the one-time baseline in the authoritative Open checkout; production install/start code never runs makemigrations.

Stage 8 reference environment

Scenario reference_demo_environment is a Stage 8 acceptance scenario. On a positive METASERVICE_ID it records a clean skip. On METASERVICE_ID=0 it runs the production read-only reference audit, checks that namespace 0 has no Platform sync journal/state, verifies the local no-money payment backend and login switch semantics, and exercises the production bootstrap inside a rollback-only transaction to detect duplicate/stable-key regressions. Testkit does not own or persist the reference fixtures.

Demo/reference reset

Testkit exposes one canonical reset entry point for the Stage 8 training namespace:

./venv/bin/python manage.py reset_demo_reference_environment --yes

The command is destructive only for rows provably owned by the canonical Stage 8 reference identities and only when METASERVICE_ID=0. It does not wipe arbitrary namespace-0 rows, schemas, migrations, source repositories, secrets or installation configuration. A normal positive-ID Platform installation fails closed before any reset work; even a misconfigured Platform exposing id 0 returns an explicit no-op because Platform does not own Open demo business data.

The database part removes mutable runtime descendants of reference users (orders and execution/payment descendants, reference appointment instances, mutable provider/resource/check/document state) and deletes file-backed onboarding projects owned by reference users. It then calls the production-owned reset_demo_reference_stage84() / Stage 8 ensure+audit. The LDAP part uses bin/sync_ldap_from_ldif.sh to restore safe profile attributes and canonical reference-user role memberships. Passwords are intentionally preserved by the existing LDAP recovery policy.

Installer flags now have real behavior and share the same service:

  • TESTKIT_DELETE_LDIF_USER_DATA_ON_INSTALL=true resets database-side demo runtime;
  • TESTKIT_RESET_LDIF_USERS_ON_INSTALL=true reconciles reference LDAP users/groups;
  • enabling both is equivalent to the complete reset before install scenarios.

A positive METASERVICE_ID fails closed if either destructive reset flag is enabled.

Stage 9 service onboarding acceptance

Scenario service_onboarding_launch is a read-only Stage 9.4 acceptance check. It skips cleanly when sharix_onboarding is not installed (including Platform assemblies) or when no project has completed launch yet. For completed launch results it verifies that the recorded first order still exists and that the materialized service set has at least one active Provider offer. Testkit never creates launch business data and remains optional.

UI smoke persona/fixture resolution

run_ui_smoke remains read-only. It never creates Orders, requirement tickets or other business objects merely to satisfy a route fixture. When a case has an object-bound fixture and its persona is not pinned through SHARIX_UI_SMOKE_PERSONAS, Testkit checks active users matching the persona groups in deterministic group/primary-key order and uses the first user for whom the fixture resolver finds a stable object. This avoids coupling strict smoke to the first member of a role group when another valid test persona owns the fixture.

An explicit SHARIX_UI_SMOKE_PERSONAS entry is authoritative: Testkit checks only that configured user and fails/skips according to the requested strict mode rather than silently substituting another account.