From 68538fd78c73c2946ae5f70cf10fd1b56ed6c625 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Wed, 12 Dec 2018 15:20:04 +0530 Subject: [PATCH] =?UTF-8?q?feat(CircleCI):=20tests=20shall=20not=20fail!?= =?UTF-8?q?=20=E2=9C=94=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 2 +- bench/tests/test_init.py | 6 +++--- 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..c067e4ef --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,32 @@ +version: 2 +jobs: + build: + machine: true + working_directory: ~/repo + steps: + - checkout + - run: + name: Setup + command: | + sudo pip install --ignore-installed setuptools + sudo pip install urllib3 pyOpenSSL ndg-httpsclient pyasn1 + sudo cp -r ~/.ssh/* /root/.ssh + mkdir -p ~/.bench + mkdir -p /tmp/.bench + cp -r ~/repo/* ~/.bench + cp -r ~/repo/* /tmp/.bench + + - run: + name: Install Bench (Production) + command: sudo python ~/repo/playbooks/install.py --user travis --run-travis --production + + - run: + name: Setup Tests + command: | + cd ~ + sudo pip install --upgrade pip + sudo pip install -e ~/.bench + + - run: + name: Run Tests + command: sudo -E python -m unittest -v bench.tests.test_setup_production diff --git a/README.md b/README.md index b2021747..124a4ae1 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Frappe Bench

-[![Build Status](https://travis-ci.org/frappe/bench.svg?branch=master)](https://travis-ci.org/frappe/bench) +[![Build Status](https://circleci.com/gh/frappe/bench.svg?style=svg)](https://circleci.com/gh/frappe/bench) The bench is a command-line utility that helps you to install apps, manage multiple sites and update Frappe / ERPNext apps on */nix (CentOS, Debian, Ubuntu, etc) for development and production. Bench will also create nginx and supervisor config files, setup backups and much more. diff --git a/bench/tests/test_init.py b/bench/tests/test_init.py index 0920bf63..170ccf17 100755 --- a/bench/tests/test_init.py +++ b/bench/tests/test_init.py @@ -78,8 +78,8 @@ class TestBenchInit(unittest.TestCase): def new_site(self, site_name): new_site_cmd = ["bench", "new-site", site_name, "--admin-password", "admin"] - # set in travis - if os.environ.get("TRAVIS"): + # set in CI + if os.environ.get('CI'): new_site_cmd.extend(["--mariadb-root-password", "travis"]) subprocess.check_output(new_site_cmd, cwd=os.path.join(self.benches_path, "test-bench")) @@ -186,7 +186,7 @@ class TestBenchInit(unittest.TestCase): if archived_sites_path: drop_site_cmd.extend(['--archived-sites-path', archived_sites_path]) - if os.environ.get('TRAVIS'): + if os.environ.get('CI'): drop_site_cmd.extend(['--root-password', 'travis']) bench_path = os.path.join(self.benches_path, 'test-bench')