Commit graph

93 commits

Author SHA1 Message Date
Faris Ansari
b61a37a233 fix: Notification test in Postgres (#7044) 2019-03-08 20:47:21 +05:30
Faris Ansari
83d6659e12 Add UI tests using Cypress (#6562)
* test(UI): Add UI tests using cypress

* test: Add test configuration for travis

* fix: Lock redis version

* fix: Refactor fill_field command

* fix: Rename setup_wizard test to run first

* test: Add setup for dashboard service

* test: Add build matrix for ui test

* test: Add name to each build matrix

* test: Only include ui test for an extra build stage

* fix: Exclude UI test with python 3.6

* test: Test order

* test: Enable developer_mode

* test(login): Check session user and not hash

* test: Refactor assert

* test: Refactor setup wizard test

* test: Remove setup wizard test

* test: Add blank seed database

* test(form): Scroll to top before save

* test: Fix form test

* test: timeout

* test: more wait

* test: Remove specific selector

* test: Remove wait, delay typing

* test: Blur input after typing

* test: Wait for form to get dirty

* test: Add credentials for frappe org

* test: Remove node install step

* style: Fix linting issues

* fix: List view filters

- ToDo: Dont override frappe.route_options if it is already set

* test: Dont reload page before test
2018-12-03 09:07:31 +05:30
Faris Ansari
80f6269429 chore: Exclude 2.7 and postgres test (#6145) 2018-09-27 09:16:23 +05:30
Rushabh Mehta
2e6a202652 Postgres support for Frappe (#5919)
* [start] postgres

* [wip] started refactoring db_schema

* Add psycopg2 to requirements.txt

* Add support for Postgres SQL

- Separate frameworkSQL, database, schema, setup_db file for
mariaDB and postgres
- WIP

* Remove quotes from sql to make it compatible with postgres as well

* Moved some code from db_schema to database.py

* Move code from db_schema to schema.py

Add other required refactoring

* Add schema chages

* Remove redundant code in file

* Add invalid column name exception class to exceptions.py

* Add back tick in query wherever needed and replace ifnull with coalesce

* Update get_column_description code in database.py file

* Remove a print statement

* Add keys to get on_duplicate query

* Add bactick wherever necessary

- Remove db_schema.py file

* Remove DATE_SUB as it is incompatible with postgres

- Fix prepare_filter_condition

* Add backtick and quotes wherever necessary
- Move get_database_size to frappe.db namespace
- fix some left out bugs and errors

* Add code to create key and unique index
- added mysql and posgres in their respective database.py

* Add more bacticks in queries and fix some errors
- Pass keys to on_duplicate_update method
- Replace MONTH with EXTRACT function
- Remove DATEDIFF and CURDATE usage

* Cast state value to int in toggle_two_factor_auth
- since two_factor_auth has the datatype of Int

* Refactor
- Replace Timediff with normal arithmetic operator
- Add MAX_COLUMN_LENGTH
- Remove Redundant code
- Add regexp character constant
- Move create_help_table to database.py
- Add get_full_text_search_condition method
- Inherit MariaDBTable from DBTable

* Replace Database instance with get_db method

* Move db_manager to separate file

* Refactor
- Remove some unwanted code
- Separate alter table code for postgres and mysql
- Replace data_type with column_type in database.py

* Make fulltext search changes in global_search.py

* Add empty string check

* Add root_password to site config

* Create cli command for postgres console

* Move setup of help database to setup_db.py

* Add get_database_list method

* Fix exception handling
- Replace bad_field handler with missing_column handler

* Fix tests and sql queries

* Fix import error

* Fix typo db -> database

* Fix error with make_table in help.py

* Try test for postgres

* Remove pyhton 2.7 version to try postgres travis test

* Add test fixes

* Add db_type to the config of test_site_postgres

* Enable query debug to check the reason for travis fail

* Add backticks to check if the test passes

* Update travis.yml
- Add postgres addon

* Try appending 'd_' to hash for db_name
- since postgres does not support dbname starting with a number

* Try adding db_type for global help to make travis work

* Add print statements to debug travis failure

* Enable transaction and remove debug flag

* Fix help table creation query (postgres)

* Fix import issue

* Add some checks to prevent errors
- Some doctypes used to get called even before they are created

* Try fixes

* Update travis config

* Fix create index for help table

* Remove unused code

* Fix queries and update travis config

* Fix ifnull replace logic (regex)

* Add query fixes and code cleanup

* Fix typo
- get_column_description -> get_table_columns_description

* Fix tests
- Replace double quotes in query with single quote

* Replace psycopg2 with psycopg2-binary to avoid warnings
- http://initd.org/psycopg/docs/install.html#binary-install-from-pypi

* Add multisql api

* Add few multisql queries

* Remove print statements

* Remove get_fulltext_search_condition method and replace with multi query

* Remove text slicing in create user

* Set default for 'values' argument in multisql

* Fix incorrect queries and remove few debug flags
- Fix multisql bug

* Force delete user to fix test
- Fix Import error
- Fix incorrect query

* Fix query builder bug

* Fix bad query

* Fix query (minor)

* Convert boolean text to int since is_private has datatype of int
- Some query changes like removed double quotes
and replace with interpolated string to pass multiple
value pass in one of the query

* Extend database class from an object to support python 2

* Fix query
- Add quotes around value passed to the query for variable comparision

* Try setting host_name for each test site
- To avoid "RemoteDisconnected" error while testing data migration test
- Update travis.yml to add hosts
- Remove unwanted commit in setup_help_database

* Set site hostname to data migration connector (in test file)
- To connect the same site host

* Fix duplicate entry issue
- the problem is in naming series file.
In previous commits I unknowingly changed a part of a series query
due to which series were not getting reset

* Replace few sql queries with orm methods

* Fix codacy

* Fix 'Doctype Sessions not found' issue

* Fix bugs induced during codacy fixes

* Fix Notification Test

- Use ORM instead of raw sql

* Set Date fallback value to 0001-01-01

- 0000-00-00 is invalid date in Postgres
- 0001-01-01 works in both

* Fix date filter method

* Replace double quotes with single quote for literal value

* Remove print statement

* Replace double quotes with single

* Fix tests

- Replace few raw sql with ORM

* Separate query for postgres

- update_fields_to_fetch_query

* Fix tests

- replace locate with strpos for postgres

* Fix tests

- Skip test for datediff
- convert bytes to str in escape method

* Remove TestBot

* Skip fieldname extraction

* Replace docshare raw sql with ORM

* Fix typo

* Fix ancestor query test

* Fix test data migration

* Remove hardcoded hostname

* Add default option and option list for db_type

* Remove frappe.async module

* Remove a debug flag from test

* Fix codacy

* fix import issue

* Convert classmethod to static method

* Convert few instance methods to static methods

* Remove some unused imports

* Fix codacy

- Add exception type
- Replace few instance methods with static methods
- Remove unsued import

* Fix codacy

* Remove unused code

* Remove some unused codes

- Convert some instance methods to static function

* Fix a issue with query modification

* Fix add_index query

* Fix query

* Fix update_auth patch

* Fix a issue with exception handling

* Add try catch to a reload_doc

* Add try-catch to file_manager_hook patch

* import update_gravatar to set_user_gravatar patch

* Undo all the wrong patch fixes

* Fix db_setup code 😪
- previously it was not restoring db from source SQL
which is why few old patched were breaking
(because they were getting different schema structure)

* Fix typo !

* Fix exception(is_missing_column) handling

* Add deleted code
- This code is only used in a erpnext patch.
Can be moved to that patch file

* Fix codacy

* Replace a mariadb specific function in a query used in validate_series

* Remove a debug flag

* Revert changes (rename_parent_and_child)

* Fix validate_one_root method

* Fix date format issue

* Fix codacy
- Disable a pylint for variable argument warning
- Convert an instance method to static method

* Add bandit.yml

The Codacy seems to use Bandit which generates
warning for every subprocess import and its usage during pytest
Since we have carefully used subprocess (avoided user input),
warnings needs to be avoided.
This can be removed if we have any alternative for subprocess usage.

* Skip start_process_with_partial_path check

* Fix typo

* Add python 2.7 test

* Move python versions in travis.yml

* Add python versions to jobs

* Overwrite python version inheritance for postgres in travis.yml

* Add quotes around python version in .travis.yml

* Add quotes around the name of the job

* Try a travis fix

* Try .travis.yml fix

* Import missing subprocess

* Refactor travis.yml

* Refactor travis.yml
- move install and tests commands to separate files
- Use matrix to build combination of python version and db type

* Make install.sh and run-tests.sh executable

* Add sudo required to travis.yml to allow sudo cmmands in shell files

* Load nvm

* Remove verbose flag from scripts

* Remove command-trace-print flag

* Change to build dir in before script

* Add absolute path for scripts

* Fix tests

* Fix typo

* Fix codacy
- fixes - "echo won't expand escape sequences." warning

* Append (_) underscore instead of 'd' for db_name

* Remove printf and use mysql execute flag
2018-09-21 10:20:48 +05:30
Aditya Hase
2073873064 feature(coverage): Add test coverage to frappe travis builds (#6065) 2018-09-10 09:37:23 +05:30
Rushabh Mehta
015a366e5f [fix] .travis.yml 2018-05-28 11:15:07 +05:30
Ameya Shenoy
949ec96fbc
Merge branch 'master' into develop 2018-05-24 08:43:19 +00:00
Ameya Shenoy
188c4c87db [fix] global-setup-help (#5603)
- custom jinja templates are taken if and only if a site is mentioned
- added test in travis as well
2018-05-24 12:05:25 +05:30
Saurabh
da1e6ee789 [fix] merge conflicts 2018-05-02 21:38:06 +05:30
Ameya Shenoy
ab0198b513
dark magic to revive travis
It seems that some process inside travis is using port no 9000. Hence
adding this line in the travis.yml to change common_site_config.json and
use port no 9001 for socket_io
2018-05-02 17:30:35 +05:30
Saurabh
f3a25b3f91 Merge branch 'master' into develop 2018-05-02 14:51:46 +05:30
Ameya Shenoy
b6ec76c2db i still don't know why we're still using travis (#5500) 2018-04-30 11:30:27 +05:30
Saurabh
56b6167c1f [fix] merge conflicts 2018-04-19 11:16:28 +05:30
Rushabh Mehta
e4aa433ea3 [travis] --quiet 2018-04-16 11:25:39 +05:30
Rushabh Mehta
102dd9fea8 [travis] sleep more 2018-04-16 11:04:07 +05:30
Achilles Rasquinha
666f25d673
Python 2 and 3 Compatible 💥 💥 💥 2018-04-01 01:36:46 +05:30
Achilles Rasquinha
e18b6ef190
Update .travis.yml 2018-03-20 10:54:35 +05:30
Achilles Rasquinha
3ed587efea
Removed 3.4 and PyPy3 2018-03-15 12:02:58 +05:30
Achilles Rasquinha
0fe62000b4 added allow_failures 2018-03-13 10:10:29 +05:30
Achilles Rasquinha
b8d4573dc4 remove python 3 since support for openpyxl 2018-03-13 00:35:52 +05:30
Achilles Rasquinha
ae5389c42f used which python 2018-03-13 00:24:33 +05:30
Achilles Rasquinha
59f0717db7 allow failures for python3 2018-03-13 00:13:21 +05:30
Achilles Rasquinha
77e1658705 modified job matrix 2018-03-13 00:10:10 +05:30
Achilles Rasquinha
ed8302f4fa added travis build matrix 2018-03-13 00:07:31 +05:30
Faris Ansari
92e8856588
New Build System: Rollup (#5010)
* JS build working

* Css build working!

* Uglify JS in production

* fix codacy

* Add frappe.commands.popen

* FIx ESLint errors

* Add socket.io to package.json

* ignore subprocess warnings

* Add babel-runtime

* sleep 20 after bench start

* remove set -e

* [FIX] non-shell subprocess call

* [FIX] use shell = False

* split commands
2018-02-20 13:47:48 +05:30
Nabin Hait
428d1d7a6e Fixed merge conflict 2018-01-30 18:18:46 +05:30
Nabin Hait
19e4126175 Removed ui-tests from travis 2018-01-30 15:10:31 +05:30
Nabin Hait
ae950bfff4 Removed ui-tests from travis 2018-01-30 15:02:50 +05:30
Nabin Hait
3ee048e40b Removed ui-tests from travis 2018-01-30 14:57:20 +05:30
Ameya Shenoy
6359e635b8
mogodb removed from travis 2018-01-11 15:19:33 +05:30
Achilles Rasquinha
e5de3b6deb
Chrome Driver Issue 2017-12-07 16:23:59 +05:30
Achilles Rasquinha
b8825ca116 Pure Python MySQL instead mysqlclient (with Python C API) (#4280)
* added PyMYSQL instead mysqlclient-python

* added pymysql import

* fixed db module import

* foxed self._conn wrapper

* updated cursor migration

* removed existent converters

* some more fixes towards API port

* modified travis

* updated doctype and revereted yml

* modified travis

* refreshed logging

* raw fix

* moved from hard coded constants to declarable instances

* moved from hard coded constants to declarable instances

* refactoring and logging

* moved to global import declaration

* fixed codacy

* unfixed codacy

* minor fix

* binary_type has a single

* deprecated alternative

* merged with latest

* fixed merge conflicts

* using deprecated alternative

* raw fix

* stupid fix

* using StringTypes instead

* brutal hack

* log

* tundebazy to the rescue

* fixed content_hash error

* frappe/database.py

* frappe/database.py

* updated database.py

* updated requirements

* updated requirements

* fixed codacy

* fixed codacy

* moved from DatabaseOperationalError to pymysql.InternalError

* moved from DatabaseOperationalError to pymysql.InternalError

* fixed codacy

* empty commit

* fixed codacy

* fixed codacy
2017-11-06 16:42:01 +05:30
Rushabh Mehta
b2a86325eb Update .travis.yml 2017-10-09 17:06:52 +05:30
Achilles Rasquinha
7d44cef80c updated travis (#4281) 2017-10-09 13:07:27 +05:30
Rushabh Mehta
aa370aef36 [tests] less verbose logs 2017-08-10 11:02:36 +05:30
Rushabh Mehta
9214e0f7fc [fix] flake8 verison 2017-07-28 11:35:25 +05:30
Rushabh Mehta
aef98daae4 [add] catch errors flake8 (#3800) 2017-07-27 11:34:44 +05:30
Ameya Shenoy
0a32ad83bf [tests] restructured tests to work with the new testing framework (#3683)
* minor changes and added global_test_search

* stashing the changes

* named assertions, modified test_lib to fit ES6 standard, added global search test

* modified to work with the new testing framework

* renamed files

* increased timeouts

* only calendar and desktop test

* modified travis.yml
2017-07-14 17:34:25 +05:30
Rushabh Mehta
25ad8ef16c Test Runner - Refactored (#3679)
* [tests] test_runner to run one JS test at a time

* [tests] test_runner to run one JS test at a time

* [test] ignore failing tests

* [test] comment test_calendar_view

* [test] add timeout

* [test] add timeout
2017-07-13 15:17:12 +05:30
Rushabh Mehta
2355dafc25 [minor] no scheduler for tests 2017-07-11 10:28:07 +05:30
Rushabh Mehta
b38aff0b89 [minor] remove commented lines in travis.yml 2017-07-11 10:28:07 +05:30
Sagar Vora
d0306a7c26 [ci] remove incorrect docker sources from APT (#3587) 2017-07-03 12:33:33 +05:30
Rushabh Mehta
f409fd7358 [ui-tests] python is back! (#3565)
* [ui-tests] python is back!

* [minor] remove old test

* [test] dont test test_runner

* [tests] try firefox

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome 1

* [tests] try chrome 2

* [tests] try chrome 3

* [tests] try phantomJS

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] login click button

* [tests] login click button

* [tests] show log

* [test] test with start_maximized

* [test] test only login

* [travis] test another port for selenium

* [travis] try running ui tests after unittests are done

* [travis] pring body_div if fails

* [tests] complete setup wizard for frappe

* [minor] move ui tests to frappe/ui/tests

* [tests] ui tests in public and codacy fixes

* [fix] tests + eslint

* [minor] move tests to tests/ui folder and print console after print

* [fix] linting

* [tests] added documentation and better integration testing

* [promise] form triggering is now promise based

* [test]

* [test]

* [test]

* [test]

* [test] print output

* [minor] default empty in select and print console

* [cleanup] more minor fixes

* [enhance] first-cut done!

* [minor] frappe.run_serially to pass arguments while chaining
2017-07-03 11:53:00 +05:30
Sagar Vora
3dbe747292 [ci] use deprecated trusty build for now (#3544) 2017-06-22 17:05:23 +05:30
Faris Ansari
a9cf952505 UI Tests for Frappe (#3500)
* init nightwatch.js

* add nightwatch to travis

typo

nightwatch fix

kill node

launch_url

run tests on local selenium

manually run sc

sc in bg with sleep

minor

minor

run test on chromedriver

simplify travis

minor

add chrome package

implicit chromedriver

nightwatch.global.js

path fix

console statement

enable screenshot

send screenshot to telegram

path

minor

remove chromium

add binary

screenshot

url

cleanup

increase timout

minor

minor

minor

* login test

add page_objects in config

Fix login test

* bench run-ui-tests

* update package.json

* update travis

* bench reinstall before running ui tests
2017-06-19 17:58:45 +05:30
Faris Ansari
b2538bab08 Remove testcafe from travis 2017-06-06 14:28:38 +05:30
Faris Ansari
feb275b2f4 [travis] Install node v7 2017-06-01 12:39:21 +05:30
Faris Ansari
bb88f30aea Fix build js for travis (#3359)
* Fix build.js

* let to var

* Added use_strict flag

* Add new build system requirements

* Fix array includes

* Fix indexof
2017-05-22 12:44:31 +05:30
Sagar Vora
1a63f988c7 [minor] Fail travis build immediately, if python tests fail. (#3269) 2017-05-12 15:20:22 +05:30
Sagar Vora
a397a9e719 [minor] Revert dist to trusty in travis (#3233) 2017-05-06 16:19:50 +05:30