fix: Github Action not failing when tests fail (#24867)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
This commit is contained in:
parent
ed42afc5e8
commit
46d5431bad
6
.github/helper/install.sh
vendored
6
.github/helper/install.sh
vendored
@ -1,10 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd ~ || exit
|
||||
|
||||
sudo apt-get install redis-server
|
||||
|
||||
nvm install 10
|
||||
sudo apt install nodejs
|
||||
|
||||
sudo apt install npm
|
||||
|
||||
pip install frappe-bench
|
||||
|
||||
|
14
.github/helper/run_tests.sh
vendored
14
.github/helper/run_tests.sh
vendored
@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ~/frappe-bench/ || exit
|
||||
|
||||
|
||||
if [ "$TYPE" == "server" ]; then
|
||||
bench --site test_site run-tests --app erpnext --coverage
|
||||
fi
|
||||
|
||||
if [ "$TYPE" == "patch" ]; then
|
||||
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
|
||||
fi
|
8
.github/workflows/ci-tests.yml
vendored
8
.github/workflows/ci-tests.yml
vendored
@ -10,12 +10,15 @@ jobs:
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- TYPE: "server"
|
||||
JOB_NAME: "Server"
|
||||
RUN_COMMAND: cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --coverage
|
||||
- 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
|
||||
|
||||
name: ${{ matrix.JOB_NAME }}
|
||||
|
||||
@ -48,7 +51,6 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
@ -60,7 +62,6 @@ jobs:
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
@ -77,7 +78,7 @@ jobs:
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
||||
|
||||
- name: Run Tests
|
||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/run_tests.sh
|
||||
run: ${{ matrix.RUN_COMMAND }}
|
||||
env:
|
||||
TYPE: ${{ matrix.TYPE }}
|
||||
|
||||
@ -92,3 +93,4 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
|
||||
|
||||
|
@ -246,7 +246,7 @@ class TestSalarySlip(unittest.TestCase):
|
||||
make_salary_structure("Test Loan Repayment Salary Structure", "Monthly", employee=applicant, currency='INR',
|
||||
payroll_period=payroll_period)
|
||||
|
||||
frappe.db.sql("""delete from `tabLoan""")
|
||||
frappe.db.sql("delete from tabLoan")
|
||||
loan = create_loan(applicant, "Car Loan", 11000, "Repay Over Number of Periods", 20, posting_date=add_months(nowdate(), -1))
|
||||
loan.repay_from_salary = 1
|
||||
loan.submit()
|
||||
|
Loading…
Reference in New Issue
Block a user