def processScheduledQARequest(requestId, ibName, arch, buildpath=DEFAULT_BUILDPATH, cmspath=DEFAULT_CMSPATH, tests=DEFAULT_TESTS): cycle = getCycleNameByReleaseName(ibName) os.environ["SCRAM_ARCH"]=arch os.environ["CMSINTBLD_CMS_PATH"]=cmspath tagCollectorAPI.setRequestBuilding(requestId, ibName,machine=socket.gethostname(), pid=os.getpid()) startTest(ibName, cycle, buildpath, tests, arch) tagCollectorAPI.finishRequest(requestId)
def handleUpload(self): userName = self.user print 'uploading logs for user', userName,' id ', self.jobId, 'arch', self.platf self._stamp = self.jobId self.id = self.jobId tc.finishRequest(request_id=self.id, build_errors=0, build_warnings=1, tests_failed=2, tests_passed=3, results_url=None, unit_tests_passed=4, unit_tests_failed=5) return
def processScheduledQARequest(requestId, ibName, arch, buildpath=DEFAULT_BUILDPATH, cmspath=DEFAULT_CMSPATH, tests=DEFAULT_TESTS): cycle = getCycleNameByReleaseName(ibName) os.environ["SCRAM_ARCH"]=arch os.environ["CMSINTBLD_CMS_PATH"]=cmspath tagCollectorAPI.setRequestBuilding(requestId, ibName,machine=socket.gethostname(), pid=os.getpid()) qaStampDir= os.path.join("/afs/cern.ch/cms/sw/ReleaseCandidates",arch,"www/qaTest") qaStampFile = os.path.join(qaStampDir,ibName) if (not os.path.exists(qaStampFile)): os.system("mkdir -p %s; touch %s" % (qaStampDir,qaStampFile)) startTest(ibName, cycle, buildpath, tests, arch) tagCollectorAPI.finishRequest(requestId)
def uploadLogs(self, logDirName, nWarn, nErr, tFail, tPass, utFail, utPass, topURL): self.doDeBuG = True print 'setting status to done' tc.finishRequest(request_id=self.id, build_errors=nErr, build_warnings=nWarn, tests_failed=tFail, tests_passed=tPass, results_url=topURL, unit_tests_passed=utPass, unit_tests_failed=utFail) sys.stdout.flush() sys.stderr.flush()
def processScheduledQARequest(requestId, ibName, arch, buildpath=DEFAULT_BUILDPATH, cmspath=DEFAULT_CMSPATH, tests=DEFAULT_TESTS): cycle = getCycleNameByReleaseName(ibName) os.environ["SCRAM_ARCH"] = arch os.environ["CMSINTBLD_CMS_PATH"] = cmspath tagCollectorAPI.setRequestBuilding(requestId, ibName, machine=socket.gethostname(), pid=os.getpid()) startTest(ibName, cycle, buildpath, tests, arch) tagCollectorAPI.finishRequest(requestId)
def handleUpload(self): userName = self.user print 'uploading logs for user', userName, ' id ', self.jobId, 'arch', self.platf self._stamp = self.jobId self.id = self.jobId tc.finishRequest(request_id=self.id, build_errors=0, build_warnings=1, tests_failed=2, tests_passed=3, results_url=None, unit_tests_passed=4, unit_tests_failed=5) return
def test_build_and_finish_ib(self): ibData = tagCollectorAPI.getIBPendingRequests() self.assertTrue(ibData) tagCollectorAPI.setRequestBuilding( ibData["id"], ibData["release_name"], machine=socket.gethostname(), pid=os.getpid() ) ibBuildingRequests = tagCollectorAPI.getBuildingIBRequests() self.assertTrue(ibBuildingRequests) self.assertEquals(self.release_name, ibBuildingRequests[0]["release_name"]) self.assertEquals(self.architecture_name, ibBuildingRequests[0]["architecture_name"]) self.assertEquals("IB", ibBuildingRequests[0]["type"]) isFinished = tagCollectorAPI.finishRequest(ibBuildingRequests[0]["id"]) self.assertTrue(isFinished)
def test_build_and_finish_qa(self): qaData = tagCollectorAPI.getQAPendingRequests() self.assertTrue(qaData) tagCollectorAPI.setRequestBuilding( qaData["id"], qaData["release_name"], machine=socket.gethostname(), pid=os.getpid() ) qaBuildingRequests = tagCollectorAPI.getBuildingQARequests() self.assertTrue(qaBuildingRequests) self.assertEquals(self.release_name, qaBuildingRequests[0]["release_name"]) self.assertEquals(self.architecture_name, qaBuildingRequests[0]["architecture_name"]) self.assertEquals("QA", qaBuildingRequests[0]["type"]) isFinished = tagCollectorAPI.finishRequest(qaBuildingRequests[0]["id"]) self.assertTrue(isFinished)
def test_build_and_finish_ib(self): ibData = tagCollectorAPI.getIBPendingRequests() self.assertTrue(ibData) tagCollectorAPI.setRequestBuilding(ibData['id'], ibData['release_name'], machine=socket.gethostname(), pid=os.getpid()) ibBuildingRequests = tagCollectorAPI.getBuildingIBRequests() self.assertTrue(ibBuildingRequests) self.assertEquals(self.release_name, ibBuildingRequests[0]['release_name']) self.assertEquals(self.architecture_name, ibBuildingRequests[0]['architecture_name']) self.assertEquals('IB', ibBuildingRequests[0]['type']) isFinished = tagCollectorAPI.finishRequest(ibBuildingRequests[0]['id']) self.assertTrue(isFinished)
def test_build_and_finish_qa(self): qaData = tagCollectorAPI.getQAPendingRequests() self.assertTrue(qaData) tagCollectorAPI.setRequestBuilding(qaData['id'], qaData['release_name'], machine=socket.gethostname(), pid=os.getpid()) qaBuildingRequests = tagCollectorAPI.getBuildingQARequests() self.assertTrue(qaBuildingRequests) self.assertEquals(self.release_name, qaBuildingRequests[0]['release_name']) self.assertEquals(self.architecture_name, qaBuildingRequests[0]['architecture_name']) self.assertEquals('QA', qaBuildingRequests[0]['type']) isFinished = tagCollectorAPI.finishRequest(qaBuildingRequests[0]['id']) self.assertTrue(isFinished)
task_id=task_id)) error, saveLog = getstatusoutput(format("set -e ;\n" "echo '#### Log file for %(task_id)s' >> %(workdir)s/log ;\n" "cat %(workdir)s/log.%(task_id)s >> %(workdir)s/log", workdir=opts.workdir, task_id=task_id)) getstatusoutput("%s/syncLogs.py %s" % (thisPath, opts.workdir)) if not "AUTOIB SUCCESS" in log: tagCollectorAPI.failRequest(request_id=task_id, results_url="http://cmssdt.cern.ch/SDT/tc-ib-logs/%s/log.%s.html" % (socket.gethostname(), task_id)) print log print saveLog sys.exit(1) tagCollectorAPI.finishRequest(request_id=task_id, results_url="http://cmssdt.cern.ch/SDT/tc-ib-logs/%s/log.%s.html" % (socket.gethostname(), task_id)) # Here we are done processing the job. Now schedule continuations. if not "continuations" in payload: sys.exit(0) continuationsSpec = payload["continuations"] or "" continuations = [x for x in continuationsSpec.split(";")] if len(continuations) == 0: sys.exit(0) if len(continuations) != 1: print "WARNING: multiple continuations not supported yet" if opts.debug: print continuations nextTasks = [p.split(":", 1) for p in continuations[0].split(",") if ":" in p]
"cat %(workdir)s/log.%(task_id)s >> %(workdir)s/log", workdir=opts.workdir, task_id=task_id)) getstatusoutput("%s/syncLogs.py %s" % (thisPath, opts.workdir)) if not "AUTOIB SUCCESS" in log: tagCollectorAPI.failRequest( request_id=task_id, results_url="http://cmssdt.cern.ch/SDT/tc-ib-logs/%s/log.%s.html" % (socket.gethostname(), task_id)) print log print saveLog sys.exit(1) tagCollectorAPI.finishRequest( request_id=task_id, results_url="http://cmssdt.cern.ch/SDT/tc-ib-logs/%s/log.%s.html" % (socket.gethostname(), task_id)) # Here we are done processing the job. Now schedule continuations. if not "continuations" in payload: sys.exit(0) continuationsSpec = payload["continuations"] or "" continuations = [x for x in continuationsSpec.split(";")] if len(continuations) == 0: sys.exit(0) if len(continuations) != 1: print "WARNING: multiple continuations not supported yet" if opts.debug: print continuations