Commit graph

2102 commits

Author SHA1 Message Date
Smit Vora
6b02484f1c
feat: bulk update docs using case when queries (#28483) 2024-12-06 11:34:25 +00:00
Akhil Narang
94fe90de66
refactor: pytz -> ZoneInfo
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-06 16:14:05 +05:30
Gavin D'souza
d521ac124d
style: Sort imports & move whitespaces to please ruff 2024-12-06 15:43:33 +05:30
Gavin D'souza
00163f5bf4
fix: Re-define utils to match previous behaviour 2024-12-06 15:43:33 +05:30
David Arnold
75377aaaf5
refactor(typing): type filters (#28218)
* chore(typing): type filters

* chore(typing): type filters for get_list et al

* fix: dashboard chart filter expression

* test: fix case with new-style right hand object to equality check

* chore: place new typed filter under typing verification

* chore: remove debug print statment

* chore: inverse logic of type guard

* fix: add float to filter value types

* chore: clarify value naming
2024-12-04 23:18:53 +00:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
Akhil Narang
3b6ff70d76
Merge pull request #28636 from akhilnarang/separate-db-config-keys
refactor: allow setting mariadb/postgres specific root credentials in site config
2024-12-02 15:52:44 +05:30
Faris Ansari
f7c005dc09
Merge pull request #28629 from netchampfaris/autoincrement-renaming
fix: allow renaming autoincrement documents
2024-12-02 14:25:05 +05:30
Faris Ansari
d33b1ac695 chore: formatting 2024-12-02 13:40:16 +05:30
Akhil Narang
d77abb2663
refactor: allow setting mariadb/postgres specific root credentials in site config
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-02 13:24:31 +05:30
Faris Ansari
3b014a2548 test: rename autoincrement document 2024-11-30 16:49:04 +05:30
David Arnold
6f35a554a5
fix: make read only mode thread safe (#28359)
* fix: Apply read_only_method decorator to Document methods

* fix: update tests for read-only document context manager

* refactor: place mappers into read-only mode

Reapply "refactor: place mappers into read-only mode"

This reverts commit a8208d57069c63f0982bf2881bcad28a4b349f3c.

read-only mode is now thread safe
2024-11-18 15:00:50 +01:00
David Arnold
d4382dc020
feat: add allowed referrers to loosen csrf prevention (#27841)
* fix: add allowed referrers to loosen csrf prevention

* feat: Add test case for is_allowed_referrer functionality
2024-11-15 12:09:53 +05:30
Akhil Narang
3dff39946d
Merge pull request #28448 from blaggacao/fix/test-environment-user-idempotency
fix(testing)!: ensure idempotency on the test environment user
2024-11-14 15:36:58 +05:30
David Arnold
057139ea2e
chore(communication): cleanup unused code (#28199)
* chore: feedback doctype no longer exists

missed from https://github.com/frappe/frappe/pull/17479

* chore: remove unused communication type

This was removed and migrated already in v12:

```
frappe/patches/v12_0/setup_comments_from_communications.py:	frappe.db.delete("Communication", {"communication_type": "Comment"})
```
... comming from 41d90fa6d1
which effectively reverted 465318878e
2024-11-14 00:12:14 +01:00
David
e2f5536f08
fix(testing): ensure idempotency on the test environment user 2024-11-13 10:42:19 +01:00
David
9954ca917b
fix: revert deprecation of json test records 2024-11-06 13:20:14 +01:00
David Arnold
4000cba810
fix: compat FrappeTestCase (#28367)
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
2024-11-05 18:16:22 +01:00
Ankush Menat
16407a50ec
fix: Excessive gap locking from hash naming (#28349)
Because of large common prefix hash naming becomes "too sequential" when
doing a lot of concurrent writes.

I don't know a good tradeoff between both use cases:
1. Lots of reads - prefers large shared prefix.
2. Lots of writes - prefers small shared prefix.

But as of now this punishes writes too badly in form of excessive
locking. Until a better fix is found, it's better to keep it prefix free.

---

A better fix would be a tradeoff of between these two:

1. Reads - temporal locality should result in spatial locality on disk.
2. Writes - temporal locality should NOT result in spatial locality.

temporal locality = data inserted around same time
spatial locality = data sits next to each other in DB pages.

This can be achieved by adding a small request/job specific part to
prefix so each concurrent request has it's own different locality when
writing data.
2024-11-01 06:18:22 +00:00
David Arnold
d5fd8d7c20
chore(docref): fix circular imports (#28282) 2024-10-24 22:31:12 +02:00
David Arnold
9f980e7475
test: add missing test case for get values on single (#28254) 2024-10-23 10:47:46 +02:00
David Arnold
91a737d8fe
chore(typing): fix some (exotic) type errors treewide (#28210) 2024-10-21 10:02:04 +00:00
David Arnold
2abba7b51b
fix: don't force values into the string type (#28185) 2024-10-19 19:00:25 +00:00
David Arnold
7348572af8
feat: docref identifier / proxy (#27973)
* feat: add DocRef

* feat: Add comprehensive test cases for DocRef functionality

* chore(db): add field type hints

* fix: ensure document stringer fulfills the DocRef contract
2024-10-19 09:40:26 +05:30
David Arnold
129af5e26a
fix(testing): improve error message on inconsistent global state (#28144) 2024-10-16 16:00:59 +00:00
David Arnold
30dda5287c
test: remove toleration for test record creation failure (#28143)
this ensures test record creation conforms with the spec or fails sharply
2024-10-16 16:18:36 +02:00
David Arnold
860ae4fdcb
test: improve logging during test record creation failure (#28142) 2024-10-16 13:07:39 +00:00
Akhil Narang
e96ff7e65e
Merge pull request #28015 from marination/not-set-filter
fix: 'not set' equivalence in query conditions
2024-10-14 16:00:55 +05:30
David Arnold
633c511039
test: fix record creation on reentry (#28111)
* test: fix record creation on reentry

* chore(testing): clarify function signature
2024-10-13 14:04:36 +02:00
David Arnold
a8ae9f9f0f
fix(testing): test record removal (#28114) 2024-10-13 10:33:34 +00:00
David Arnold
008984b164
fix(dumpster): deprecation of classes (#28103)
fixes: https://github.com/The-Commit-Company/raven/pull/1093#issuecomment-2408645569
2024-10-13 12:25:53 +02:00
David Arnold
1ac43e20b2
ci: perf fix; keep record logger referenced (#28108) 2024-10-13 04:26:23 +02:00
David Arnold
5dd330cef2
fix(testing): record creation output; only visit missing once (#28104) 2024-10-13 00:53:34 +02:00
David Arnold
cc1ddb975f
fix(test): Enhance test record syncing and logging functionality (#28094)
- 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
2024-10-13 00:04:43 +02:00
David Arnold
9d63208c9c
fix: test record generation (#28102)
* 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
2024-10-12 22:31:40 +02:00
David Arnold
3e3ebd2593
style: test class & module output capture (#28096) 2024-10-11 23:24:01 +00:00
David Arnold
1b00b5c723
fix(testing): variable naming for clarity (#28095) 2024-10-11 20:32:46 +00:00
David Arnold
4abc13b33c
refactor: improve test record generation and logging (#28092)
- Rename functions for clarity
- Enhance logging with more detailed messages
- Refactor record creation process for better organization
- Improve handling of record synchronization and caching
2024-10-11 18:20:35 +00:00
David Arnold
da561ff749
docs: clarify the code path, add comments (#28090) 2024-10-11 15:58:40 +00:00
David Arnold
4a65637c4a
fix: persistent per-site test record creation log file name (#28089)
* fix: persistent per-site test record creation log file name

* fix: persistent per-site test record creation log erasure
2024-10-11 13:20:27 +02:00
David Arnold
c9eb0475cf
docs: reduce verbosity of deprecation messages (#28082) 2024-10-10 17:09:33 +00:00
David Arnold
788f71e259
fix: rebasing oversight in test record persistent logger (#28078)
* fix: rebasing oversight in test record persistent logger

* perf: make test record log append-only jsonl log
2024-10-10 14:55:34 +00:00
David Arnold
443c38daa9
refactor: toml test records for readability (#28065)
* 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
2024-10-10 13:24:02 +02:00
David Arnold
b53ec634c2
docs: log test record creation into testing log (#28071) 2024-10-10 10:02:03 +00:00
David Arnold
3873580bba
fix: persistent per-site record creation log (#28070) 2024-10-10 09:32:59 +00:00
David Arnold
df245773c8
fix: prevent excessive growth on cached recursion (#28069) 2024-10-10 07:59:52 +00:00
David Arnold
59dd4dcd8f
fix: test record discovery (#28067)
* fix: doctype name discovery

* fix: preserve dependency order
2024-10-10 00:25:42 +00:00
David Arnold
83bc1f09e9
refactor: clarify test record dep management in test modules (#28060) 2024-10-09 13:44:27 +00:00
David Arnold
95950c8d81
refactor: organize test contextmanagers (#28041)
* 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
2024-10-09 02:09:19 +02:00
David Arnold
e7776021aa
refactor: Structure frappe.test.utils (green to green) (#28038)
* docs: constitute frappe.test readme

* refactor: move utils to __init__

* refactor: move generators into generators.py

* refactor: move cm into context_managers.py

* refactor: move test classes into submodule

* refactor: reexport general purpose context managers

* refactor: adapt imports (treewide)
2024-10-08 15:10:24 +00:00