ci: fix patch test (#37079)
* ci: fix patch test * ci: use v13 DB as starting point for patch * ci: remove payments from patch test * ci: print bench logs after tests * ci: restart bench on each update * ci: patch test v13db > v14 > develop and when v15 is out v13db > v14 > v15 > develop
This commit is contained in:
parent
85ebaa3aed
commit
2f7b3bbfad
2
.github/helper/install.sh
vendored
2
.github/helper/install.sh
vendored
@ -68,6 +68,6 @@ if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi
|
|||||||
|
|
||||||
wait $wkpid
|
wait $wkpid
|
||||||
|
|
||||||
bench start &> bench_run_logs.txt &
|
bench start &>> ~/frappe-bench/bench_start.log &
|
||||||
CI=Yes bench build --app frappe &
|
CI=Yes bench build --app frappe &
|
||||||
bench --site test_site reinstall --yes
|
bench --site test_site reinstall --yes
|
||||||
|
50
.github/workflows/patch.yml
vendored
50
.github/workflows/patch.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mariadb:10.3
|
image: mariadb:10.6
|
||||||
env:
|
env:
|
||||||
MARIADB_ROOT_PASSWORD: 'root'
|
MARIADB_ROOT_PASSWORD: 'root'
|
||||||
ports:
|
ports:
|
||||||
@ -45,9 +45,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: "actions/setup-python@v4"
|
uses: "actions/setup-python@v4"
|
||||||
with:
|
with:
|
||||||
python-version: |
|
python-version: '3.10'
|
||||||
3.7
|
|
||||||
3.10
|
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
@ -102,40 +100,58 @@ jobs:
|
|||||||
- name: Run Patch Tests
|
- name: Run Patch Tests
|
||||||
run: |
|
run: |
|
||||||
cd ~/frappe-bench/
|
cd ~/frappe-bench/
|
||||||
wget https://erpnext.com/files/v10-erpnext.sql.gz
|
bench remove-app payments --force
|
||||||
bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz
|
jq 'del(.install_apps)' ~/frappe-bench/sites/test_site/site_config.json > tmp.json
|
||||||
|
mv tmp.json ~/frappe-bench/sites/test_site/site_config.json
|
||||||
|
|
||||||
|
wget https://erpnext.com/files/v13-erpnext.sql.gz
|
||||||
|
bench --site test_site --force restore ~/frappe-bench/v13-erpnext.sql.gz
|
||||||
|
|
||||||
git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git
|
git -C "apps/frappe" remote set-url upstream https://github.com/frappe/frappe.git
|
||||||
git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git
|
git -C "apps/erpnext" remote set-url upstream https://github.com/frappe/erpnext.git
|
||||||
|
|
||||||
for version in $(seq 12 13)
|
|
||||||
do
|
|
||||||
echo "Updating to v$version"
|
|
||||||
branch_name="version-$version-hotfix"
|
|
||||||
|
|
||||||
|
function update_to_version() {
|
||||||
|
version=$1
|
||||||
|
|
||||||
|
branch_name="version-$version-hotfix"
|
||||||
|
echo "Updating to v$version"
|
||||||
|
|
||||||
|
# Fetch and checkout branches
|
||||||
git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name
|
git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name
|
||||||
git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name
|
git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name
|
||||||
|
|
||||||
git -C "apps/frappe" checkout -q -f $branch_name
|
git -C "apps/frappe" checkout -q -f $branch_name
|
||||||
git -C "apps/erpnext" checkout -q -f $branch_name
|
git -C "apps/erpnext" checkout -q -f $branch_name
|
||||||
|
|
||||||
|
# Resetup env and install apps
|
||||||
|
pgrep honcho | xargs kill
|
||||||
rm -rf ~/frappe-bench/env
|
rm -rf ~/frappe-bench/env
|
||||||
bench setup env --python python3.7
|
bench -v setup env
|
||||||
bench pip install -e ./apps/payments
|
|
||||||
bench pip install -e ./apps/erpnext
|
bench pip install -e ./apps/erpnext
|
||||||
|
bench start &>> ~/frappe-bench/bench_start.log &
|
||||||
|
|
||||||
bench --site test_site migrate
|
bench --site test_site migrate
|
||||||
done
|
}
|
||||||
|
|
||||||
|
update_to_version 14
|
||||||
|
|
||||||
echo "Updating to latest version"
|
echo "Updating to latest version"
|
||||||
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
||||||
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
|
git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"
|
||||||
|
|
||||||
rm -rf ~/frappe-bench/env
|
rm -rf ~/frappe-bench/env
|
||||||
bench -v setup env --python python3.10
|
bench -v setup env
|
||||||
bench pip install -e ./apps/payments
|
|
||||||
bench pip install -e ./apps/erpnext
|
bench pip install -e ./apps/erpnext
|
||||||
|
|
||||||
bench --site test_site migrate
|
bench --site test_site migrate
|
||||||
bench --site test_site install-app payments
|
|
||||||
|
- name: Show bench output
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: |
|
||||||
|
cd ~/frappe-bench
|
||||||
|
cat bench_start.log || true
|
||||||
|
cd logs
|
||||||
|
for f in ./*.log*; do
|
||||||
|
echo "Printing log: $f";
|
||||||
|
cat $f
|
||||||
|
done
|
||||||
|
4
.github/workflows/server-tests-mariadb.yml
vendored
4
.github/workflows/server-tests-mariadb.yml
vendored
@ -123,6 +123,10 @@ jobs:
|
|||||||
CI_BUILD_ID: ${{ github.run_id }}
|
CI_BUILD_ID: ${{ github.run_id }}
|
||||||
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
|
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
|
||||||
|
|
||||||
|
- name: Show bench output
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: cat ~/frappe-bench/bench_start.log || true
|
||||||
|
|
||||||
- name: Upload coverage data
|
- name: Upload coverage data
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user