def test_setup_production(self):
        self.test_multiple_benches()

        user = getpass.getuser()

        for bench_name in ("test-bench-1", "test-bench-2"):
            bench_path = os.path.join(os.path.abspath(self.benches_path),
                                      bench_name)
            setup_production(user, bench_path)
            self.assert_nginx_config(bench_name)
            self.assert_supervisor_config(bench_name)

        # test after start of both benches
        for bench_name in ("test-bench-1", "test-bench-2"):
            self.assert_supervisor_process(bench_name)

        self.assert_nginx_process()

        # sudoers
        bench.utils.setup_sudoers(user)
        self.assert_sudoers(user)

        for bench_name in ("test-bench-1", "test-bench-2"):
            bench_path = os.path.join(os.path.abspath(self.benches_path),
                                      bench_name)
            disable_production(bench_path)
	def test_disable_production(self):
		bench_name = 'test-disable-prod'
		self.test_init(bench_name, frappe_branch='master')

		user = getpass.getuser()

		bench_path = os.path.join(os.path.abspath(self.benches_path), bench_name)
		setup_production(user, bench_path)

		disable_production(bench_path)

		self.assert_nginx_link(bench_name)
		self.assert_supervisor_link(bench_name)
		self.assert_supervisor_process(bench_name=bench_name, disable_production=True)
    def test_disable_production(self):
        bench_name = 'test-disable-prod'
        self.test_init(bench_name, frappe_branch='master')

        user = getpass.getuser()

        bench_path = os.path.join(os.path.abspath(self.benches_path),
                                  bench_name)
        setup_production(user, bench_path)

        disable_production(bench_path)

        self.assert_nginx_link(bench_name)
        self.assert_supervisor_link(bench_name)
        self.assert_supervisor_process(bench_name=bench_name,
                                       disable_production=True)
	def test_setup_production_v6(self):
		bench_name = 'test-bench-v6'
		self.test_init(bench_name, frappe_branch='master')

		user = getpass.getuser()

		bench_path = os.path.join(os.path.abspath(self.benches_path), bench_name)
		setup_production(user, bench_path)

		self.assert_nginx_config(bench_name)
		self.assert_nginx_process()

		self.assert_supervisor_config(bench_name, use_rq=False)
		self.assert_supervisor_process(bench_name, use_rq=False)

		disable_production(bench_path)
Beispiel #5
0
    def test_setup_production_v6(self):
        bench_name = 'test-bench-v6'
        self.test_init(bench_name, frappe_branch='v6.x.x')

        user = getpass.getuser()

        bench_path = os.path.join(os.path.abspath(self.benches_path),
                                  bench_name)
        setup_production(user, bench_path)

        self.assert_nginx_config(bench_name)
        self.assert_nginx_process()

        self.assert_supervisor_config(bench_name, use_rq=False)
        self.assert_supervisor_process(bench_name, use_rq=False)

        disable_production(bench_path)
	def test_setup_production(self):
		self.test_multiple_benches()

		user = getpass.getuser()

		for bench_name in ("test-bench-1", "test-bench-2"):
			bench_path = os.path.join(os.path.abspath(self.benches_path), bench_name)
			setup_production(user, bench_path)
			self.assert_nginx_config(bench_name)
			self.assert_supervisor_config(bench_name)

		# test after start of both benches
		for bench_name in ("test-bench-1", "test-bench-2"):
			self.assert_supervisor_process(bench_name)

		self.assert_nginx_process()

		# sudoers
		bench.utils.setup_sudoers(user)
		self.assert_sudoers(user)

		for bench_name in ("test-bench-1", "test-bench-2"):
			bench_path = os.path.join(os.path.abspath(self.benches_path), bench_name)
			disable_production(bench_path)
Beispiel #7
0
def disable_production():
    """Disables production environment for the bench."""
    from bench.config.production_setup import disable_production
    disable_production(bench_path='.')
Beispiel #8
0
def disable_production():
	"""Disables production environment for the bench."""
	from bench.config.production_setup import disable_production
	disable_production(bench_path='.')
Beispiel #9
0
def disable_production():
    from bench.config.production_setup import disable_production
    disable_production(bench_path='.')