Commit graph

311 commits

Author SHA1 Message Date
Rucha Mahabal
cc74712304
feat: after_build hook (#38518)
* feat: `after_build` hook

* feat: add option to skip running `after_build` hooks

* feat(boilerplate): add `after_build` hook

* revert: "feat: add option to skip running `after_build` hooks"

This reverts commit 6e9d2c6a2333d487fcf4d1908c366b496a8d80b1.
Removing the flag for now as other hooks (like after/before migrate) don't have a skip option either
2026-04-13 12:15:38 +05:30
Faris Ansari
4b1f55d306
feat: improve bench execute argument passing (#35964)
* fix: better way to pass arguments to bench execute

* refactor: move execute logic in separate file

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2026-02-09 06:22:05 +00:00
Samar Singh
39b14f3a67
feat: configurable esbuild build target (#34398) 2025-10-17 00:55:21 +00:00
Ejaaz Khan
5f99434f52 fix: import function/module inside inside fucntion 2025-09-29 23:09:25 +05:30
Ejaaz Khan
964dd6c034 feat: Chrome PDF generator
Co-authored-by: maharshivpatel <maharshivpatel@users.noreply.github.com>
2025-09-29 12:15:51 +05:30
Akhil Narang
898742cdb6
chore: manual fixups
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-09-26 13:22:29 +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
Akhil Narang
b40c1d292b
chore(commands/version)!: use plain output instead of legacy by default
This includes the commit hash in the output, which is useful

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-08-12 14:57:14 +05:30
Sagar Vora
cb0d06455b chore: use frappe._dev_server instead of local.dev_server 2025-06-17 12:03:08 +05:30
Kit Rhodes
30c5376653
docs: Correct spelling of 'specified' in frappe/commands/utils.py (#32790) 2025-06-05 02:53:01 +00:00
Akhil Narang
ad32216040
fix: support sqlite
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-04-15 13:59:16 +05:30
Ankush Menat
5a5ad3032c
fix: procline crash (#31845)
* fix: Skip rollback if no DB

* fix: drop proctitle from dependency

- While it improves our own processes, it makes gunicorn process titles worse
- It also crashes on mac because of some unknown reason related to fork-safety.

Best to not use this.
2025-03-21 12:30:19 +05:30
Akhil Narang
ef341933e4
fix(make-app): don't allow creating an app with the same name as a site
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-10 12:02:40 +05:30
Ankush Menat
41d4155bba perf: Use system settings directly for fetching language 2024-12-26 11:52:44 +05:30
David Arnold
7e453ea515
Testing Module (#28000)
* refactor: add create_handler alongside create_logger

* fix: bench helper click exceptions for --help (2nd attempt)

* fix: increase logging level missing test records

* fix: reorganize test runner into testing module and refine logging

* fix: semgrep complaint

* chore: remove unused code; only keep deprecation proxies

* fix: import statements

* fix: output & string processing
2024-10-07 09:46:49 +02:00
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
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
f0ba65eb9b
ci: improve reporting 2024-10-04 15:22:49 +02:00
Corentin Forler
bea742f624
fix: Evaluate bench execute args for each site 2024-09-30 14:46:54 +02:00
David
202cce8a0d
refactor: type hint cli context 2024-09-13 17:25:43 +02:00
David Arnold
40f2387780
Merge pull request #27763 from frappe/fix/correct-execute-command
fix!: execute command
2024-09-13 17:05:07 +02:00
David
6a95540bf5
fix: nicer error message on bench execute 2024-09-13 16:52:16 +02:00
David
0c6fffa348
fix!: execute command
BREAKING: return values of bench execute are not quoted anymore
For example, `bech execute frappe.bold --arg 'hi'`
- now returns: `<strong>hi</strong>`
- instead of: `"<strong>hi</strong>"`
2024-09-13 16:52:15 +02:00
David
d87b786687
chore: fix all invocation of init for singledispatch -> min 1 positional arg 2024-09-13 11:53:52 +02:00
David
e0fe0b8c88
chore: simplify config calling 2024-09-11 23:24:26 +02:00
David Arnold
a837fa28fb
Merge pull request #25734 from blaggacao/feat/debug-tests
feat: add debug tests
2024-09-04 20:11:58 +02:00
David (aider)
85c9a6b1c8
feat: add list-sites command 2024-09-04 19:51:05 +02:00
David (aider)
f194eeee92
feat: add --pdb 2024-09-04 19:49:52 +02:00
David
39d4318a27
feat: enable db socket connection 2024-03-29 10:29:50 +01:00
Akhil Narang
3a7dd3a1db
Merge pull request #25417 from akhilnarang/psql-history-log
fix: log psql console usage as well
2024-03-14 12:33:24 +05:30
Akhil Narang
d0923b0cd9
refactor: move histfile setting into helper function
This will ensure even users of `bench db-console` can use it

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-14 11:12:17 +05:30
Akhil Narang
afdb455b5a
fix: log psql console usage as well
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-14 10:56:17 +05:30
Akhil Narang
8e057e2010
fix(console): use frappe.conf.db_user
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-14 09:06:19 +05:30
Ankush Menat
532e1ef402
Merge pull request #25366 from ankush/mariadb_logging
fix: log mariadb console usage
2024-03-12 20:45:54 +05:30
Ankush Menat
676c40a15b
Merge pull request #25364 from ankush/ipython_logging
fix: Log ipython commands
2024-03-12 20:34:15 +05:30
Ankush Menat
2d75dbb598 fix: log mariadb console usage 2024-03-12 20:33:27 +05:30
Ankush Menat
8bdc88f06d fix: Log ipython commands 2024-03-12 20:11:00 +05:30
Ankush Menat
59f421cd04
fix: traceback colours (#25356)
default ipython colours use yellow on white font, which looks horrible
and is practically unreadable on most colourschemes.
2024-03-12 10:22:18 +00:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
33d0db364b
feat: allow configuring coverage from envvar (#24788) 2024-02-06 10:06:48 +00:00
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Akhil Narang
60c1812cc2
fix(run-tests): don't try to access frappe.flags before frappe.init()
Broke in #24432

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-02 22:26:01 +05:30
David Arnold
c57bc94ead
chore: cleanup frappe.connect invocations 2024-01-24 11:56:24 +01:00
Alan
7a68ebe3a4
Merge pull request #24412 from frappe/add-using-cached-build-flag
feat(Bench): add using-cached flag
2024-01-18 18:12:02 +05:30
mergify[bot]
483fcf89c3
Merge pull request #24428 from blaggacao/chore/cleanup-frappe-connect
chore: cleanup frappe connect (I/II)
2024-01-18 12:15:42 +00:00
18alantom
2da12b27cd refactor: set using cached with envvar 2024-01-18 16:25:14 +05:30
18alantom
9a87ec11e7 fix: add command to indicate use-cached support 2024-01-18 13:15:58 +05:30
Ankush Menat
ee6743c26b
fix: avoid mutating list while iterating over it (#24438) 2024-01-18 05:44:30 +00:00