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
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
cd ~ || exit
|
cd ~ || exit
|
||||||
|
|
||||||
sudo apt-get install redis-server
|
sudo apt-get install redis-server
|
||||||
|
|
||||||
nvm install 10
|
sudo apt install nodejs
|
||||||
|
|
||||||
|
sudo apt install npm
|
||||||
|
|
||||||
pip install frappe-bench
|
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- TYPE: "server"
|
- TYPE: "server"
|
||||||
JOB_NAME: "Server"
|
JOB_NAME: "Server"
|
||||||
|
RUN_COMMAND: cd ~/frappe-bench/ && bench --site test_site run-tests --app erpnext --coverage
|
||||||
- TYPE: "patch"
|
- TYPE: "patch"
|
||||||
JOB_NAME: "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 }}
|
name: ${{ matrix.JOB_NAME }}
|
||||||
|
|
||||||
@ -48,7 +51,6 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache node modules
|
- name: Cache node modules
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
env:
|
env:
|
||||||
@ -60,7 +62,6 @@ jobs:
|
|||||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
${{ runner.os }}-build-
|
${{ runner.os }}-build-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@ -77,7 +78,7 @@ jobs:
|
|||||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: bash ${GITHUB_WORKSPACE}/.github/helper/run_tests.sh
|
run: ${{ matrix.RUN_COMMAND }}
|
||||||
env:
|
env:
|
||||||
TYPE: ${{ matrix.TYPE }}
|
TYPE: ${{ matrix.TYPE }}
|
||||||
|
|
||||||
@ -92,3 +93,4 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_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',
|
make_salary_structure("Test Loan Repayment Salary Structure", "Monthly", employee=applicant, currency='INR',
|
||||||
payroll_period=payroll_period)
|
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 = create_loan(applicant, "Car Loan", 11000, "Repay Over Number of Periods", 20, posting_date=add_months(nowdate(), -1))
|
||||||
loan.repay_from_salary = 1
|
loan.repay_from_salary = 1
|
||||||
loan.submit()
|
loan.submit()
|
||||||
|
Loading…
Reference in New Issue
Block a user