2
0
mirror of https://github.com/frappe/bench.git synced 2025-02-13 08:18:27 +00:00

ci: run tests against current hotfix branches (#1402)

- If this isn't dont then we have no way of knowing until frappe/erpnext
  are actually released.
- Skip asset building where it doesn't matter
This commit is contained in:
Ankush Menat 2022-12-12 21:48:38 +05:30 committed by GitHub
parent 7a63f4f461
commit 0234c080c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -15,12 +15,10 @@ from bench.bench import Bench
PYTHON_VER = sys.version_info
FRAPPE_BRANCH = "version-12"
FRAPPE_BRANCH = "version-13-hotfix"
if PYTHON_VER.major == 3:
if PYTHON_VER.minor >= 10:
FRAPPE_BRANCH = "develop"
if 7 >= PYTHON_VER.minor >= 9:
FRAPPE_BRANCH = "version-13"
class TestBenchBase(unittest.TestCase):

View File

@ -46,7 +46,7 @@ class TestBenchInit(TestBenchBase):
def test_multiple_benches(self):
for bench_name in ("test-bench-1", "test-bench-2"):
self.init_bench(bench_name)
self.init_bench(bench_name, skip_assets=True)
self.assert_common_site_config(
"test-bench-1",
@ -96,7 +96,7 @@ class TestBenchInit(TestBenchBase):
self.assertTrue(site_config[key])
def test_get_app(self):
self.init_bench("test-bench")
self.init_bench("test-bench", skip_assets=True)
bench_path = os.path.join(self.benches_path, "test-bench")
exec_cmd(f"bench get-app {TEST_FRAPPE_APP} --skip-assets", cwd=bench_path)
self.assertTrue(os.path.exists(os.path.join(bench_path, "apps", TEST_FRAPPE_APP)))
@ -108,7 +108,7 @@ class TestBenchInit(TestBenchBase):
@unittest.skipIf(FRAPPE_BRANCH != "develop", "only for develop branch")
def test_get_app_resolve_deps(self):
FRAPPE_APP = "healthcare"
self.init_bench("test-bench")
self.init_bench("test-bench", skip_assets=True)
bench_path = os.path.join(self.benches_path, "test-bench")
exec_cmd(f"bench get-app {FRAPPE_APP} --resolve-deps --skip-assets", cwd=bench_path)
self.assertTrue(os.path.exists(os.path.join(bench_path, "apps", FRAPPE_APP)))
@ -126,7 +126,7 @@ class TestBenchInit(TestBenchBase):
site_name = "install-app.test"
bench_path = os.path.join(self.benches_path, "test-bench")
self.init_bench(bench_name)
self.init_bench(bench_name, skip_assets=True)
exec_cmd(
f"bench get-app {TEST_FRAPPE_APP} --branch master --skip-assets", cwd=bench_path
)
@ -154,7 +154,7 @@ class TestBenchInit(TestBenchBase):
self.assertTrue(TEST_FRAPPE_APP in app_installed_on_site)
def test_remove_app(self):
self.init_bench("test-bench")
self.init_bench("test-bench", skip_assets=True)
bench_path = os.path.join(self.benches_path, "test-bench")
exec_cmd(
@ -172,7 +172,7 @@ class TestBenchInit(TestBenchBase):
self.assertFalse(os.path.exists(os.path.join(bench_path, "apps", TEST_FRAPPE_APP)))
def test_switch_to_branch(self):
self.init_bench("test-bench")
self.init_bench("test-bench", skip_assets=True)
bench_path = os.path.join(self.benches_path, "test-bench")
app_path = os.path.join(bench_path, "apps", "frappe")