diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 48337cee64..d1a97f87ff 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -68,6 +68,6 @@ if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi wait $wkpid -bench start &> bench_run_logs.txt & +bench start &>> ~/frappe-bench/bench_start.log & CI=Yes bench build --app frappe & bench --site test_site reinstall --yes diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index aae2928bf0..a633414fb9 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -23,7 +23,7 @@ jobs: services: mysql: - image: mariadb:10.3 + image: mariadb:10.6 env: MARIADB_ROOT_PASSWORD: 'root' ports: @@ -45,9 +45,7 @@ jobs: - name: Setup Python uses: "actions/setup-python@v4" with: - python-version: | - 3.7 - 3.10 + python-version: '3.10' - name: Setup Node uses: actions/setup-node@v2 @@ -102,40 +100,58 @@ jobs: - name: Run Patch Tests run: | cd ~/frappe-bench/ - wget https://erpnext.com/files/v10-erpnext.sql.gz - bench --site test_site --force restore ~/frappe-bench/v10-erpnext.sql.gz + bench remove-app payments --force + 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/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" - git -C "apps/frappe" fetch --depth 1 upstream $branch_name:$branch_name - git -C "apps/erpnext" fetch --depth 1 upstream $branch_name:$branch_name + function update_to_version() { + version=$1 - git -C "apps/frappe" checkout -q -f $branch_name - git -C "apps/erpnext" checkout -q -f $branch_name + branch_name="version-$version-hotfix" + echo "Updating to v$version" - rm -rf ~/frappe-bench/env - bench setup env --python python3.7 - bench pip install -e ./apps/payments - bench pip install -e ./apps/erpnext + # Fetch and checkout branches + 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/frappe" checkout -q -f $branch_name + git -C "apps/erpnext" checkout -q -f $branch_name - bench --site test_site migrate - done + # Resetup env and install apps + pgrep honcho | xargs kill + rm -rf ~/frappe-bench/env + bench -v setup env + bench pip install -e ./apps/erpnext + bench start &>> ~/frappe-bench/bench_start.log & + bench --site test_site migrate + } + + update_to_version 14 echo "Updating to latest version" git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA" rm -rf ~/frappe-bench/env - bench -v setup env --python python3.10 - bench pip install -e ./apps/payments + bench -v setup env bench pip install -e ./apps/erpnext 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 diff --git a/.github/workflows/server-tests-mariadb.yml b/.github/workflows/server-tests-mariadb.yml index 2ce1125456..559be06993 100644 --- a/.github/workflows/server-tests-mariadb.yml +++ b/.github/workflows/server-tests-mariadb.yml @@ -123,6 +123,10 @@ jobs: CI_BUILD_ID: ${{ github.run_id }} 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 uses: actions/upload-artifact@v3 with: