test: run patch test to last release and PR

In the patch test, instead of migrating to the current SHA directly.
Migrate to the latest release (with code at the time of release) and
then migrate to last commit in PR.

Why? When directly migrating, the previous patches that would've run
with old code have access to the new code and it's not realistic. This
change brings it a little bit closer to reality. Hence missing failures
that would occur with IRL installations.
This commit is contained in:
Ankush Menat 2021-09-18 16:01:20 +05:30
parent 33aa4c2372
commit b140bb3f43
No known key found for this signature in database
GPG key ID: 8EA82E09BBD13AAF

View file

@ -102,4 +102,13 @@ jobs:
cd ~/frappe-bench/
wget https://frappeframework.com/files/v10-frappe.sql.gz
bench --site test_site --force restore ~/frappe-bench/v10-frappe.sql.gz
cd apps/frappe && git remote set-url upstream https://github.com/frappe/frappe.git && git fetch --all --tags
git tag --sort version:refname \
| grep -v "beta" \
| tail -1 \
| xargs -L 1 git checkout -f
bench setup requirements --python
bench --site test_site migrate --skip-search-index
git checkout -f "$GITHUB_SHA"
bench setup requirements --python
bench --site test_site migrate