Commit graph

47590 commits

Author SHA1 Message Date
David Arnold
fd65584c40
Test Runner 3 b (cleanup) (#27999)
* refactor: Move TestConfig.categories to TestRunner.categories

* fix: app addTest

* fix: run with app arg

* fix: refactor simplify

* fix: run_before_test_hooks signature

* fix: python test module discovery

* fix: app test execution in series
2024-10-06 16:55:41 +00:00
David Arnold
c2c9d9062a
Testing Improvements 3 (#27995)
* 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)
2024-10-06 15:04:47 +00:00
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* 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
2024-10-06 09:43:36 +00:00
Priyansh Agrawal
cfb04b93e1
refactor: Replace hard-coded pg default port with PostgresDatabase.default_port (#27989) 2024-10-05 17:59:26 +00:00
Priyansh Agrawal
7d4b970a3b
chore: fix typo in PULL_REQUEST_TEMPLATE.md (#27990) 2024-10-05 17:58:38 +00:00
David Arnold
e39ecfa274
refactor: Test runner 2 (#27987)
* 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
2024-10-05 16:37:19 +00:00
David Arnold
a26afa14a7
refactor: Improve Test runner 2c (#27986)
* refactor: use pathlib for file operations

* feat: Add caching to get_dependencies and get_modules functions
2024-10-04 21:56:46 +02:00
David Arnold
6740fb3de1
refactor: Test Runner improvements 2b (#27985)
* refactor: simplify print_mandatory_fields function

* refactor: Encapsulate test record log functionality into a class

* refactor: Simplify and consolidate make_test_records_for_doctype function
2024-10-04 18:56:41 +00:00
David Arnold
1e2a74bcd9
refactor: Improve Test Runner 2a (#27984)
* refactor: Improve readability and maintainability of main function

* refactor: Simplify and optimize the run_all_tests function

* refactor: simplify run_tests_for_doctype function

* refactor: hint private methods

* refactor: simplify _run_unittest function

* refactor: simplify _add_test function

* fix: Rename `iterate_suite` to `_iterate_suite`
2024-10-04 20:27:46 +02:00
David Arnold
3e565ceab2
Merge pull request #27980 from blaggacao/test/runner-imp-1
Test Runner improvements 1
2024-10-04 20:05:40 +02:00
David (aider)
b168e38398
feat: Improve test runner with better error handling, configuration, and extensibility 2024-10-04 19:51:27 +02:00
David (aider)
c7b155d9a4
fix: Replace typing.List with list and use f-strings for formatting 2024-10-04 19:40:50 +02:00
David (aider)
94fc7135b4
feat: Add type hints, use f-strings, implement context managers, and optimize imports in test_runner.py 2024-10-04 19:40:49 +02:00
David Arnold
010dab4db7
Merge pull request #27957 from blaggacao/ci/add-trick
ci: use dynamic total job
2024-10-04 15:36:28 +02:00
David
b77f112fb2
ci: measure bench install times and control verbosity 2024-10-04 15:22:53 +02:00
David
f0ba65eb9b
ci: improve reporting 2024-10-04 15:22:49 +02:00
David
d03900c0e8
ci: add description to ci helper script 2024-10-04 15:22:45 +02:00
David
9288ad2a9c
ci: add description to roullette script 2024-10-04 15:22:36 +02:00
David Arnold
9c83075178
Merge pull request #27962 from mudux/patch-1
refactor: Explicit feedback to timestamp mismatch error
2024-10-04 11:59:31 +02:00
Mohamud Amin Ali
e6223b04fc
refactor: Explicit feedback to timestamp mismatch errror
Not necessarily a needed improvement but it adds explicitness to the feedback.

fix: text order

fix: type
2024-10-04 11:46:39 +02:00
David Arnold
c441be55e6
Merge pull request #27955 from blaggacao/feat/add-read-only-document-context
feat: add read only document mode
2024-10-04 00:12:08 +02:00
David Arnold
1379ad5af9
Merge pull request #27978 from blaggacao/fix/owener-modifier-df
fix: return correct types for owner and modified_by
2024-10-03 23:46:59 +02:00
David
d05f70f9ba
fix: return correct types for owner and modified_by 2024-10-03 23:25:11 +02:00
Jitendra Mishra
ca93818c76
chore: Avoid to re-check instance of filters (#27959) 2024-10-02 16:10:04 +05:30
David Arnold
c4b2c39c58
Merge pull request #27935 from cogk/fix-bench-execute-evaluate-args-for-each-site
fix: Evaluate `bench execute` args for each site
2024-10-02 12:30:32 +02:00
David
1c4a0fe54f
feat: add read only document mode 2024-10-02 12:02:52 +02:00
David Arnold
b7c8d7368c
Merge pull request #27936 from blaggacao/fix/build-workspace-wehbook-log
fix: build workspace, add webhook log
2024-10-02 00:14:00 +02:00
David Arnold
2423c0ff8d
Merge pull request #27954 from blaggacao/fix/add-url
fix: add url to local for custom method to use
2024-10-01 16:35:19 +02:00
David
3a64effe9b
fix: add url to local for custom method to use 2024-10-01 16:21:29 +02:00
Akhil Narang
7b0c4f495c
Merge pull request #27818 from cogk/feat-add-hide-label-checkbox-on-print-format
feat(print_format): Add checkbox to hide label
2024-10-01 16:30:13 +05:30
Akhil Narang
f4ca408376
Merge pull request #27817 from cogk/fix-labels-for-text-editor-fields
fix(print)!: Add labels on Text Editor fields
2024-10-01 16:29:59 +05:30
Akhil Narang
22a64461aa
Merge pull request #27921 from barredterra/redirect-after-rename
feat: redirect to new record after rename
2024-10-01 15:53:37 +05:30
Sumit Bhanushali
199c27f34e
Merge pull request #27910 from MeetSherasiya/fix/custom-dashboard-chart-tooltip-value-format
fix: custom dashboard chart tooltip value format
2024-10-01 15:32:57 +05:30
Sumit Bhanushali
8c22ac302c
Merge pull request #27923 from Aryan20/fix/rating-reset
fix: allow to reset rating input if not mandatory
2024-10-01 15:31:20 +05:30
Akhil Narang
b113b8355b
Merge pull request #27934 from cogk/fix-extract-images-as-public-in-published-event
fix(blog_post): Ensure images are public if shown on website
2024-10-01 14:57:41 +05:30
Sumit Bhanushali
826188f24f
Merge pull request #27945 from frappe/private_app
feat(PrivateApp): virtual app that will host all private workspaces of user
2024-10-01 14:19:32 +05:30
Sumit Bhanushali
99b8899ff6 feat(PrivateApp): virtual app that will host all private workspaces of user 2024-10-01 14:03:11 +05:30
Akhil Narang
789f0a58c7
Merge pull request #27771 from jabir-elat/develop
Fix: Enforced user permissions on report filters for linked doctypes
2024-10-01 12:50:10 +05:30
Sagar Vora
9dbe2571cf
Merge pull request #27502 from ljain112/fix-idx-pagination 2024-10-01 11:29:40 +05:30
Frappe PR Bot
b841a7ccef
chore: update POT file (#27927) 2024-09-30 22:20:58 +02:00
Frappe PR Bot
1a186cf549
fix: sync translations from crowdin (#27894) 2024-09-30 22:20:02 +02:00
David
a0ec82a8b3
fix: build workspace, add webhook log 2024-09-30 20:54:52 +02:00
Corentin Forler
bea742f624
fix: Evaluate bench execute args for each site 2024-09-30 14:46:54 +02:00
Corentin Forler
6a6ccc034c
fix(blog_post): Ensure images are public if shown on website 2024-09-30 14:45:58 +02:00
David Arnold
92ee2ce291
Merge pull request #27931 from blaggacao/feat/sidebad-with-log-links
Feat: sidebar with log links
2024-09-30 13:41:25 +02:00
David
22498f26a7
feat: add link to (various) logs in sidebar 2024-09-30 13:24:55 +02:00
David Arnold
6ab44a883b
Merge pull request #27870 from blaggacao/feat/custom-section-and-column-placement
feat: improve placement for custom field sections and columns
2024-09-30 13:11:11 +02:00
David
40025ec64f
fix: property setter for field ordering 2024-09-30 12:57:32 +02:00
Sumit Bhanushali
392a212b19
Merge pull request #27899 from frappe/perm_log
feat: perm log
2024-09-30 15:10:43 +05:30
Sumit Bhanushali
847dd62ec0 feat: permission log 2024-09-30 14:54:32 +05:30