12 KiB
12 KiB
Test Scripts Inventory & Cleanup Audit
Date: 2026-06-05
Author: Roo (Fast Coder)
Scope: Root (/opt/docker/dev/service_finder/) and backend/ directories
Summary
This document provides a complete inventory of all test scripts, diagnostic scripts, patch scripts, and shell scripts found in the project root and backend/ directories. Each script has been evaluated for usefulness and categorized for archival or retention.
Root Directory Scripts
| # | File | Purpose | Verdict |
|---|---|---|---|
| 1 | test_mvp.sh |
Bash-based MVP test: login, vehicle creation, org switch via curl | Archive — superseded by Python test scripts |
| 2 | test_mvp.py |
Python MVP test: same flow as above via requests |
Archive — one-time MVP validation |
| 3 | test_catalog_filter.py |
Tests catalog filtering by vehicle_class via AssetService |
Active — useful for catalog verification |
| 4 | test_catalog_only.py |
Simpler catalog filter test via AssetService |
Archive — duplicate of test_catalog_filter.py |
| 5 | test_integration.py |
Integration test: login, catalog, vehicle registration via TestClient |
Active — useful API smoke test |
| 6 | test_onboard_fix.py |
Tests org onboard endpoint with aiohttp |
Archive — one-time fix verification |
| 7 | test_onboard_fix_v2.py |
v2 of onboard test with form-data login | Archive — superseded by v2, one-time use |
| 8 | test_onboard_integration.py |
Integration test for onboard fix via TestClient |
Archive — one-time fix verification |
| 9 | sf_gitea.sh |
Gitea manager wrapper script | Active — useful utility |
| 10 | sf_run.sh |
Docker exec wrapper for sf_api |
Active — useful utility |
| 11 | patch_auth_login.py |
Patches auth login endpoint with remember_me | Archive — one-time patch script |
| 12 | patch_auth_service.py |
Patches auth service with shadow identity logic | Archive — one-time patch script |
| 13 | patch_auth_service_fix.py |
Reverts shadow identity patch | Archive — one-time patch script |
| 14 | patch_test.py |
Patches test_invitation_e2e.py with UUIDs | Archive — one-time patch script |
Backend Directory Scripts (backend/)
Test Scripts (test_*.py)
| # | File | Purpose | Verdict |
|---|---|---|---|
| 15 | test_asset_e2e.py |
E2E asset test: creates users, org, vehicles via API | Active — useful E2E test |
| 16 | test_asset_e2e_direct.py |
Direct DB + API asset test | Archive — duplicate of test_asset_e2e.py |
| 17 | test_asset_e2e_fetch.py |
Asset fetch test with existing org members | Archive — variant of E2E test |
| 18 | test_auth_e2e.py |
Auth E2E: registration, verification, login flow | Active — useful auth test |
| 19 | test_auth_e2e_setup.py |
Sets up system parameters for auth tests | Active — useful setup script |
| 20 | test_catalog_only.py |
Catalog filter test (duplicate of root version) | Archive — duplicate |
| 21 | test_check_response.py |
Checks org switch response format | Archive — one-time debug |
| 22 | test_complete_flow.py |
Comprehensive org switching + token refresh test | Active — useful flow test |
| 23 | test_debug_switch.py |
Debug org switch error | Archive — one-time debug |
| 24 | test_decode_token.py |
Decodes JWT to check scope_id | Archive — one-time debug |
| 25 | test_email.py |
Tests email sending via configured provider | Active — useful email test |
| 26 | test_final_verification.py |
Final verification of org switching flow | Archive — one-time verification |
| 27 | test_flow_simple.sh |
Bash-based org switching flow test | Archive — superseded by Python tests |
| 28 | test_i18n_implementation.py |
Tests i18n context management and middleware | Active — useful i18n test |
| 29 | test_invitation_e2e.py |
E2E test for org invitation flow | Active — useful invitation test |
| 30 | test_makes_filter.py |
Tests catalog makes filter via API | Archive — duplicate of catalog tests |
| 31 | test_minimal_verification.py |
Minimal token refresh test | Archive — one-time verification |
| 32 | test_schema_changes.py |
Checks DB schema for issue #179 columns | Active — useful schema audit |
| 33 | test_token_debug.py |
Debug PATCH endpoint response | Archive — one-time debug |
| 34 | test_token_refresh.py |
Tests token refresh on org switch | Archive — superseded by test_complete_flow.py |
| 35 | test_token_refresh_simple.py |
Simpler token refresh test | Archive — superseded |
| 36 | test_user55_api.py |
API test for User 55 endpoints | Archive — one-time user-specific test |
Diagnostic Scripts (check_*.py)
| # | File | Purpose | Verdict |
|---|---|---|---|
| 37 | check_asset_888.py |
Checks branch_id/catalog_id for TEST-888 asset | Archive — one-time debug |
| 38 | check_branch.py |
Lists first 5 branches | Archive — one-time debug |
| 39 | check_db.py |
Lists first 5 users and orgs | Archive — one-time debug |
| 40 | check_user_scope.py |
Checks User 28 scope details | Archive — one-time debug |
| 41 | check_vmd.py |
Checks Ford Focus VMD entries | Archive — one-time debug |
Setup/Utility Scripts
| # | File | Purpose | Verdict |
|---|---|---|---|
| 42 | complete_kyc_script.py |
Completes KYC for User 55 | Archive — one-time setup |
| 43 | create_business_org.py |
Creates business org for User 55 | Archive — one-time setup |
| 44 | create_business_via_api.py |
Creates business org via API for User 55 | Archive — one-time setup |
| 45 | create_integration_session.py |
Creates integration_session.json | Active — useful for test setup |
| 46 | create_vehicle_for_org.py |
Creates vehicle for Org 34 | Archive — one-time setup |
| 47 | create_vehicle_via_api.py |
Creates vehicle via external API | Archive — one-time setup |
| 48 | full_discovery_bot.py |
Seeds 200+ brands/models into DB | Archive — one-time seed |
| 49 | get_token_for_user_29.py |
Generates JWT for User 29 | Archive — one-time debug |
| 50 | manual_verification.py |
Manually verifies User 55 email | Archive — one-time fix |
| 51 | raw_data_dump.py |
Dumps branches and assets from DB | Active — useful for data inspection |
| 52 | trigger_auth_emails.py |
Triggers auth emails for debugging | Active — useful email debug |
| 53 | verify_org_structure.py |
Verifies org structure for User 55 | Archive — one-time verification |
Backend tests/ Directory (backend/tests/)
| # | File | Purpose | Verdict |
|---|---|---|---|
| 54 | e2e_smoke_test.py |
E2E smoke test for registration flow | Active — useful smoke test |
| 55 | test_01_registration.py |
Ground Zero: registration endpoint test | Active — useful registration test |
| 56 | test_04_business_onboarding.py |
Ground Zero: business onboarding test | Active — useful onboarding test |
| 57 | test_credentials.json |
Test credentials data | Active — test data |
Existing tests/ Directory (tests/)
| # | File | Purpose | Verdict |
|---|---|---|---|
| 58 | fire_drill_email.py |
Live email delivery verification via SendGrid | Active — useful email test |
| 59 | sendgrid_live_test.py |
Direct SendGrid API test | Active — useful email test |
| 60 | verify_auth_loop.py |
Auth endpoint simulation test | Active — useful auth test |
Cleanup Plan
Move to tests/active/ (Keep — Useful for ongoing testing)
test_catalog_filter.py— catalog filtering verificationtest_integration.py— API smoke testsf_gitea.sh— Gitea manager wrappersf_run.sh— Docker exec wrapperbackend/test_asset_e2e.py— E2E asset testbackend/test_auth_e2e.py— Auth E2E testbackend/test_auth_e2e_setup.py— Auth setupbackend/test_complete_flow.py— Org switching flowbackend/test_email.py— Email testbackend/test_i18n_implementation.py— i18n testbackend/test_invitation_e2e.py— Invitation E2Ebackend/test_schema_changes.py— Schema auditbackend/create_integration_session.py— Test setupbackend/raw_data_dump.py— Data inspectionbackend/trigger_auth_emails.py— Email debugbackend/tests/e2e_smoke_test.py— Smoke testbackend/tests/test_01_registration.py— Registration testbackend/tests/test_04_business_onboarding.py— Onboarding testbackend/tests/test_credentials.json— Test data
Move to tests/archive/ with .old extension (Obsolete / One-time use)
test_mvp.sh→tests/archive/test_mvp.sh.oldtest_mvp.py→tests/archive/test_mvp.py.oldtest_catalog_only.py→tests/archive/test_catalog_only.py.oldtest_onboard_fix.py→tests/archive/test_onboard_fix.py.oldtest_onboard_fix_v2.py→tests/archive/test_onboard_fix_v2.py.oldtest_onboard_integration.py→tests/archive/test_onboard_integration.py.oldpatch_auth_login.py→tests/archive/patch_auth_login.py.oldpatch_auth_service.py→tests/archive/patch_auth_service.py.oldpatch_auth_service_fix.py→tests/archive/patch_auth_service_fix.py.oldpatch_test.py→tests/archive/patch_test.py.oldbackend/test_asset_e2e_direct.py→tests/archive/test_asset_e2e_direct.py.oldbackend/test_asset_e2e_fetch.py→tests/archive/test_asset_e2e_fetch.py.oldbackend/test_catalog_only.py→tests/archive/test_catalog_only.py.oldbackend/test_check_response.py→tests/archive/test_check_response.py.oldbackend/test_debug_switch.py→tests/archive/test_debug_switch.py.oldbackend/test_decode_token.py→tests/archive/test_decode_token.py.oldbackend/test_final_verification.py→tests/archive/test_final_verification.py.oldbackend/test_flow_simple.sh→tests/archive/test_flow_simple.sh.oldbackend/test_makes_filter.py→tests/archive/test_makes_filter.py.oldbackend/test_minimal_verification.py→tests/archive/test_minimal_verification.py.oldbackend/test_token_debug.py→tests/archive/test_token_debug.py.oldbackend/test_token_refresh.py→tests/archive/test_token_refresh.py.oldbackend/test_token_refresh_simple.py→tests/archive/test_token_refresh_simple.py.oldbackend/test_user55_api.py→tests/archive/test_user55_api.py.oldbackend/check_asset_888.py→tests/archive/check_asset_888.py.oldbackend/check_branch.py→tests/archive/check_branch.py.oldbackend/check_db.py→tests/archive/check_db.py.oldbackend/check_user_scope.py→tests/archive/check_user_scope.py.oldbackend/check_vmd.py→tests/archive/check_vmd.py.oldbackend/complete_kyc_script.py→tests/archive/complete_kyc_script.py.oldbackend/create_business_org.py→tests/archive/create_business_org.py.oldbackend/create_business_via_api.py→tests/archive/create_business_via_api.py.oldbackend/create_vehicle_for_org.py→tests/archive/create_vehicle_for_org.py.oldbackend/create_vehicle_via_api.py→tests/archive/create_vehicle_via_api.py.oldbackend/full_discovery_bot.py→tests/archive/full_discovery_bot.py.oldbackend/get_token_for_user_29.py→tests/archive/get_token_for_user_29.py.oldbackend/manual_verification.py→tests/archive/manual_verification.py.oldbackend/verify_org_structure.py→tests/archive/verify_org_structure.py.old
Statistics
- Total scripts found: 60
- Active (keep in place or move to
tests/active/): 19 - Archive (move to
tests/archive/with.old): 38 - Already in
tests/(keep in place): 3