Commit graph

104 commits

Author SHA1 Message Date
barredterra
745297a49d refactor: a not in b
Search: if not ([\w\d]*?) in ([\w\d]*?)
Replace: if $1 not in $2
2022-02-21 19:54:34 +01:00
Gavin D'souza
9091b2a037 feat(minor): Case option in run-tests for specifying TestCase 2022-01-28 18:31:35 +05:30
Conor
40ba1ac9ba fix: Postgres Compatibility
* Handle inconsistencies in type handling in DatabaseQuery & Database
  APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests

fix: db independent syntax for user_type

fix: handle postgres datetime values

feat: add ability to auto commit on db inserts

feat: add ability to escape underscore in postgres

fix: handle missing data in test runner bootstrapping

fix: db independent syntax for queries

fix: refactor to use qb

fix: update cache for language

fix: use pluck in email_queue

Co-authored-by: gavin <gavin18d@gmail.com>

fix: don't auto insert on tests for make_property_setter

fix: remove auto_commit in custom_field insertion

fix: remove auto_commit functionality

fix: review comments

fix: revert link validation

fix: style suggestion for readability

Co-authored-by: gavin <gavin18d@gmail.com>

fix: revert .lower() in link validation

fix: add rollback for setup_wizard

Revert "fix: add rollback for setup_wizard"

This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.

Revert "feat: add ability to escape underscore in postgres"

This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.

fix: more concise representation of order fields

Co-authored-by: gavin <gavin18d@gmail.com>
2022-01-07 10:44:57 +05:30
Ankush Menat
4755f416db test: restore scheduler state after running tests 2021-10-29 15:16:29 +05:30
Ankush Menat
13a2c3403c test: enable scheduler back after running the test 2021-10-29 13:10:28 +05:30
Ankush Menat
1bf4359f9c fix: only import xmlrunner if coverage is required 2021-10-25 16:59:43 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
ChillarAnand
32759cfc90 fix: Passed failfast flag to unit test runner in all scenarios 2021-08-25 08:03:48 +05:30
leela
db09a85183 refactor: Add authentication for Redis Queue 2021-07-26 21:09:34 +05:30
Ankush Menat
a164dd0a8c
fix: test failure due to uncommited transaction
Steps to reproduce:
- Create a fresh new site with Frappe
- Add and install a new app.
- Add basic test_file.py anywhere in module.
- Run the single using test with bench command:
`bench --module module.dotted.path --test testname`

The test will not run and complain about implicit commit.

- root cause: test runner makes changes to DB but does not commit. e.g.
disabling of scheduler on L57.

Note: this is not reproducible in FF or when ERPNext is installed
because in many places of "test process" somethng else commits the
changes like `before_tests` hook, which usually isn't present in new
apps.
2021-06-11 16:27:55 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
803741466d fix: Sort dependency options for predictability 2021-05-10 18:38:36 +05:30
Suraj Shetty
76348b892f refactor: Move parallel test runner code to a separate file 2021-05-09 09:32:28 +05:30
Suraj Shetty
13be89f049 style: Fix sider issues 2021-05-08 15:45:54 +05:30
Suraj Shetty
2c54549677 feat: Make parallel test independent of test orchestrator 2021-05-07 21:58:43 +05:30
Suraj Shetty
5ccccf104d chore: Track before test time 2021-05-06 17:39:19 +05:30
Suraj Shetty
c1ea512b3a feat: Indicate slow tests 2021-05-06 14:51:27 +05:30
Suraj Shetty
c5910f91ee ci: Fix coverage file path 2021-05-05 16:17:17 +05:30
Suraj Shetty
bb833799dc fix: Click ctx error 2021-05-05 14:47:41 +05:30
Suraj Shetty
0375b9f3af chore: Enable coveralls 2021-05-05 14:05:12 +05:30
Suraj Shetty
f6fa55f76c fix: Run before test hooks 2021-05-05 13:31:02 +05:30
Suraj Shetty
e33a09f4e6 refactor: Test runner
- fix style
- Handle global dependency
2021-05-05 13:15:25 +05:30
Suraj Shetty
7ac3b53c1c feat: Add support for build combined coverage file
- from parallel tests
- Update workflow files
2021-05-02 21:01:47 +05:30
Suraj Shetty
249fa6d21b feat: Add run-parallel-tests command
- Tests will be distributed across different build machines
(dependent on test orchestrator)
- PrettyPrint for test results
2021-05-02 14:28:16 +05:30
Walstan Baptista
a15e1a7d59
test: sort folders and files before running tests for consistency (#12689)
* fix: sorted folders list befor adding tests

* fix: sort files as well

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>

* fix: remove unnecessary cstr

* fix: minor code quality change

* test: use unique `user_email` in `TestAuth`

* test: Use unique username for auth test

* test: Delete DocType Doc A completely after test is done

* test: Fix permission issue & typo in test cases

Co-authored-by: Sagar Vora <sagar@resilient.tech>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: Suraj Shetty <surajshetty3416@gmail.com>
2021-03-26 12:33:46 +00:00
prssanna
459f65ba18 test: explicitly start transaction before each test 2021-03-15 18:05:24 +05:30
Suraj Shetty
36923b530b test: Explicitly begin transaction before test to allow rollback 2021-03-15 18:05:24 +05:30
mathieu.brunot
d38e9855be
Merge remote-tracking branch 'origin/develop' into ci/reports
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-12-14 14:38:43 +01:00
Faris Ansari
488c68df96
Merge branch 'develop' into refactor-scheduler 2019-12-02 13:16:45 +05:30
mathieu.brunot
469944d273
🐛 Change runner init if XML report on
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-11-26 04:00:14 +01:00
mathieu.brunot
cf50b52df7
🐛 Allow Unit Test XML to write binary
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-11-26 03:21:23 +01:00
mathieu.brunot
3073515b1c
🚧 Split runner init from test run
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-11-26 03:11:40 +01:00
mathieu.brunot
0054206e43
🚧 Testing without TimeLogging
Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>
2019-11-25 23:23:49 +01:00
Gavin D'souza
ae48dfe2b4 chore: dropped legacy selenium dependant tests
selenium TestDriver deprecated
--ui-tests flag in `bench run-tests` deprecated
2019-11-13 15:01:05 +05:30
Rushabh Mehta
7cd329fac9 reactor(scheduler): created "Scheduler Job Type" and cleaned up scheduler 2019-11-07 12:14:09 +05:30
Faris Ansari
44028ce23a fix(test_runner): Load file if exists 2019-09-29 22:41:30 +05:30
Aditya Hase
4a2881450d fix(tests): Show test duration if it exceeds SLOW_TEST_THRESHOLD (#7119) 2019-03-27 14:38:25 +05:30
Aditya Hase
e358841d3c fix(python3): super() backward compatibility fix 2019-03-14 16:52:13 +05:30
Aditya Hase
a873a19094 feat(tests): Record time required for each test 2019-03-08 12:28:41 +05:30
Nabin Hait
30abaa4f8a feat(test runner): break run-tests on first error 2018-09-12 17:44:44 +05:30
Rushabh Mehta
2a8e890fee enhance(testing): allow tests to be run by skipping fixtures with --skip-before-tests and --skip-test-records 2018-08-31 15:30:42 +05:30
Suraj Shetty
0be4342649 User permissions redux (#5314)
* [start] removing simpler user permission structure

* permission changes
removed "apply user permission" from has_permission

* test fixes and other supporting fixes

* Removed Apply user permission code

* additional check to see if user has some user permissions related to a doctype

* test fixes

* removed a test

* Permission changes
- Code to restrict access if module is blocked for user.
- [Fix] ignore user perm if applicable

* List view restrictions ui changes

* removed unwanted apply user perm code

* permission (block module fix)

* permission fix

* change user permission
user permission will not be applied if user doesn't have role permission

* removed left "apply_user_permissions" property

* add user permission help template

* perm js refactor

* ui / ux changes
restrict list view before entering view if user is not permitterd
add description for if owner check in role permission manager

* codacy fixes

* permission code fix
add controller permission check
add blocked module check in build_permission

* optimized get blocked module method
2018-04-03 10:42:04 +05:30
Achilles Rasquinha
005cfe3dc8 🎉 NEW Frappe Chat (#4612)
* added doctypes, created frappe chat ui

* added component layout with state-like abilities, added apis

* updated user doctype, moved from state-like feature and component abstraction

* added room component

* fixed publish_realtime with after_commit = True

* created room component and searchbar

* minor fix

* functional message parsing

* update

* Added Chat Profile

* added chat message

* more changes into chat room

* fixed APIs, added client side scripting

* added chat message attachements, more doc updates

* Brand New UI with socket io room integration

* completed socketio integration. off to room subscription and publish

* realtime room update

* raw update

* initialized docs, added p2p connection for call tests

* updated docs

* added coverage, updated api for ease of use

* raw commit

* added test cases

* Chat Room updates and new room creation

* added chat group creation

* added collapsible plugin

* toggable room view

* updated

* [RAW]

* updated UI for chat

* Deleted Previous Chat Page

* moved from frappe.Chat.Widget to frappe.Chat

* modularized frappe-fab

* added more docstrings

* tried adding conversation tones

* Added conversation_tones and refurbished chat popper

* modified frappe.ui.Dialog, moved from AppBar to ActionBar, responsive for Mobile 💃

* moved RoomList item namespace

* Configurable Desktop update, moved profile updates to on_update

* added state change listeners

* removed AppBar to ActionBar customizable 💃

* added destroy method

* removed coverage, refactored group creation

* Successful Chat Rooms and Group creation

* sort rows based on last_message_timestamp or creation

* added frappe._.compare

* removed redundant less variables

* Chat Room back button with custom routing and destroy methods

* Added EmojiPicker

* fixed multiple dialog render

* setup quick access

* added chat chime, functional chat message list updates at room list

* deleted package-lock.json

* realtime date updates

* updated chat message list

* functional message render and updates

* added track seen

* added typing status

* updated typing status

* valid typing statuses and quick search

* Functional Quick Search

* reverted fix

* some more cleanup and promisifed

* fixed hints close on click

* updated fab boldness

* close popper on click panel

* close popper on click panel

* reverted octicon-lg, fixed popper heading click

* new frappe capture

* removed webcamjs

* added uploader and capture

* removed chat FAB, added as notification instead

* on message update
2017-12-28 18:58:43 +05:30
Rushabh Mehta
5a9d38f767
[enhance] bench run-tests --doctype-list app/path/to/test.txt (#4561)
* [enhance] bench run-tests --doctype-list app/path/to/test.txt

* [fix] tests for doctype-list-path

* [fix] tests for doctype-list-path
2017-12-01 12:05:06 +05:30
Ameya Shenoy
d746d1e8af Added test-list option to run-ui-tests (#4540)
* Added test-list option to run-ui-tests

will help bifurcating the ui tests into stages

* modified to add new parameters at the end
2017-11-30 16:26:43 +05:30
Valmik
5aa676c688 [fix] make test records for dependencies for app tests (#4336) 2017-10-18 11:38:14 +05:30
Nabin Hait
97037ce3f3 Fixes in test_runner (#4213) 2017-09-29 13:14:14 +05:30
Nabin Hait
5882fbd48b Create test records only if not exists in db 2017-09-28 18:58:15 +05:30
Rushabh Mehta
5601c0024f [test] revert naming series if name fails 2017-09-26 12:49:48 +05:30
Rushabh Mehta
7b9f8ee785 [test] revert naming series if name fails 2017-09-26 12:37:19 +05:30