chore: Python 3 Tests on Travis (#18012)
chore: Python 3 Tests on Travis
This commit is contained in:
commit
9986155e8e
25
.travis.yml
25
.travis.yml
@ -3,6 +3,11 @@ dist: trusty
|
|||||||
|
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
|
- "3.6"
|
||||||
|
|
||||||
|
env:
|
||||||
|
- TEST_TYPE="Server Side Test"
|
||||||
|
- TEST_TYPE="Patch Test"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- mysql
|
- mysql
|
||||||
@ -39,18 +44,8 @@ before_script:
|
|||||||
- bench start &
|
- bench start &
|
||||||
- sleep 10
|
- sleep 10
|
||||||
|
|
||||||
jobs:
|
script:
|
||||||
include:
|
- bash $TRAVIS_BUILD_DIR/travis/run-tests.sh
|
||||||
- stage: test
|
|
||||||
script:
|
after_script:
|
||||||
- set -e
|
- coveralls -b apps/erpnext -d ../../sites/.coverage
|
||||||
- bench run-tests --app erpnext --coverage
|
|
||||||
after_script:
|
|
||||||
- coveralls -b apps/erpnext -d ../../sites/.coverage
|
|
||||||
env: Server Side Test
|
|
||||||
- # stage
|
|
||||||
script:
|
|
||||||
- wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
|
|
||||||
- bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
|
|
||||||
- bench migrate
|
|
||||||
env: Patch Testing
|
|
||||||
|
|||||||
@ -232,7 +232,7 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
|
|||||||
if len(pricing_rules) > 1:
|
if len(pricing_rules) > 1:
|
||||||
rate_or_discount = list(set([d.rate_or_discount for d in pricing_rules]))
|
rate_or_discount = list(set([d.rate_or_discount for d in pricing_rules]))
|
||||||
if len(rate_or_discount) == 1 and rate_or_discount[0] == "Discount Percentage":
|
if len(rate_or_discount) == 1 and rate_or_discount[0] == "Discount Percentage":
|
||||||
pricing_rules = filter(lambda x: x.for_price_list==args.price_list, pricing_rules) \
|
pricing_rules = list(filter(lambda x: x.for_price_list==args.price_list, pricing_rules)) \
|
||||||
or pricing_rules
|
or pricing_rules
|
||||||
|
|
||||||
if len(pricing_rules) > 1 and not args.for_shopping_cart:
|
if len(pricing_rules) > 1 and not args.for_shopping_cart:
|
||||||
|
|||||||
12
travis/run-tests.sh
Executable file
12
travis/run-tests.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [[ $TEST_TYPE == 'Server Side Test' ]]; then
|
||||||
|
bench run-tests --app erpnext --coverage
|
||||||
|
|
||||||
|
elif [[ $TEST_TYPE == 'Patch Test' ]]; then
|
||||||
|
wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz
|
||||||
|
bench --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz --mariadb-root-password travis
|
||||||
|
bench migrate
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user