diff --git a/master/master.cfg b/master/master.cfg index aebc439..fe31b85 100644 --- a/master/master.cfg +++ b/master/master.cfg @@ -9,6 +9,7 @@ from twisted.internet import defer import configparser import pathlib +import re class ReactOSLDAPUserInfoProvider(auth.UserInfoProviderBase): @@ -199,13 +200,28 @@ c['schedulers'].append(schedulers.ForceScheduler( scripts_root = "../../" +testmain_id_regex = re.compile("OK\.\sTest_id\:\s(\d+)") + +def extract_testman_id(rc, stdout, stderr): + m = re.search(stdout) + if m: + return {'testman_id': re.group(1)} + else: + return {'testman_id': None} + bs_git = steps.Git(repourl='https://github.com/reactos/reactos.git', mode='full') bs_clean = steps.ShellCommand(name="clean", command=["bash", scripts_root + "clean"], description=["cleaning"], descriptionDone=["clean"], haltOnFailure=True) bs_prepare_source = steps.ShellCommand(name="prepare_source", command=["bash", scripts_root + "prepare_source", util.WithProperties("%(id:-)s")], description=["preparing source"], descriptionDone=["prepared source"], haltOnFailure=True) bs_bootcd = steps.Compile(name="bootcd", command=["bash", scripts_root + "build_reactos", "bootcd"], warningPattern="^(.*warning[: ].*|.*error[: ].*)", description=["BootCD"], descriptionDone=["BootCD"]) bs_livecd = steps.Compile(name="livecd", command=["bash", scripts_root + "build_reactos", "livecd"], warningPattern="^(.*warning[: ].*|.*error[: ].*)", description=["LiveCD"], descriptionDone=["LiveCD"]) bs_upload_iso = steps.ShellCommand(name="uploadiso", command=["bash", scripts_root + "uploadiso"], description=["uploading"], descriptionDone=["uploaded"]) -bs_submit_results = steps.ShellCommand(name="submit_results", command=["bash", scripts_root + "submit_result", util.WithProperties('%(buildnumber)s'), util.WithProperties('%(reason:-)s'), util.WithProperties('%(id:-)s')], description=["submitting results"], descriptionDone=["submit results"]) +bs_submit_results = steps.SetPropertyFromCommand( + name="submit_results", + command=["bash", scripts_root + "submit_result", util.WithProperties('%(buildnumber)s'), util.WithProperties('%(reason:-)s'), util.WithProperties('%(id:-)s')], + description=["submitting results"], + descriptionDone=["submit results"], + extract_fn=extract_testman_id + ) Build_GCCLin_x86 = util.BuildFactory(); diff --git a/worker/submit_result b/worker/submit_result index 6647288..f2f7f68 100755 --- a/worker/submit_result +++ b/worker/submit_result @@ -26,4 +26,4 @@ fi TESTMAN_OUT=`wget -q -O - "https://reactos.org/testman/webservice/buildbot_aggregator.php?sourceid=$TESTMAN_ID&password=$TESTMAN_PASS&builder=$TESTMAN_BUILDER&platform=0&build=$1&comment=$COMMENT"` echo "$TESTMAN_OUT" -[ "$TESTMAN_OUT" = "OK" ] && exit 0 || exit 1 +[ "$TESTMAN_OUT" =~ ^OK\.\sTest_id\:\s\d+$ ] && exit 0 || exit 1