Open rw-anderson opened 1 year ago
Maybe a change like:
diff --git a/ats/management.py b/ats/management.py
index 92911ed..055f571 100644
--- a/ats/management.py
+++ b/ats/management.py
@@ -573,7 +573,11 @@ class AtsManager(object):
def testif(self, parent, *clas, **options):
"Create test, to be run only if othertest passed."
testobj = self.test(*clas, **options)
- parent.addDependent(testobj)
+ if isinstance(parent, list):
+ for p in parent:
+ p.addDependent(testobj)
+ else:
+ parent.addDependent(testobj)
return testobj
would enable usage like this:
t1 = test(...)
t2 = test(...)
testif([t1, t2], ...)
etc. without breaking backward compatibility.
Is it possible to have a test that executes only when multiple predecessors have completed (and passed)?
One solution is: t1 = test(...) t2 = testif(t1, ...) t3 = testif(t2, ...)
But this serializes t1 and t2, which may be able to run concurrently.