Do the test build before calling test(), not within.
authorCarl Hetherington <cth@carlh.net>
Sun, 11 Oct 2020 22:27:08 +0000 (00:27 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 17 Oct 2020 19:33:57 +0000 (21:33 +0200)
cdist

diff --git a/cdist b/cdist
index 9b89d77bbe4cf6b040a0f5bbf81a309b7846377f..2a88d9470d57fc07e765559c8de30a44f3edc7f2 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -448,10 +448,6 @@ class Target(object):
         """test is the test case to run, or None"""
         tree = globals.trees.get(project, checkout, target)
 
-        if self.build_dependencies:
-            tree.build_dependencies(options)
-        tree.build(options)
-
         tree.add_defaults(options)
         with TreeDirectory(tree):
             if len(inspect.getfullargspec(tree.cscript['test']).args) == 3:
@@ -1288,7 +1284,9 @@ def main():
         target = None
         try:
             target = target_factory(args)
-            target.test(args.project, args.checkout, target, args.test, get_command_line_options(args))
+            options = get_command_line_options(args)
+            target.build(args.project, args.checkout, options)
+            target.test(args.project, args.checkout, target, args.test, options)
         finally:
             if target is not None and not args.keep:
                 target.cleanup()