Commit graph

78 commits

Author SHA1 Message Date
David Arnold
6b2bb9a2ab
fix: add env overrides for service orchestration (#21577)
This avoids having to manipulate config files in brittle bash
entrypoints that need to react to dynamic service discovery.

This significantly improves the operability of various bench sites.
2023-07-14 11:39:01 +05:30
Ankush Menat
1092eef7bd perf: faster pending jobs check 2023-06-29 17:31:06 +05:30
Gavin D'souza
2c348af4f7 test: Add tests for scheduler cli 2023-02-13 15:13:43 +05:30
Gavin D'souza
c337e532d8 test: Add test for db-console pass extra params to client
Added test for https://github.com/frappe/frappe/pull/19809
2023-02-13 14:55:23 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
433115f62d
test: rollback test transaction after executing cmd (#19606)
In command tests if connection is active then due to repeatable read
isolation you will continue to read old data which might be modified by
the command you're trying to test.

It makes sense to end transaction after each command execution here.

[skip ci]
2023-01-16 18:43:52 +05:30
Ankush Menat
c7edd7e57c chore: remove unnecessary assertion 2023-01-16 18:02:40 +05:30
Ankush Menat
8adfdcbc1d tests: clear DB transactions before all db calls
Because of repeatable read isolation,
changes from externally executed command dont reflect until transaction is ended.
2023-01-16 17:32:29 +05:30
Ankush Menat
5e2bbf834f refactor: filter out apps not installed on bench 2023-01-16 13:54:40 +05:30
Ankush Menat
db35431b8c fix(postgres): psql with remote databases
If you dont use unix socket psql command doesn't work.
2022-12-20 15:14:38 +05:30
Ankush Menat
442ba5dbf2
fix: set-config -g (#19217)
This isn't working because it uses update_site_config command which
attemts to find site_dir to create a lock which doesn't work when site
isn't init-ed.
2022-12-09 11:10:09 +05:30
Ankush Menat
abeed35461
fix: throw exception if backup failed (#18230) 2022-09-28 14:29:38 +05:30
Ankush Menat
6ba28061f6
test: flaky API tests due to autherror (#18221) 2022-09-26 12:33:20 +05:30
Ankush Menat
6ec5c05e4e test: simplify user addition test 2022-08-24 14:50:22 +05:30
Alaa Alsalehi
40f54d04b7 feat(bench): add new bench command for add user 2022-08-24 14:29:50 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Gavin D'souza
cfba07df07 test: Add test for bench_helper module 2022-08-11 23:53:21 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Ankush Menat
69cb144b06 refactor!: move plyr from default bundle 2022-06-20 20:46:57 +05:30
Ankush Menat
f40c82d4d8
test(meta): control JS bundle sizes (#17244)
Any drastic increase in production bundle sizes should fail in CI.
2022-06-20 15:34:11 +05:30
Ankush Menat
f1271b78de test: ensure temp tables are removed exist 2022-06-15 12:30:38 +05:30
Ankush Menat
8b8552b0e4 feat: clear-log-table to clear large log tables 2022-06-15 12:30:38 +05:30
chillaranand
25f82e966c refactor: Remove unused imports & code 2022-05-19 15:34:35 +05:30
Ritwik Puri
7fa9c42711
Merge branch 'develop' into atom 2022-05-11 22:35:09 +05:30
phot0n
d28eb94281 test: test for force install-app
Note: this is a very minimal test, as frappe_docs doesn;t really have any doctypes
2022-05-11 22:34:18 +05:30
Ankush Menat
665f871c09 test: delete duplicate test 2022-05-10 14:41:01 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
67df13f77f test: Add test for asset building command 2022-02-11 19:25:21 +05:30
Gavin D'souza
804f3941ff test(restore): Skip test_restore
ref:
* https://github.com/frappe/frappe/runs/5156148762?check_suite_focus=true
* https://github.com/frappe/frappe/runs/5156148706?check_suite_focus=true
2022-02-11 18:27:50 +05:30
Gavin D'souza
643eecb0ac test(fix): Test list-apps for site 2022-02-11 18:10:31 +05:30
Gavin D'souza
ac17f8dfb1 test: Allow list-apps to throw errors based on site's states 2022-02-10 14:56:35 +05:30
Gavin D'souza
f343e77ecf fix(CliRunner): Test suite for Cli
* Manage states
* Add formatting on test failures
* Patch pass_context
2022-02-04 12:47:58 +05:30
Gavin D'souza
d18f4e717f fix(test): Use standard test site for cli invokations 2022-02-03 16:58:59 +05:30
Gavin D'souza
74c56c2e63 test: Add test (+ suite) for site migration 2022-02-03 16:58:29 +05:30
Gavin D'souza
023269d927 test(fix): Remove options passed in archive backup tests
* Run archive tests only for MariaDB
* Removed and added the options for root and admin passwd because they
  were in the site_config and not in common_ :')
2022-01-13 15:42:02 +05:30
Gavin D'souza
d5b3fc04e0 fix: Breaking backup tests due to site settings 2022-01-13 13:25:32 +05:30
Gavin D'souza
9e281e7b19 refactor: Test Commands
* Separate out test case for backup cases
  * Split each case into separate tests
  * Add teardown to remove files geenrated in custom paths
* Rename test that wasn't running
* Rename test cases for consistency
2022-01-12 16:01:03 +05:30
ChillarAnand
8191fafa58 chore: Add test for archiving site before dropping 2021-12-28 16:04:37 +05:30
Gavin D'souza
0657524888 refactor: Retire color in favour of click.secho
* Add type hints for Command test suite
* Remove support utils - dead code
2021-11-25 12:49:43 +05:30
ritwik
5cfe3ad946
feat: add no-git option in make-app command and boilerplate generation (#15028) 2021-11-23 04:11:06 +00:00
Ankush Menat
35b242fe27
test: remove app unit tests 2021-10-12 17:33:29 +05:30
Mohammad Hasnain Mohsin Rajan
ae5cf9c32c
chore: change missing_in_backup function docstring 2021-09-12 19:09:05 +05:30
Ankush Menat
c663ab7d44
test: improve test failure message 2021-08-31 22:31:50 +05:30
Faris Ansari
47a21fb9a7 test: db.commit to release lock 2021-08-04 16:29:22 +05:30
Faris Ansari
fbd900aaff test: for set-password and set-admin-password 2021-08-02 15:28:25 +05:30
Gavin D'souza
01d275f667 style: Format code for better readability
* Remove trailing whitespaces
* Format code to fit module conventions
* Add appropriate new lines between imports, classes, fn defs, etc
* Added comments, docstrings & module headers
2021-07-28 18:55:27 +05:30
barredterra
fc2c887635 test: fix return code 2021-07-13 13:23:25 +02:00
barredterra
d7e0479ee7 test: add test for bench version 2021-07-05 19:53:02 +02:00
Ankush Menat
4754ab71d1
perf(minor): remove unnecessary comprehensions
- remove several unnecessary comprehensions from functions that accept a generator.
- Using `[x for x in iter]` causes a list to be built first then passed to the outer function.
- `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries.
- `sum`, `min`, `max` => memory usage become O(1)
- `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built.
- lastly, it's two fewer characters to read/think about.
2021-05-12 20:38:18 +05:30
Ankush Menat
a077466b1e
chore: replace assertEquals with alias assertEqual
`assertEquals` has been deprecated, while not fully removed it will
still keep giving warnings in tests / CI.

ref: https://docs.python.org/3/library/unittest.html#deprecated-aliases
2021-05-06 21:16:22 +05:30