Commit graph

32 commits

Author SHA1 Message Date
barredterra
38e140df22 fix(tests): skip uninstalled doctypes in test record dependency walk
The test runner walks link-field dependencies recursively to pre-generate
test records via `get_missing_records_doctypes`. If any DocType in the
transitive link graph belonged to an app not installed on the test site,
the walk crashed with `DoesNotExistError`, aborting the entire suite
before a single test ran.

Treat such link targets as dead-end leaves instead:

- `get_modules` now returns `(None, None)` when the DocType row does not
  exist, instead of falling through into `load_doctype_module` which
  raises.
- `get_missing_records_doctypes` checks for `module is None`, logs a
  warning naming the parent DocType that linked to it, and returns
  without descending further.

This restores the ability to run downstream test suites that link
(directly or transitively) to optional/uninstalled apps without forcing
every CI environment to know the full transitive link graph.

Fixes #38747
2026-04-21 01:49:08 +02:00
Akhil Narang
8723a2b6ee
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Akhil Narang
588cb1e44d
refactor: tomli -> tomllib
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-22 21:06:48 +05:30
Akhil Narang
6ca4d4d167
refactor(treewide): ruff format
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-09-26 13:16:43 +05:30
Gavin D'souza
551be4f6ab
fix: Clear site test records log before running test
Not sure if this was intentional - there is no documentation as far as i
can tell
2025-04-15 18:28:21 +02:00
Ankush Menat
7d4d6b59df
test: reduce noise in test output (#28862)
* 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
2024-12-23 06:11:47 +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
David
9954ca917b
fix: revert deprecation of json test records 2024-11-06 13:20:14 +01:00
David Arnold
91a737d8fe
chore(typing): fix some (exotic) type errors treewide (#28210) 2024-10-21 10:02:04 +00:00
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
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
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
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