Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/helper/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_si
mysql --host 127.0.0.1 --port 3306 -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'" # match site_cofig
mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES"

echo BRANCH_NAME: "${BRANCH_NAME}"
git clone https://github.com/frappe/frappe --branch ${BRANCH_NAME}
if [ "${GITHUB_EVENT_NAME}" = 'pull_request' ]; then
BRANCH_NAME="${GITHUB_BASE_REF}"
else
BRANCH_NAME="${GITHUB_REF_NAME}"
fi
echo "BRANCH_NAME: ${BRANCH_NAME}"

git clone https://github.com/frappe/frappe --branch "${BRANCH_NAME}"
bench init frappe-bench --frappe-path ~/frappe --python "$(which python)" --skip-assets --ignore-exist

mkdir ~/frappe-bench/sites/test_site
Expand All @@ -40,8 +46,8 @@ sed -i 's/schedule:/# schedule:/g' Procfile
sed -i 's/socketio:/# socketio:/g' Procfile
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile

bench get-app erpnext https://github.com/frappe/erpnext --branch ${BRANCH_NAME} --resolve-deps --skip-assets
bench get-app hrms https://github.com/frappe/hrms --branch ${BRANCH_NAME} --skip-assets
bench get-app erpnext https://github.com/frappe/erpnext --branch "${BRANCH_NAME}" --resolve-deps --skip-assets
bench get-app hrms https://github.com/frappe/hrms --branch "${BRANCH_NAME}" --skip-assets
bench get-app check_run "${GITHUB_WORKSPACE}" --skip-assets

printf '%s\n' 'frappe' 'erpnext' 'hrms' 'check_run' > ~/frappe-bench/sites/apps.txt
Expand Down
60 changes: 27 additions & 33 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ name: Pytest CI

on:
push:
branches: [ version-14, version-15 ]
branches:
- version-14
- version-15
pull_request:
branches: [ version-14, version-15 ]
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}

permissions:
contents: write
checks: write
issues: write
pull-requests: write

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
name: Server
runs-on: ubuntu-latest

services:
mysql:
mariadb:
image: mariadb:10.6
env:
MYSQL_ALLOW_EMPTY_PASSWORD: YES
Expand All @@ -29,60 +30,53 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
check-latest: true
cache: 'yarn' # Replaces `Get yarn cache directory path` and `yarn-cache` steps
cache: 'yarn'

- name: Add to Hosts
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts

- name: Cache pip
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install JS Dependencies
run: yarn --prefer-offline

- name: Install App Dependencies
run: bash ${{github.workspace}}/.github/helper/install_dependencies.sh
run: bash ${{ github.workspace }}/.github/helper/install_dependencies.sh

- name: Install Bench Site and Apps
env:
MYSQL_HOST: 'localhost'
MYSQL_PWD: 'admin'
BRANCH_NAME: ${{ env.BRANCH_NAME}}
run: |
bash ${{ github.workspace }}/.github/helper/install.sh
run: bash ${{ github.workspace }}/.github/helper/install.sh

- name: Run Tests
working-directory: /home/runner/frappe-bench
run: |
source env/bin/activate
pytest ./apps/check_run/check_run/tests/ --disable-warnings -s
cd apps/check_run
pytest check_run/tests/ --disable-warnings -s | tee pytest-coverage.txt

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: /home/runner/frappe-bench/apps/check_run/pytest-coverage.txt
junitxml-path: /home/runner/frappe-bench/apps/check_run/coverage.xml
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
additional_dependencies: ['flake8-bugbear']

- repo: https://github.com/agritheory/test_utils
rev: v1.20.0
rev: v1.21.1
hooks:
- id: update_pre_commit_config
- id: validate_frappe_project
Expand Down
236 changes: 236 additions & 0 deletions check_run/check_run/custom/sales_taxes_and_charges.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
{
"custom_fields": [
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": null,
"description": "Computed from Party's Default Payment Terms Template",
"dt": "Sales Taxes and Charges",
"fetch_if_empty": 0,
"fieldname": "due_date",
"fieldtype": "Date",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"idx": 12,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "rate",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Due Date",
"length": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-due_date",
"no_copy": 0,
"non_negative": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": null,
"dt": "Sales Taxes and Charges",
"fetch_if_empty": 0,
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"idx": 16,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "party_type",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Party",
"length": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-party",
"no_copy": 0,
"non_negative": 0,
"options": "party_type",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": null,
"dt": "Sales Taxes and Charges",
"fetch_if_empty": 0,
"fieldname": "column_break_w4usy",
"fieldtype": "Column Break",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"idx": 14,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "due_date",
"is_system_generated": 0,
"is_virtual": 0,
"length": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-column_break_w4usy",
"no_copy": 0,
"non_negative": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": null,
"dt": "Sales Taxes and Charges",
"fetch_if_empty": 0,
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"idx": 15,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "column_break_w4usy",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Party Type",
"length": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-party_type",
"no_copy": 0,
"non_negative": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0
},
{
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": null,
"dt": "Sales Taxes and Charges",
"fetch_if_empty": 0,
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"hidden": 0,
"hide_border": 0,
"hide_days": 0,
"hide_seconds": 0,
"idx": 25,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_preview": 0,
"in_standard_filter": 0,
"insert_after": "base_tax_amount_after_discount_amount",
"is_system_generated": 0,
"is_virtual": 0,
"label": "Outstanding Amount",
"length": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-outstanding_amount",
"no_copy": 0,
"non_negative": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"show_dashboard": 0,
"sort_options": 0,
"translatable": 0,
"unique": 0
}
],
"doctype": "Sales Taxes and Charges",
"property_setters": [
{
"doc_type": "Sales Taxes and Charges",
"doctype_or_field": "DocType",
"idx": 0,
"is_system_generated": 0,
"module": "Check Run",
"name": "Sales Taxes and Charges-main-field_order",
"property": "field_order",
"property_type": "Data",
"value": "[\"charge_type\", \"row_id\", \"account_head\", \"col_break_1\", \"description\", \"included_in_print_rate\", \"included_in_paid_amount\", \"accounting_dimensions_section\", \"cost_center\", \"dimension_col_break\", \"section_break_8\", \"rate\", \"due_date\", \"column_break_w4usy\", \"party_type\", \"party\", \"section_break_9\", \"account_currency\", \"tax_amount\", \"total\", \"tax_amount_after_discount_amount\", \"column_break_13\", \"base_tax_amount\", \"base_total\", \"base_tax_amount_after_discount_amount\", \"outstanding_amount\", \"item_wise_tax_detail\", \"dont_recompute_tax\"]"
}
],
"sync_on_migrate": 1
}
Loading
Loading