LLNL / ATS

ATS - Automated Testing System - is an open-source, Python-based tool for automating the running of tests of an application across a broad range of high performance computers.
BSD 3-Clause "New" or "Revised" License
7 stars 5 forks source link

Multiple dependencies? #155

Open rw-anderson opened 1 year ago

rw-anderson commented 1 year ago

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.

rw-anderson commented 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.