v0.2.0-dev — Complete Testing Plan + Build Pipeline Verification #11

Closed
opened 2026-03-23 13:48:31 +00:00 by mik-tf · 2 comments
Member

Complete Testing Plan for Marketplace

Before calling anything production-ready, we need a solid testing foundation. Following the freezone pattern (znzfreezone_code/home#15).

The platform currently has unit tests and manual make targets — no automated E2E, no smoke automation, no browser tests.


Step 1: Build Pipeline Verification

Problem: Container builds hit multiple issues during v0.1.0-dev (Podman image names, missing directories, Rust version, Dioxus output paths, binary names). All fixed but need a clean end-to-end verification.

Fix: Fresh clone → make dist TAG=0.2.0-dev → all 3 images build without errors.

  • Backend image builds from clean clone
  • Frontend image builds (Dioxus WASM + nginx)
  • Admin image builds (Dioxus WASM + Axum proxy)
  • All 3 push to forge registry
  • make forge-release TAG=0.2.0-dev creates Forgejo release

Step 2: Smoke Tests (curl-based, all endpoints)

Script: tests/smoke.sh — runs against any base URL (local or live).

Tests:
  Backend /health              → 200
  Backend /                    → 200, HTML renders
  RPC /api/v1/marketplace/main/rpc  → responds to JSON-RPC
  RPC user.list                → responds
  RPC listing.list             → responds
  RPC system method count      → 80+ methods
  Frontend /                   → 200, contains WASM loader
  Admin /health                → 200
  Admin /login                 → 200, contains Dioxus WASM
  Marketing /                  → 200 (if deployed)

Runs: locally after containers start, and against live endpoints.


Step 3: API Integration Tests (demo/fixtures mode)

Script: tests/api_integration.sh — exercises the full RPC API.

Tests:
  Register user (email + password) → get token
  Login → authenticated session
  List products → non-empty result
  Get product by SID → returns product
  Search products → returns results
  Get categories → returns category list
  Add to cart → success
  Get cart → contains item
  Create order from cart → returns order SID
  Get order → returns order details
  Get wallet balance → returns number
  Credit wallet → balance increases
  Debit wallet → balance decreases
  Get transactions → returns history
  List nodes → returns node list
  Create node → returns SID
  Update node status → success
  List conversations → returns threads
  Create thread → returns conversation SID
  Send message → returns message SID
  List SSH keys → returns keys
  Add SSH key → returns SID
  List services → returns professional services
  Add service → success
  Get earnings → returns records
  List apps → returns app list
  List deployments → returns deployment list
  Create audit event → success
  List audit events → returns events

Runs: against backend in fixtures mode (no external services needed).


Step 4: Playwright E2E Browser Tests

Config: tests/playwright/playwright.config.ts

4a. Marketplace Browse (marketplace.spec.ts)

  Homepage loads, hero section renders
  Marketplace page loads with categories
  Category filter works (compute, nodes, apps, services)
  Product search returns results
  Product detail page renders with specs
  Featured products section shows items

4b. Cart + Checkout (cart.spec.ts)

  Add product to cart → cart badge updates
  View cart → items listed with prices
  Update quantity → total recalculates
  Remove item → cart updates
  Checkout → order confirmation
  Order appears in order history

4c. User Registration + Login (auth.spec.ts)

  Register page renders form
  Register with email/password → success
  Login with credentials → dashboard redirect
  Auth status API returns user info
  Logout → redirected to home
  Login with wrong password → error message

4d. Dashboard (dashboard.spec.ts)

  Dashboard loads with stat cards
  Activity feed renders
  Quick action links navigate correctly
  Profile page renders with user info
  Settings page renders with preferences
  Order history page loads

4e. Wallet (wallet.spec.ts)

  Wallet page shows balance
  Transaction history loads
  Top-up form works
  Transfer form works
  Auto-topup configuration saves

4f. Node Management (nodes.spec.ts)

  Node list renders with table
  Add node form works
  Node detail modal shows specs
  Node group CRUD works
  Staking section renders
  Earnings table loads

4g. Service Provider (services.spec.ts)

  Service list renders
  Add service form works
  Service request list loads
  Booking management works
  SLA CRUD works
  Availability toggle works

4h. Messaging (messaging.spec.ts)

  Thread list loads
  Create new thread → appears in list
  Open thread → messages render
  Send message → appears in thread
  Unread count updates

4i. Node/Slice Rental (rental.spec.ts)

  Node rental page renders with options
  Select rental period → price calculates
  Confirm rental → success
  Slice rental page renders
  Select slice format → price calculates
  Deploy with config → success

4j. Admin Dashboard (admin.spec.ts)

  /login renders Dioxus WASM
  Login with admin credentials → dashboard
  All 10 tabs load (overview, users, products, orders, nodes, services, apps, messaging, audit, settings)
  Overview: stat cards show numbers
  Users: table loads with data
  Orders: status filter works
  Nodes: health indicators render
  Audit: pagination works
  Theme toggle works (light/dark)
  Logout → redirected to login

4k. Marketing Website (website.spec.ts)

  Homepage loads
  About page renders
  Pricing page shows cards
  Docs page renders categories
  Navigation links work
  Mobile responsive (viewport test)

4l. SEO Pages — SSR (seo.spec.ts)

  Homepage has <title> and <meta description>
  Product detail has OpenGraph meta tags
  Marketplace browse is crawlable HTML (not empty WASM shell)
  Docs pages render full HTML
  Privacy/terms pages render

Step 5: Unit Test Expansion (cargo test)

Add to existing tests in backend:

  Provider trait: DemoPaymentProvider succeeds
  Provider trait: DemoEmailProvider logs
  Provider trait: ResendProvider constructs correctly
  Branding config: loads from TOML file
  Branding config: defaults work when file missing
  Branding context injection: all variables present
  Schema types: all 23 root objects serialize/deserialize
  Schema enums: all 37 enums round-trip through serde
  RPC handlers: SSHKey CRUD cycle
  RPC handlers: User auth (register + login)
  RPC handlers: Product search returns results
  MCP: tool count = 92 (23 types x 4 operations)
  MCP: tool definitions have correct inputSchema
  Metrics: counters increment correctly
  Metrics: render produces Prometheus format

Step 6: White-Label Verification Tests

  Backend reads BRANDING_CONFIG env var
  Branding values injected into Tera SSR pages
  SEO title uses branding.seo.title_suffix
  Support email uses branding.branding.support_email
  Pricing uses branding.pricing.base_currency
  Feature flags control marketplace categories
  New instance deploys with only branding.toml change

Step 7: CI Integration

Update .forgejo/workflows/build.yaml in each repo:

  Backend:  cargo check → cargo test → smoke (if running)
  Frontend: cargo check --target wasm32-unknown-unknown
  Admin:    cargo check → cargo check --target wasm32-unknown-unknown
  Deploy:   make dist → smoke tests

File Structure

projectmycelium_marketplace_deploy/
  tests/
    smoke.sh                          # curl-based endpoint checks
    api_integration.sh                # RPC API tests (fixtures mode)
    playwright/
      package.json
      playwright.config.ts
      tests/
        marketplace.spec.ts           # Browse + search + filter
        cart.spec.ts                  # Cart + checkout
        auth.spec.ts                  # Register + login + logout
        dashboard.spec.ts             # Dashboard + profile + settings
        wallet.spec.ts                # Wallet operations
        nodes.spec.ts                 # Node management
        services.spec.ts              # Service provider
        messaging.spec.ts             # Messaging
        rental.spec.ts                # Node + slice rental
        admin.spec.ts                 # Admin dashboard (10 tabs)
        website.spec.ts               # Marketing site
        seo.spec.ts                   # SSR pages + meta tags

Coverage Summary

Area Test Type Count
Build pipeline Verification 5 checks
All endpoints Smoke (curl) 10 checks
RPC API Integration (curl) 28 CRUD tests
Marketplace browse E2E (Playwright) 6 tests
Cart + checkout E2E (Playwright) 6 tests
Auth flow E2E (Playwright) 6 tests
Dashboard E2E (Playwright) 6 tests
Wallet E2E (Playwright) 5 tests
Node management E2E (Playwright) 6 tests
Service provider E2E (Playwright) 6 tests
Messaging E2E (Playwright) 5 tests
Rental flows E2E (Playwright) 6 tests
Admin dashboard E2E (Playwright) 11 tests
Marketing website E2E (Playwright) 6 tests
SEO/SSR E2E (Playwright) 5 tests
Backend logic Unit (cargo test) 15 new tests
White-label Verification 7 checks
CI pipeline Forgejo Actions 4 repos
Total ~130+ tests

Not Covered (requires real providers or infrastructure)

  • Real payment processing (no payment provider yet)
  • Real email delivery (Resend not configured)
  • Real KYC verification (no KYC provider yet)
  • Multi-node K3s failover
  • GlusterFS replication
  • Load testing / performance benchmarks
  • Second marketplace instance (white-label verification at scale)

These are manual/staging tests, not automatable without provider sandboxes.


Implementation Order

Step What Effort Depends on
1 Build pipeline verification Small Issue #10 (container builds)
2 Smoke test script Small Deployed endpoints
3 API integration tests Medium Backend running in fixtures mode
4 Playwright setup + 12 test suites Large All services running
5 Unit test expansion Medium None
6 White-label verification Small Branding config working
7 CI integration Small Tests passing locally

All tests must pass before v1.0.0 release.

Reference: znzfreezone_code/home#15

# Complete Testing Plan for Marketplace Before calling anything production-ready, we need a solid testing foundation. Following the freezone pattern (znzfreezone_code/home#15). The platform currently has unit tests and manual make targets — no automated E2E, no smoke automation, no browser tests. --- ## Step 1: Build Pipeline Verification **Problem:** Container builds hit multiple issues during v0.1.0-dev (Podman image names, missing directories, Rust version, Dioxus output paths, binary names). All fixed but need a clean end-to-end verification. **Fix:** Fresh clone → `make dist TAG=0.2.0-dev` → all 3 images build without errors. - [ ] Backend image builds from clean clone - [ ] Frontend image builds (Dioxus WASM + nginx) - [ ] Admin image builds (Dioxus WASM + Axum proxy) - [ ] All 3 push to forge registry - [ ] `make forge-release TAG=0.2.0-dev` creates Forgejo release --- ## Step 2: Smoke Tests (curl-based, all endpoints) Script: `tests/smoke.sh` — runs against any base URL (local or live). ``` Tests: Backend /health → 200 Backend / → 200, HTML renders RPC /api/v1/marketplace/main/rpc → responds to JSON-RPC RPC user.list → responds RPC listing.list → responds RPC system method count → 80+ methods Frontend / → 200, contains WASM loader Admin /health → 200 Admin /login → 200, contains Dioxus WASM Marketing / → 200 (if deployed) ``` **Runs:** locally after containers start, and against live endpoints. --- ## Step 3: API Integration Tests (demo/fixtures mode) Script: `tests/api_integration.sh` — exercises the full RPC API. ``` Tests: Register user (email + password) → get token Login → authenticated session List products → non-empty result Get product by SID → returns product Search products → returns results Get categories → returns category list Add to cart → success Get cart → contains item Create order from cart → returns order SID Get order → returns order details Get wallet balance → returns number Credit wallet → balance increases Debit wallet → balance decreases Get transactions → returns history List nodes → returns node list Create node → returns SID Update node status → success List conversations → returns threads Create thread → returns conversation SID Send message → returns message SID List SSH keys → returns keys Add SSH key → returns SID List services → returns professional services Add service → success Get earnings → returns records List apps → returns app list List deployments → returns deployment list Create audit event → success List audit events → returns events ``` **Runs:** against backend in fixtures mode (no external services needed). --- ## Step 4: Playwright E2E Browser Tests Config: `tests/playwright/playwright.config.ts` ### 4a. Marketplace Browse (`marketplace.spec.ts`) ``` Homepage loads, hero section renders Marketplace page loads with categories Category filter works (compute, nodes, apps, services) Product search returns results Product detail page renders with specs Featured products section shows items ``` ### 4b. Cart + Checkout (`cart.spec.ts`) ``` Add product to cart → cart badge updates View cart → items listed with prices Update quantity → total recalculates Remove item → cart updates Checkout → order confirmation Order appears in order history ``` ### 4c. User Registration + Login (`auth.spec.ts`) ``` Register page renders form Register with email/password → success Login with credentials → dashboard redirect Auth status API returns user info Logout → redirected to home Login with wrong password → error message ``` ### 4d. Dashboard (`dashboard.spec.ts`) ``` Dashboard loads with stat cards Activity feed renders Quick action links navigate correctly Profile page renders with user info Settings page renders with preferences Order history page loads ``` ### 4e. Wallet (`wallet.spec.ts`) ``` Wallet page shows balance Transaction history loads Top-up form works Transfer form works Auto-topup configuration saves ``` ### 4f. Node Management (`nodes.spec.ts`) ``` Node list renders with table Add node form works Node detail modal shows specs Node group CRUD works Staking section renders Earnings table loads ``` ### 4g. Service Provider (`services.spec.ts`) ``` Service list renders Add service form works Service request list loads Booking management works SLA CRUD works Availability toggle works ``` ### 4h. Messaging (`messaging.spec.ts`) ``` Thread list loads Create new thread → appears in list Open thread → messages render Send message → appears in thread Unread count updates ``` ### 4i. Node/Slice Rental (`rental.spec.ts`) ``` Node rental page renders with options Select rental period → price calculates Confirm rental → success Slice rental page renders Select slice format → price calculates Deploy with config → success ``` ### 4j. Admin Dashboard (`admin.spec.ts`) ``` /login renders Dioxus WASM Login with admin credentials → dashboard All 10 tabs load (overview, users, products, orders, nodes, services, apps, messaging, audit, settings) Overview: stat cards show numbers Users: table loads with data Orders: status filter works Nodes: health indicators render Audit: pagination works Theme toggle works (light/dark) Logout → redirected to login ``` ### 4k. Marketing Website (`website.spec.ts`) ``` Homepage loads About page renders Pricing page shows cards Docs page renders categories Navigation links work Mobile responsive (viewport test) ``` ### 4l. SEO Pages — SSR (`seo.spec.ts`) ``` Homepage has <title> and <meta description> Product detail has OpenGraph meta tags Marketplace browse is crawlable HTML (not empty WASM shell) Docs pages render full HTML Privacy/terms pages render ``` --- ## Step 5: Unit Test Expansion (cargo test) Add to existing tests in backend: ``` Provider trait: DemoPaymentProvider succeeds Provider trait: DemoEmailProvider logs Provider trait: ResendProvider constructs correctly Branding config: loads from TOML file Branding config: defaults work when file missing Branding context injection: all variables present Schema types: all 23 root objects serialize/deserialize Schema enums: all 37 enums round-trip through serde RPC handlers: SSHKey CRUD cycle RPC handlers: User auth (register + login) RPC handlers: Product search returns results MCP: tool count = 92 (23 types x 4 operations) MCP: tool definitions have correct inputSchema Metrics: counters increment correctly Metrics: render produces Prometheus format ``` --- ## Step 6: White-Label Verification Tests ``` Backend reads BRANDING_CONFIG env var Branding values injected into Tera SSR pages SEO title uses branding.seo.title_suffix Support email uses branding.branding.support_email Pricing uses branding.pricing.base_currency Feature flags control marketplace categories New instance deploys with only branding.toml change ``` --- ## Step 7: CI Integration Update `.forgejo/workflows/build.yaml` in each repo: ``` Backend: cargo check → cargo test → smoke (if running) Frontend: cargo check --target wasm32-unknown-unknown Admin: cargo check → cargo check --target wasm32-unknown-unknown Deploy: make dist → smoke tests ``` --- ## File Structure ``` projectmycelium_marketplace_deploy/ tests/ smoke.sh # curl-based endpoint checks api_integration.sh # RPC API tests (fixtures mode) playwright/ package.json playwright.config.ts tests/ marketplace.spec.ts # Browse + search + filter cart.spec.ts # Cart + checkout auth.spec.ts # Register + login + logout dashboard.spec.ts # Dashboard + profile + settings wallet.spec.ts # Wallet operations nodes.spec.ts # Node management services.spec.ts # Service provider messaging.spec.ts # Messaging rental.spec.ts # Node + slice rental admin.spec.ts # Admin dashboard (10 tabs) website.spec.ts # Marketing site seo.spec.ts # SSR pages + meta tags ``` --- ## Coverage Summary | Area | Test Type | Count | |------|-----------|-------| | Build pipeline | Verification | 5 checks | | All endpoints | Smoke (curl) | 10 checks | | RPC API | Integration (curl) | 28 CRUD tests | | Marketplace browse | E2E (Playwright) | 6 tests | | Cart + checkout | E2E (Playwright) | 6 tests | | Auth flow | E2E (Playwright) | 6 tests | | Dashboard | E2E (Playwright) | 6 tests | | Wallet | E2E (Playwright) | 5 tests | | Node management | E2E (Playwright) | 6 tests | | Service provider | E2E (Playwright) | 6 tests | | Messaging | E2E (Playwright) | 5 tests | | Rental flows | E2E (Playwright) | 6 tests | | Admin dashboard | E2E (Playwright) | 11 tests | | Marketing website | E2E (Playwright) | 6 tests | | SEO/SSR | E2E (Playwright) | 5 tests | | Backend logic | Unit (cargo test) | 15 new tests | | White-label | Verification | 7 checks | | CI pipeline | Forgejo Actions | 4 repos | | **Total** | | **~130+ tests** | ## Not Covered (requires real providers or infrastructure) - Real payment processing (no payment provider yet) - Real email delivery (Resend not configured) - Real KYC verification (no KYC provider yet) - Multi-node K3s failover - GlusterFS replication - Load testing / performance benchmarks - Second marketplace instance (white-label verification at scale) These are manual/staging tests, not automatable without provider sandboxes. --- ## Implementation Order | Step | What | Effort | Depends on | |------|------|--------|------------| | 1 | Build pipeline verification | Small | Issue #10 (container builds) | | 2 | Smoke test script | Small | Deployed endpoints | | 3 | API integration tests | Medium | Backend running in fixtures mode | | 4 | Playwright setup + 12 test suites | Large | All services running | | 5 | Unit test expansion | Medium | None | | 6 | White-label verification | Small | Branding config working | | 7 | CI integration | Small | Tests passing locally | All tests must pass before v1.0.0 release. Reference: znzfreezone_code/home#15
Author
Member

Progress update (2026-03-24)

Build pipeline verified:

  • Backend image builds from clean clone (Containerfile.backend now includes user_data/)
  • Frontend image builds (Dioxus WASM + nginx)
  • All push to forge registry
  • v0.3.0-dev release created

Automated SPA smoke test developed (browser-based):

  • 25 page navigation tests (all PASS)
  • 12 API endpoint tests (all JSON, correct status codes)
  • Auth flow test (login → session restore → protected pages)
  • Product data verification (categories, counts, spec badges)

Test harness runs in hero_browser MCP — could be formalized into a reusable script.

Remaining for this issue:

  • Formalize smoke tests into tests/smoke.sh
  • Add Playwright E2E tests for SPA (currently only SSR)
  • CI pipeline automation
  • Admin image build verification

Signed-off-by: mik-tf

### Progress update (2026-03-24) **Build pipeline verified:** - ✅ Backend image builds from clean clone (Containerfile.backend now includes user_data/) - ✅ Frontend image builds (Dioxus WASM + nginx) - ✅ All push to forge registry - ✅ v0.3.0-dev release created **Automated SPA smoke test developed (browser-based):** - 25 page navigation tests (all PASS) - 12 API endpoint tests (all JSON, correct status codes) - Auth flow test (login → session restore → protected pages) - Product data verification (categories, counts, spec badges) Test harness runs in hero_browser MCP — could be formalized into a reusable script. **Remaining for this issue:** - [ ] Formalize smoke tests into `tests/smoke.sh` - [ ] Add Playwright E2E tests for SPA (currently only SSR) - [ ] CI pipeline automation - [ ] Admin image build verification Signed-off-by: mik-tf
Author
Member

Closing — testing plan implemented (2026-03-24)

Automated SPA smoke test: tests/smoke.sh

  • 19 checks, all PASS
  • Public API endpoints (health, products, categories, currencies)
  • Category search (compute, gateway, application, service, hardware)
  • JWT auth flow (login, auth/status, wallet, transactions, messages, dashboard, orders)
  • Data completeness check (36 products, 6 categories)

Build pipeline verified:

  • Backend image builds with fixture data (Containerfile includes user_data/)
  • Frontend image builds (Dioxus WASM + nginx)
  • Both push to forge registry
  • v0.3.0-dev release created
  • Correct image naming (marketplace vs marketplace_backend tag)

Usage:

./tests/smoke.sh https://dev-app.projectmycelium.org
# Results: 19/19 passed, 0 failed

Remaining (future issues):

  • Playwright E2E tests for SPA browser interactions
  • CI pipeline automation (Forgejo Actions)
  • Admin image build verification

Signed-off-by: mik-tf

### Closing — testing plan implemented (2026-03-24) **Automated SPA smoke test: `tests/smoke.sh`** - 19 checks, all PASS - Public API endpoints (health, products, categories, currencies) - Category search (compute, gateway, application, service, hardware) - JWT auth flow (login, auth/status, wallet, transactions, messages, dashboard, orders) - Data completeness check (36 products, 6 categories) **Build pipeline verified:** - Backend image builds with fixture data (Containerfile includes user_data/) - Frontend image builds (Dioxus WASM + nginx) - Both push to forge registry - v0.3.0-dev release created - Correct image naming (marketplace vs marketplace_backend tag) **Usage:** ```bash ./tests/smoke.sh https://dev-app.projectmycelium.org # Results: 19/19 passed, 0 failed ``` **Remaining (future issues):** - Playwright E2E tests for SPA browser interactions - CI pipeline automation (Forgejo Actions) - Admin image build verification Signed-off-by: mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coopcloud_code/home#11
No description provided.