autobuild: allow AUTOBUILD_FAIL_IMMEDIATELY=0 (say from a gitlab variable)
authorAndrew Bartlett <abartlet@samba.org>
Fri, 17 Sep 2021 04:43:00 +0000 (16:43 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 21 Sep 2021 23:05:41 +0000 (23:05 +0000)
This allows making a push to do a full test ignoring errors without
needing "HACK!!!" commits on top.

Use like this:

git push -o ci.variable='AUTOBUILD_FAIL_IMMEDIATELY=0'

RN: Samba CI runs can now continue past the first error if AUTOBUILD_FAIL_IMMEDIATELY=0 is set

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14841

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org
Reviewed-by: Noel Power <npower@samba.org>
script/autobuild.py

index e42e2365488d8290ac9e414b0c55c89090379790..f521a2e7d2eb09df1098792e654c1f2b530ce665 100755 (executable)
@@ -166,7 +166,6 @@ def format_option(name, value=None):
 
 def make_test(
         cmd='make testonly',
-        FAIL_IMMEDIATELY=1,
         INJECT_SELFTEST_PREFIX=1,
         TESTS='',
         include_envs=None,
@@ -182,7 +181,13 @@ def make_test(
         TESTS = (TESTS + ' ' + ' '.join(test_options)).strip()
 
     _options = []
-    if FAIL_IMMEDIATELY:
+
+    # Allow getting a full CI with
+    # git push -o ci.variable='AUTOBUILD_FAIL_IMMEDIATELY=0'
+
+    FAIL_IMMEDIATELY = os.getenv("AUTOBUILD_FAIL_IMMEDIATELY", "1")
+
+    if int(FAIL_IMMEDIATELY):
         _options.append('FAIL_IMMEDIATELY=1')
     if TESTS:
         _options.append("TESTS='{}'".format(TESTS))