Skip to content

Add example application smoke tests#1294

Draft
lovasoa wants to merge 3 commits into
mainfrom
example-app-smoke-tests
Draft

Add example application smoke tests#1294
lovasoa wants to merge 3 commits into
mainfrom
example-app-smoke-tests

Conversation

@lovasoa
Copy link
Copy Markdown
Collaborator

@lovasoa lovasoa commented May 31, 2026

Summary

  • Adds a smoke test that initializes example applications, applies migrations, renders each supported example entrypoint, and fails on SQLPage error pages.
  • Adds a coverage assertion so every directory under examples/ is either included in the smoke list or explicitly skipped with a reason.
  • Quotes the groups table in the MySQL JSON example so it works on MySQL 8 as well as MariaDB.

Validation

  • cargo fmt --all
  • cargo test --test mod examples:: -- --nocapture
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings

The smoke test covered SQLite, MySQL, and PostgreSQL examples against the local database containers. Explicitly skipped examples require PostGIS, SpatiaLite, SQL Server, or Keycloak/OIDC services.

Copy link
Copy Markdown
Collaborator Author

lovasoa commented Jun 1, 2026

Updated the example smoke-test PR for the latest feedback.

Changes pushed in 8a5b47cd:

  • tests/examples/mod.rs now discovers example applications by iterating over subdirectories in examples/.
  • The hardcoded example list and central skip list were removed.
  • Added sqlpage_test.json only to examples that need non-default test metadata: alternate web_root / config_dir, MySQL/PostgreSQL backend, site_prefix, or an explicit skip reason.

Validation run locally:

  • cargo fmt --all
  • cargo test --test mod examples:: -- --nocapture
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings

Copy link
Copy Markdown
Collaborator Author

lovasoa commented Jun 1, 2026

Updated PR 1294 for the CI database feedback.

Commit 7eb01e58 keeps the existing CI matrix unchanged and makes the example smoke test honor DATABASE_URL when it points to PostgreSQL or MySQL. That means the existing PostgreSQL matrix run exercises the PostgreSQL examples, and the existing MySQL matrix run exercises the MySQL examples. Local runs without those env vars still use the optional localhost probing behavior.

Validation run locally:

  • cargo fmt --all
  • DATABASE_URL='postgres://root:Password123!@127.0.0.1/sqlpage' cargo test --test mod examples:: -- --nocapture
  • DATABASE_URL='mysql://root:Password123!@127.0.0.1/sqlpage' cargo test --test mod examples:: -- --nocapture
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings

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.

1 participant