RocketMainta documentation

Testing

RocketMainta ships with four test layers. They all run against a real MySQL/MariaDB server — there are no mocks, so the schema, the SQL and the HTTP stack are exercised together.

export DB_HOST=127.0.0.1 DB_USER=rocket DB_PASSWORD=rocket_pw

1. Go suite — unit and integration

go vet ./...
go test ./...
PackageWhat it covers
internal/authbcrypt hashing, JWT issue/parse/tamper/expiry, random tokens, TOTP enrolment and verification, recovery codes, the provisioning URI
internal/paygatethe 44-gateway catalogue and its uniqueness, the driver selection for Stripe/PayPal/manual/generic, the HMAC signature verification, the simulator fallback
internal/pdfthe PDF header, the catalog and page tree, the page count, the text escaping, the zlib compression, the rectangles and the free text
internal/i18nthe fallback chain (database → default → key), the placeholder substitution, the text direction, the sorted locale list
internal/storethe idempotent migration, the seed content and its idempotency, the uniqueness of the gateway codes, the slug helper, the coverage of the 53 tables, LastID
tests/integrationthe whole application booted in-process against rocketmainta_test: the public pages, the API, the registration, the duplicate e-mail, the CSRF guard, the admin login, the 24 admin screens, the order and ticket creation, the report endpoints

The integration test creates its own database and schema in TestMain, so it is safe to run in parallel with the other packages. If no database is reachable the store test skips instead of failing.


2. HTTP smoke test

Drives a running server over HTTP and asserts on the responses.

python3 scripts/smoke_test.py                       # http://127.0.0.1:8080
python3 scripts/smoke_test.py --base http://host:8080

103 checks over these areas:

the invoice PDF

endpoints

The script exits with a non-zero status when a check fails, so it can be used in CI.


3. Browser test (Playwright)

Renders the application in a real Chromium, runs the customer journey and captures screenshots.

python3 scripts/gui_test.py
python3 scripts/gui_test.py --base http://127.0.0.1:8080 --headed

82 checks over these areas:

The screenshots are written to docs/screenshots/:

home.png  services.png  service-detail.png  category.png  book.png  blog.png  blogpost.png
faq.png  contact.png  page.png  login.png  register.png  dashboard-home.png  dashboard-order.png
dashboard-ticket.png  dashboard-profile.png  checkout.png  admin-*.png  mobile-*.png
The sandbox ships the full Chromium build but not the headless shell, so the test locates the binary itself (/root/.cache/ms-playwright/chromium-*/chrome-linux/chrome). Set CHROMIUM_PATH to override it.

4. GUI test suite (scripts/gui/)

The browser test above checks that the pages render. The GUI suite goes further: it drives every interactive control of the product in a real Chromium and asserts on the values that come back — the price that is displayed, the order that is stored, the status that is persisted — never on the mere presence of a text.

python3 scripts/gui/run.py                    # every group + the control coverage audit
python3 scripts/gui/run.py --group public     # one group only
python3 scripts/gui/run.py --group admin --no-audit
python3 scripts/gui/run.py --headed           # watch the browser
GroupCasesWhat it does
public19the public pages, the catalogue, the prices, the search, the language switch, the cookie banner, the live chat
booking13the booking form, the live total, the options, the coupon, the checkout, the gateways, the simulated payment
auth16the registration, the CAPTCHA, the login, the password recovery, the 2FA, the social buttons
account19the orders, the payments, the tickets, the notifications, the profile, the reviews, the privacy export
admin44every write operation of the panel: catalogue, orders, tickets, users, gateways, reports, settings, appearance, translations, CMS
security18the access guards, the CSRF, the escaping, the injections, the edge cases, the negative paths
coverage27the controls that the other groups never touch: the filters, the tabs, the toggles, the edit links
total157every case asserts a value, never the mere presence of a text

The report is written to docs/gui-report/report.json; every case lists the controls it touched.

The control coverage audit

scripts/gui/audit.py walks every route, inventories the interactive controls it finds (links, buttons, inputs, selects, checkboxes) and diffs them against the controls the suite really touched. A control that is on the page but never exercised is a coverage hole, not a proof that the control works. The result is written to docs/gui-report/audit.json.

The shared chrome of the layout (navigation, footer, cookie banner, chat widget, side bar) is counted once and not repeated on every route.

The last run inventories 412 controls and exercises 212 of them (51.5 %). The remaining gaps are listed in docs/gui-report/audit.json and are of two kinds:

article. The suite clicks a representative of every pattern; the audit lists every single one of them, because a link that exists in the data is a link that can be broken.

verification fields, the templates body, the GDPR switches).

The coverage number is a diagnostic, not a score: the point of the audit is to show which control nobody ever touched, so that a broken one cannot hide behind a green suite.

The rules the suite follows

session, and a cleanup that removes what it created

reached (otherwise the browser blocks the submit and the test proves nothing)

tampered request would send

"Copied" label

The sandbox ships the full Chromium build but not the headless shell, so the harness locates the binary itself (/root/.cache/ms-playwright/chromium-*/chrome-linux/chrome). Set CHROMIUM_PATH to override it.

5. The release package

The archive that is uploaded to the marketplace is built by a script and proved by another one.

./scripts/package_release.sh          # builds release/rocketmainta-<version>.zip
./scripts/verify_release.sh           # installs that archive and tests the installation

package_release.sh copies only what a buyer needs, removes the development artefacts (the generated reports, the screenshots of the listing, the real .env, the __pycache__ folders) and checks the archive: unzip -t, no loose file at the root, install.sh still executable, no .env inside.

verify_release.sh is the proof. It unpacks the archive into a temporary directory, runs the install.sh of the archive on an empty database and a different port, starts the installed instance, checks the public pages and the protected administration, and runs the smoke test and the whole GUI suite against the installed instance.

"The installer runs" is not a proof. The proof is that the installed instance answers and behaves.

6. Manual checklist before a release

unexpected gap