* chore: remove _decorate_all_methods_and_functions_with_type_checker
No one understands this runtime magic anymore.
* build: Bump coverage.py to latest
* test: Skip github in coverage reporting
* test: Print traceback from all threads when test is stuck
* ci: Enable coverage in server side tests
* ci: Always enable coverage
It's cheap in recent python versions, our reasons for selectively
disabling aren't valid anymore.
* ci: Disable stderr capturing
* ci: Use default buffer behaviour in unittest runner
* ci(coverage): Set concurrency to multiprocessing
We do use multiprocessing, perhaps the patches aren't concurrectly
handled?
* ci(coverage): Try parallel run
* fix: Apply subprocess patch
* ci: Don't start web server with coverage
Causes deadlock for some reason. We don't actually report it either.
* ci: only submit UI coverage if ran
* test: remove aggresive stuck test checking
* ci: disable UI coverage
(for now)
* 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
Currently one test runner takes significantly longer than another. This
is entirely due to test_commands.py which needs to create new site and
do backup/restore tests etc. All of which are far far slower than other
tests.
* 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
* feat: set doctype on test classes
* refactor: Transform `make_test_records` into a generator
* feat: lazy create doctype records on first use
* perf: improve file walker
* fix: submission queue test
* refactor: improve logging a bit
* fix: global records install for app (semifix)
* refactor: constitute unit test case
* fix: docs and type hints
* refactor: mark presumed integration test cases explicitly
At time of writing, we now have at least two base test classes:
- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase
They load in their perspective priority queue during execution.
Probably more to come for more efficient queing and scheduling.
In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.
* feat: Move test-related functions from test_runner.py to tests/utils.py
* refactor: add bare UnitTestCase to all doctype tests
This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
* feat: Improve logging in test runner
* feat: Categorize tests as unit or integration
* feat: Add support for selecting test categories
* feat: Split unit and integration tests execution
* test: better output on cli runner
* feat: Create TestRunner class
* feat: Implement run method in TestRunner class
* refactor: Refactor test discovery and execution in TestRunner class
* feat: Integrate _run_doctype_tests functionality into TestRunner class
* feat: Integrate _run_unittest functionality into TestRunner class
* refactor: Handle distinction between loading specific test case and entire module
* feat: Add handling of test dependencies in _add_module_tests method
* refactor: Merge _add_tests into discover_tests
* feat: Improve test results printing with click
* refactor: wrap in proper error handling
* fix: some signatures
* feat: Add debug logs to frappe/test_runner.py
* refactor: Move before_tests hooks after test discovery
* refactor: Use TestConfig instead of frappe.flags.skip_before_tests
* refactor: Add skip_test_records to TestConfig and update calling sites
* feat: Defer test record creation until after before_tests hooks
* feat: Add app parameter to _run_doctype_tests and _run_module_tests
* feat: Add --test-category option to run_tests command
* refactor: Add explanatory comments for skipping before_tests hooks and test record creation callbacks for unit tests
* feat: Add test category option to run_tests command
* feat: Unify explanatory comments in _prepare_integration_tests
* fix: wrap implicit db access in try-except block
* fix: mark current site
* fix: case counting
* fix: use monotonic time for timing code
`time.time()` depends on system clock which can drift away and get corrected
over time. If you're unlucky it will get corrected in your timing code
and give absurd results.
* test: dont check for status
can refresh and give wrong output
[skip ci]
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
- Decoupled coverage code from testing to setup code coverage before any import happen to get accurate coverage (before it used to skip import statements for some files)