Skip to content

Commit

Permalink
implemented relaxed test-dependency resolution
Browse files Browse the repository at this point in the history
opt-out with STRICT_TEST_DEPENDS=true
  • Loading branch information
mathias-luedtke committed Jul 6, 2017
1 parent 966a5e2 commit 5a03b2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions industrial_ci/src/deps.py
Expand Up @@ -14,6 +14,8 @@
exit(1)
workspace_src=path.join(workspace, 'src')

strict_test_depends = getenv("STRICT_TEST_DEPENDS","") == "true"

target_pkgs = set(getenv("TARGET_PKGS","").split())

use_mockup = getenv("USE_MOCKUP","")
Expand Down Expand Up @@ -68,7 +70,10 @@ def __init__(self, p=None):
else:
self.build_deps = set(d.name for d in chain(p.build_depends, p.buildtool_depends)) & workspace_pkgs
self.export_deps = set(d.name for d in chain(p.buildtool_export_depends, p.build_export_depends)) & workspace_pkgs
self.test_deps = set(d.name for d in chain(p.test_depends)) & workspace_pkgs
if strict_test_depends:
self.test_deps = set(d.name for d in chain(p.test_depends)) & workspace_pkgs
else:
self.test_deps = set(d.name for d in chain(p.test_depends, p.exec_depends)) & workspace_pkgs
self.exec_deps = set(d.name for d in chain(p.exec_depends)) & workspace_pkgs
self.build_keys = set(d.name for d in chain(p.build_depends, p.buildtool_depends)) # keys needed for build
self.export_keys = set(d.name for d in chain(p.buildtool_export_depends, p.build_export_depends)) # keys needed for transitive build
Expand All @@ -86,7 +91,7 @@ def getAllDeps(self):
return self.build_deps | self.export_deps | self.test_deps | self.exec_deps

# dependencies of workspace packages within workspace
workspace_deps = dict((p.name, Dependencies(p)) for p in known_pkgs.values())
workspace_deps = dict((p.name, Dependencies(p, workspace_pkgs)) for p in known_pkgs.values())

pkgs_blacklisted |= set(p.name for p in known_pkgs.values() if p.is_metapackage()) # ignore non-target metapackages

Expand Down

0 comments on commit 5a03b2b

Please sign in to comment.