Commit graph

670 commits

Author SHA1 Message Date
Maharshi Patel
6a861fc3c8
chore: added ipv6 to hosts file (#29199)
macos takes 5-10 second on dns when *.local is used unless ipv6 is added to hosts file.

source: https://stackoverflow.com/questions/10064581/how-can-i-eliminate-slow-resolving-loading-of-localhost-virtualhost-a-2-3-secon/17982964#17982964

Adding this even though it's edge case because i spent few days debugging something else to make it faster.

Co-authored-by: Maharshi Patel <maharshipatel@Maharshis-MacBook-Pro.local>
2025-01-16 19:23:32 +05:30
Ankush Menat
14e46495c0
test: use environment's python (#29137)
This test is only passing because ci is sourcing env, it won't work IRL
like this.
2025-01-14 06:21:44 +00:00
Ankush Menat
2214116318 test: sanity tests for gunicorn workers 2025-01-13 19:55:30 +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
Akhil Narang
2610b8435c
fix(new-site): don't allow creating a site with the same name as an app
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-10 11:25:13 +05:30
Ankush Menat
6b0d13a5bf test: avoid rebuilding assets 2025-01-04 12:14:55 +05:30
Ankush Menat
13304cd36d ci: balance test distribution manually
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.
2025-01-04 10:55:53 +05:30
Ankush Menat
41d4155bba perf: Use system settings directly for fetching language 2024-12-26 11:52:44 +05:30
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
David
1d31663f4b
fix(testing): clarify --pdb to --debug from a users perspective; also attach pdb on any exception
prior, the implementation attached to AssertionErrors
and the flag did not represent that this disables the buffer so that normal breakpoints work
2024-12-12 13:19:20 +01:00
David
aec58a9ad0
chore(ui-tests): raise click Exit exception 2024-11-29 13:39:03 +01:00
Akhil Narang
318a47219c
chore(ui-tests): don't print subprocess traceback
We have the cypress error from its output above, just a simple error message is enough here

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-29 18:03:18 +05:30
Akhil Narang
5e5a332cec
fix(new-site): mariadb_user_host_login_scope was broken since it was added
Mismerge in 0d3b2499fc

Thanks Revant for pointing it out

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-07 16:33:02 +05:30
David Arnold
61a107b6af
ci: make gh actions functions (#28299)
* ci: make gh actions downstream reusable

* refactor: merge ci helper into run-parallel-test command

* ci: refactor to sensible db password
2024-10-27 02:09:02 +00:00
David Arnold
2f9fd308e8
fix(testing): pdb post mortem (#28156) 2024-10-17 18:52:25 +00: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
5324431fc0
fix: Testing Module 28000 (#28032)
* fix: logging text

* fix: app handling
2024-10-08 10:14:19 +00:00
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
Akhil Narang
b7fcafcaf1
chore: add back describe-database-table command
Partial revert of b169f8780a

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-09-18 16:48:49 +05:30
David
202cce8a0d
refactor: type hint cli context 2024-09-13 17:25:43 +02:00
David (aider)
0e92dc3a97
feat: friendly error wrapper on cli 2024-09-13 17:07:04 +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
Akhil Narang
30f5669489
fix: don't allow uninstalling frappe...
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-08-30 18:04:32 +05:30
Arun
ae3f8f455b fix: http to https for url 2024-07-29 13:53:25 +05:30
Arun Mathai S.K.
02c680e68d
fix: migrate-to now works (#27115)
* chore : migrat-to pre check url

* feat: migrate-to now works

* fix: unecessary context

* chore: remove commented code
2024-07-18 10:27:20 +05:30
Corentin Flr
932c58f921
feat(commands): Add bypass-patch command (#26633)
* feat(commands): Add bypass-patch command

* chore: delete comments

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2024-06-03 07:06:18 +00:00
Ankush Menat
d13178755b refactor: keep scheduler+worker behaviour to workerpool
- Single worker adds some extra costs to each worker (importing scheduler)
- Workerpool can import it all once and share
- This way we need not have many different
2024-05-27 12:29:41 +05:30
Ankush Menat
433e7281f7 feat: make running scheduler with worker optional 2024-05-27 12:14:15 +05:30
Ankush Menat
b169f8780a feat: Add identified index from UI 2024-05-14 18:54:38 +05:30
Ankush Menat
ee64b2cb6c
fix!: Only use webserver_port in developer mode (#26268) 2024-05-01 12:11:01 +05:30
Akhil Narang
ea1c8910e6
feat: delete failed backups
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-10 12:57:16 +05:30
Akhil Narang
0d3b2499fc
fix: don't use frappe.flags for mariadb_user_host_login_scope
This gets reset whenever we call `frappe.init()` again

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 16:57:04 +05:30
David
39d4318a27
feat: enable db socket connection 2024-03-29 10:29:50 +01:00
David
6eb1607c0a
refactor: name and explain user host login scope flag for mariadb 2024-03-29 10:26:49 +01:00
Akhil Narang
ee8e2fef8c
refactor(new-site): update rollback prompt
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:12:19 +05:30
Akhil Narang
4b2fde1d8f
fix: check if rollback callback is defined
Don't raise exceptions where a simple print() will suffice
Print exception before prompting for rollback

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
c58e986a87
chore: check whether we're in an interactive session or not
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30
Akhil Narang
147c0c8b37
feat: initial failed site rollback implementation
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-03-29 12:00:25 +05:30