Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.81 KB

index.md

File metadata and controls

69 lines (48 loc) · 1.81 KB

Testing

Prerequisites

Ensure the pre-commit hook for styling tools is set up so CI won't fail on formatting issues. See setup instructions.

Test Site Setup

Tests can leave behind fake records that pollute your local database. Use a dedicated test site:

bench new-site --db-root-password admin --admin-password admin test_site
bench --site test_site install-app press
bench --site test_site add-to-hosts
bench --site test_site set-config allow_tests true

Start bench so background workers are available:

bench start

To reset all test data:

bench --site test_site reinstall --yes

Running Tests

Run all tests (usually only needed in CI):

bench --site test_site run-tests --app press

Run a single module:

bench --site test_site run-tests --app press \
  --module press.press.doctype.some_doctype.test_some_doctype

Run a specific test:

bench --site test_site run-tests \
  --module press.press.doctype.some_doctype.test_some_doctype \
  --test test_very_specific_thing

Editor Integration

::: tip For Neovim quickfix support, you can use a custom errorformat with makeprg hacks. :::

References