Skip to content

Commit

Permalink
updated travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmdnk committed Nov 15, 2016
1 parent 3b487e8 commit 8893046
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,12 @@ script:
- coverage run --parallel-mode $exe brew cask rm appcleaner
- command brew cask install appcleaner
- coverage run --parallel-mode $exe brew cask rm appcleaner
- coverage run --parallel-mode $exe brew install brew-pip
- coverage run --parallel-mode $exe brew pip -h
- coverage run --parallel-mode $exe brew pip pep8
- coverage run --parallel-mode $exe brew list
- coverage run --parallel-mode $exe brew uninstall --ignore-dependencies pip-pep8
- coverage run --parallel-mode $exe brew pip -u -v django==1.2 >/dev/null
- coverage run --parallel-mode $exe brew rm brew-pip
- coverage run --parallel-mode $exe brew install brew-gem
- coverage run --parallel-mode $exe brew gem install heroku
# - coverage run --parallel-mode $exe brew gem uninstall heroku
- coverage run --parallel-mode $exe brew uninstall --ignore-dependencies gem-heroku
Expand Down Expand Up @@ -164,14 +162,14 @@ script:
- export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=/opt/homebrew-cask/Caskroom"
- coverage run --parallel-mode $exe casklist -V 0
# Wrong file/command tests
- 'coverage run --parallel-mode $exe -f BrewfileWrong pull -y -V 0 || :'
- 'coverage run --parallel-mode $exe -f BrewfileWrong pull -y -V 2 || :'
- 'coverage run --parallel-mode $exe -f BrewfileWrong --no_appstore install -y -V 0 || :'
- 'coverage run --parallel-mode $exe wrongcommand || :'
# Wrong command test (test proc)
- echo 'ls wrong_file' > $brewfile
- 'coverage run --parallel-mode $exe install --no_appstore || :'
# Use test repository
- coverage run --parallel-mode $exe set_repo -r git://github.com/$testrepo -y -V 2
- coverage run --parallel-mode $exe set_repo -r git://github.com/$testrepo -b ~/backup.brewfile -y -V 2
- rm -rf $brewfile $testrepofulldir
- echo $TRAVIS_PULL_REQUEST
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ];then coverage run --parallel-mode $exe set_repo -r [email protected]:$testrepo -y -V 2; fi'
Expand Down
26 changes: 13 additions & 13 deletions bin/brew-file
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def to_bool(val):
return True
else:
return False
else:
else: # pragma: no cover
return False


Expand Down Expand Up @@ -164,7 +164,7 @@ class BrewHelper:
if line == '':
if code is not None:
break
else:
else: # pragma: no cover
continue
yield line

Expand Down Expand Up @@ -510,7 +510,7 @@ class BrewInfo:
"""get install options from brew info"""

# Get options for build
if type(package_info) != dict:
if type(package_info) != dict: # pragma: no cover
import json
package_info = json.loads(self.helper.proc(
"brew info --json=v1 " + package,
Expand Down Expand Up @@ -781,9 +781,9 @@ class BrewFile:
if cask_opts["--caskroom"] != "":
self.opt["caskroom"] = cask_opts["--caskroom"]
else:
if not os.path.isdir(
self.brew_val("prefix") + "/Caskroom") and\
os.path.isdir("/opt/homebrew-cask/Caskroom"):
if not os.path.isdir(self.brew_val("prefix") + "/Caskroom") and\
os.path.isdir(
"/opt/homebrew-cask/Caskroom"): # pragma: no cover
self.opt["caskroom"] = "/opt/homebrew-cask/Caskroom"
else:
self.opt["caskroom"] =\
Expand All @@ -804,7 +804,7 @@ class BrewFile:
os.environ.get("HOMEBREW_BREWFILE_APPSTORE", True))

gem_opts = self.parse_env_opts("HOMEBREW_GEM_OPTS")
if "--homebrew-ruby" in gem_opts:
if "--homebrew-ruby" in gem_opts: # pragma: no cover
self.opt["homebrew_ruby"] = True

self.int_opts = ["verbose"]
Expand Down Expand Up @@ -850,7 +850,7 @@ class BrewFile:

for k in self.int_opts:
self.opt[k] = int(self.opt[k])
for k in self.float_opts:
for k in self.float_opts: # pragma: no cover
self.opt[k] = float(self.opt[k])

self.brewinfo.set_file(self.opt["input"])
Expand Down Expand Up @@ -1466,7 +1466,7 @@ class BrewFile:
self.opt["mas_cmd_installed"] = True

is_tmux = os.environ.get("TMUX", "")
if is_tmux != "":
if is_tmux != "": # pragma: no cover
if self.proc("type reattach-to-user-namespace",
False, False, False)[0] != 0:
if not force:
Expand Down Expand Up @@ -1507,7 +1507,7 @@ class BrewFile:
self.opt["is_pip_cmd"] = True
return True
self.info(self.opt["pip_pack"] + " has not been installed.")
if not force:
if not force: # pragma: no cover
ans = self.ask_yn("Do you want to install %s?" %
self.opt["pip_pack"])
if not ans: # pragma: no cover
Expand Down Expand Up @@ -1570,7 +1570,7 @@ class BrewFile:
apps = sorted(lines, key=lambda x: x.split()[1:])
if len(apps) > 0 and apps[0] == "No installed apps found":
apps = []
elif ret:
elif ret: # pragma: no cover
import glob
apps_tmp = []
for d in self.opt["appdirlist"]:
Expand Down Expand Up @@ -1659,7 +1659,7 @@ class BrewFile:
for p in self.get_cask_list()[1]:
if len(p.split()) == 1:
self.brewinfo.cask_list.append(p)
else:
else: # pragma: no cover
self.warning("The cask file of " + p +
" doesn't exist.", 0)
self.warning("Please check later.\n\n", 0)
Expand Down Expand Up @@ -2080,7 +2080,7 @@ class BrewFile:
continue
(ret, lines) = self.proc("brew install " + p +
self.get("brew_input_opt")[p])
if ret != 0:
if ret != 0: # pragma: no cover
self.warning("Can not install " + p + "."
"Please check the package name.\n"
"" + p + " may be installed "
Expand Down

0 comments on commit 8893046

Please sign in to comment.