Skip to content

Commit

Permalink
feat(CircleCI): tests shall not fail! ✔️
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarvora committed Dec 12, 2018
1 parent b9f750f commit 68538fd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .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
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@
<h2>Frappe Bench</h2>
</div>

[![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.

Expand Down
6 changes: 3 additions & 3 deletions bench/tests/test_init.py
Expand Up @@ -78,8 +78,8 @@ def test_new_site(self):
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"))
Expand Down Expand Up @@ -186,7 +186,7 @@ def drop_site(self, site_name, archived_sites_path=None):
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')
Expand Down

0 comments on commit 68538fd

Please sign in to comment.