mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +00:00
fix: return returncode in bench.utils.exec_cmd
tests: update broken install-app case, select branch for erpnext
This commit is contained in:
parent
c30afb0284
commit
1928eaa2c5
@ -14,6 +14,9 @@ from bench.release import get_bumped_version
|
||||
from bench.tests.test_base import TestBenchBase
|
||||
|
||||
|
||||
ERPNEXT_BRANCH = bench.tests.test_base.FRAPPE_BRANCH
|
||||
|
||||
|
||||
class TestBenchInit(TestBenchBase):
|
||||
def test_semantic_version(self):
|
||||
self.assertEqual( get_bumped_version('11.0.4', 'major'), '12.0.0' )
|
||||
@ -109,9 +112,11 @@ class TestBenchInit(TestBenchBase):
|
||||
|
||||
# create and install app on site
|
||||
self.new_site(site_name, bench_name)
|
||||
bench.utils.exec_cmd("bench --site {0} install-app erpnext".format(site_name), cwd=bench_path)
|
||||
installed_erpnext = not bench.utils.exec_cmd("bench --site {0} install-app erpnext --branch {1}".format(site_name, ERPNEXT_BRANCH), cwd=bench_path)
|
||||
|
||||
app_installed_on_site = subprocess.check_output(["bench", "--site", site_name, "list-apps"], cwd=bench_path).decode('utf8')
|
||||
|
||||
if installed_erpnext:
|
||||
self.assertTrue("erpnext" in app_installed_on_site)
|
||||
|
||||
|
||||
|
@ -298,7 +298,7 @@ def exec_cmd(cmd, cwd='.'):
|
||||
import shlex
|
||||
print("{0}$ {1}{2}".format(color.silver, cmd, color.nc))
|
||||
cmd = shlex.split(cmd)
|
||||
subprocess.call(cmd, cwd=cwd, universal_newlines=True)
|
||||
return subprocess.call(cmd, cwd=cwd, universal_newlines=True)
|
||||
|
||||
|
||||
def which(executable, raise_err = False):
|
||||
|
Loading…
Reference in New Issue
Block a user