The CI check was incorrectly nested inside the dev_server condition,
preventing test endpoints from being accessible during CI runs using
bench execute. Now CI is checked independently.
- Moved whitelist_for_tests decorator from ui_test_helpers to frappe.tests.utils
- Enhanced decorator to accept kwargs for passing to frappe.whitelist()
- Applied decorator consistently to test endpoints in:
- test_api.py
- test_api_v2.py
- test_caching.py
- test_search.py
- Updated all imports to use direct import from frappe.tests.utils
* feat: global `frappe.in_test` flag
* feat: helper utility to toggle `frappe.in_test`
* fix: use `toggle_test_mode` util
* fix: use `frappe.in_test`
* chore: add comment explaining global `in_test`
* chore: ignore commit replacing flag usage
* test: temporarily disable `frappe.in_test`
this worked earlier because flag was set in werkzeug.local which was separate for API test client
* test: add comment explaining change
* chore: remove verbose output from test runner
This is same output that's shared by test runner in different format?
This makes it annoying to scroll through when just running single test
locally.
* fix: Remove clutter from test output
Test records don't change after first run.
Tests are executed many many times locally
* test: retry flaky postgres backup tests
due to circular imports issues and me going out of my way to make it work 'cleanly', the previous backwards compatibility for FrappeTestCase unfortunately did not work on the manual cli test runner 'run-tests'
While not generally not affecting CI (which is precedented by the framwork's best practices to use 'run-parallel-test'), this broke some manual developer workflows
The restauration of FrappeTestCase in these scenario now unfortunately involves a plain copy of almost an entire implementation into the dumpster.
On the one hand, this doesn not accurately reflect the rather minuscule differences between IntegrationTestCase and FrappeTestCase, but on the other hand, it shields and freezes the old api should IntegrationTestCase evolve futher
- Add reset option to clear existing test objects
- Clearly distinguishe between index doctype and record doctype
- Optimize record retrieval from test log, fix record pool layout
- Implement removal of doctype records from test log
- Enhance logging with record count information
* chore: improve log record of testing command invokation
* chore(testing): narrower specificacion of the persistence log
* fix(testing): append raw record source data to globalTestRecords
- Rename functions for clarity
- Enhance logging with more detailed messages
- Refactor record creation process for better organization
- Improve handling of record synchronization and caching
* refactor: toml test records for readability
* fix: maintain backwards compatibility
* refactor: transform in-tree records
* chore: don't use deprecated functions (treewide)
* chore: revert migration of tests which depend on old test records list
* feat: add cls.globalTestRecords on IntegrationTestCase
* refactor: prefer staticmethod decorator
* refactor: add cm register utility and keep cms in one file
* refactor: enter safe_exec enabled context (treewide)
* refactor: move trace fields to the other test context managers
* chore: marke all test_runner functions for deprecation
* chore: mark some tests.utils functions for deprecation (moved)
* chore: mark traced_field_conext for deprecation (moved)
* chore: placate semgrep in dumpster
* fix: show deprecation warnings per module in tests (incl. from dumpster)
* chore: remove use of deprecated functions from tests