Skip to content

Commit

Permalink
Merge pull request #978 from cyli/slow-ci-down
Browse files Browse the repository at this point in the history
Slow CI back down a bit
  • Loading branch information
endophage authored Sep 28, 2016
2 parents 6350e8a + 8aa561f commit 3a944e8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions buildscripts/covertest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def get_pkg_recursive_deps(self, pkg):
package recursive dependencies, as well as the recursive test dependencies for that package.
"""
return self.recursive_pkg_deps[pkg].union(
*[self.recursive_pkg_deps[test_import] for test_import in self.test_imports[pkg]])
*[self.recursive_pkg_deps[test_import] for test_import in self.test_imports.get(pkg, ())])

def run(self, pkgs=(), testopts="", covermode="atomic", debug=False):
"""
Run go test with coverage over the the given packages, with the following given options
"""
pkgs = [pkg for pkg in pkgs if pkg in self.test_imports] or self.test_imports.keys()
pkgs = pkgs or self.test_imports.keys()
pkgs.sort()

cmds = []
Expand All @@ -117,11 +117,13 @@ def run(self, pkgs=(), testopts="", covermode="atomic", debug=False):

for pkg in pkgs:
pkg_deps = self.get_pkg_recursive_deps(pkg)
cmd = ["go", "test"] + testopts.split() + list(self.tag_args) + [
"-covermode", covermode,
"-coverprofile", self.get_coverprofile_filename(pkg),
"-coverpkg", ",".join(pkg_deps),
pkg]
cmd = ["go", "test"] + list(self.tag_args)
if pkg in self.test_imports:
cmd += testopts.split() + [
"-covermode", covermode,
"-coverprofile", self.get_coverprofile_filename(pkg),
"-coverpkg", ",".join(pkg_deps)]
cmd += [pkg]
if debug:
print("\t" + " ".join(cmd))
cmds.append((cmd, pkg_deps))
Expand Down

0 comments on commit 3a944e8

Please # to comment.