ci: Try Parallel tests

This commit is contained in:
Suraj Shetty 2021-05-04 18:36:45 +05:30
parent 04dfaf3b2a
commit 591f3f0bb9
2 changed files with 30 additions and 27 deletions

View File

@ -12,7 +12,7 @@ sudo apt install npm
pip install frappe-bench
git clone https://github.com/frappe/frappe --branch "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" --depth 1
git clone https://github.com/surajshetty3416/frappe --branch "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
mkdir ~/frappe-bench/sites/test_site

View File

@ -13,7 +13,10 @@ jobs:
include:
- TYPE: "server"
JOB_NAME: "Server"
RUN_COMMAND: cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --coverage
RUN_COMMAND: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --with-coverage --ci-build-id $GITHUB_RUN_ID --app erpnext
- TYPE: "server"
JOB_NAME: "Server"
RUN_COMMAND: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --with-coverage --ci-build-id $GITHUB_RUN_ID --app erpnext
- TYPE: "patch"
JOB_NAME: "Patch"
RUN_COMMAND: cd ~/frappe-bench/ && wget http://build.erpnext.com/20171108_190013_955977f8_database.sql.gz && bench --site test_site --force restore ~/frappe-bench/20171108_190013_955977f8_database.sql.gz && bench --site test_site migrate
@ -80,29 +83,29 @@ jobs:
env:
TYPE: ${{ matrix.TYPE }}
- name: Coverage - Pull Request
if: matrix.TYPE == 'server' && github.event_name == 'pull_request'
run: |
cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}
pip install coveralls==2.2.0
pip install coverage==4.5.4
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_SERVICE_NAME: github
- name: Coverage - Push
if: matrix.TYPE == 'server' && github.event_name == 'push'
run: |
cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}
pip install coveralls==2.2.0
pip install coverage==4.5.4
coveralls --service=github-actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERALLS_SERVICE_NAME: github-actions
# - name: Coverage - Pull Request
# if: matrix.TYPE == 'server' && github.event_name == 'pull_request'
# run: |
# cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
# cd ${GITHUB_WORKSPACE}
# pip install coveralls==2.2.0
# pip install coverage==4.5.4
# coveralls --service=github
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
# COVERALLS_SERVICE_NAME: github
# - name: Coverage - Push
# if: matrix.TYPE == 'server' && github.event_name == 'push'
# run: |
# cp ~/frappe-bench/sites/.coverage ${GITHUB_WORKSPACE}
# cd ${GITHUB_WORKSPACE}
# pip install coveralls==2.2.0
# pip install coverage==4.5.4
# coveralls --service=github-actions
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
# COVERALLS_SERVICE_NAME: github-actions