Example #1
0
    def testRestart(self):
        self.openRmakeRepository()
        jobId = fixtures.addBuiltJob1(self)

        client = self.startRmakeServer()
        helper = self.getRmakeHelper(client.uri)

        restartJobId = self.discardOutput(helper.restartJob, jobId)
        assert (restartJobId != jobId)
        helper.waitForJob(restartJobId)
        job = helper.getJob(jobId)
        restartJob = helper.getJob(restartJobId)
        assert (restartJob.isBuilt())
        assert (set(job.iterTroves().next().getBinaryTroves()) == set(
            restartJob.iterTroves().next().getBinaryTroves()))
        fixtures.updateBuiltJob1(self)
        self.addComponent('simple:source', '1',
                          [('simple.recipe', recipes.simpleRecipe)])
        restartJobId2 = self.discardOutput(helper.restartJob, restartJobId,
                                           ['simple'])
        helper.waitForJob(restartJobId2)
        restartJob2 = helper.getJob(restartJobId2)
        trovesByName = dict((x.getName(), x) for x in restartJob2.iterTroves())
        assert (set(trovesByName) == set(['testcase:source', 'simple:source']))
        assert (set(trovesByName['testcase:source'].getBinaryTroves()) != set(
            restartJob.iterTroves().next().getBinaryTroves()))
Example #2
0
    def testRestart(self):
        self.openRmakeRepository()
        jobId = fixtures.addBuiltJob1(self)

        client = self.startRmakeServer()
        helper = self.getRmakeHelper(client.uri)

        restartJobId = self.discardOutput(helper.restartJob, jobId)
        assert(restartJobId != jobId)
        helper.waitForJob(restartJobId)
        job = helper.getJob(jobId)
        restartJob = helper.getJob(restartJobId)
        assert(restartJob.isBuilt())
        assert(set(job.iterTroves().next().getBinaryTroves()) 
                == set(restartJob.iterTroves().next().getBinaryTroves()))
        fixtures.updateBuiltJob1(self)
        self.addComponent('simple:source', '1', [('simple.recipe',
                                                  recipes.simpleRecipe)])
        restartJobId2 = self.discardOutput(helper.restartJob, restartJobId, 
                                           ['simple'])
        helper.waitForJob(restartJobId2)
        restartJob2 = helper.getJob(restartJobId2)
        trovesByName = dict((x.getName(), x) for x in restartJob2.iterTroves())
        assert(set(trovesByName) == set(['testcase:source', 'simple:source']))
        assert(set(trovesByName['testcase:source'].getBinaryTroves())
                != set(restartJob.iterTroves().next().getBinaryTroves()))
Example #3
0
    def testRestart(self):
        self.openRepository()
        self.openRmakeRepository()
        jobId = fixtures.addBuiltJob1(self)
        db = self.openRmakeDatabase()
        job = db.getJob(jobId)
        logPath = job.troves.values()[0].logPath
        jobContext = [jobId]
        restartJob = self.getRestartJob(job)
        b = builder.Builder(self.rmakeCfg, restartJob, jobContext, db)
        b.initializeBuild()
        trove = restartJob.iterTroves().next()
        assert(trove.isPrebuilt())
        b.build()
        assert(restartJob.isBuilt())
        assert(trove.isBuilt())
        assert(logPath == restartJob.troves.values()[0].logPath)

        # update the source and make sure it needs a rebuild
        fixtures.updateBuiltJob1(self)
        restartJob = self.getRestartJob(job)
        b = builder.Builder(self.rmakeCfg, restartJob, jobContext, db)
        b.initializeBuild()
        trove = restartJob.iterTroves().next()
        assert(not trove.isPrebuilt())
        b.build()
        assert(restartJob.isBuilt())
        assert(trove.isBuilt())
        assert(logPath != restartJob.troves.values()[0].logPath)

        buildReqRun = self.addComponent('buildreq:runtime', '2', ['/buildreq'])
        buildReq = self.addCollection('buildreq', '2', [':runtime'])

        # now update build req - that should start out as prebuilt
        # but in the end it should create new binaries not existing before.
        jobContext = [restartJob.jobId]
        restartJob2 = self.getRestartJob(restartJob)
        b = builder.Builder(self.rmakeCfg, restartJob2, jobContext, db)
        b.initializeBuild()
        trove2 = restartJob2.iterTroves().next()
        assert(trove2.isPrebuilt())
        b.dh.updateBuildableTroves()
        assert(trove2.isBuildable())
Example #4
0
    def testRestart(self):
        self.openRepository()
        self.openRmakeRepository()
        jobId = fixtures.addBuiltJob1(self)
        db = self.openRmakeDatabase()
        job = db.getJob(jobId)
        logPath = job.troves.values()[0].logPath
        jobContext = [jobId]
        restartJob = self.getRestartJob(job)
        b = builder.Builder(self.rmakeCfg, restartJob, jobContext, db)
        b.initializeBuild()
        trove = restartJob.iterTroves().next()
        assert (trove.isPrebuilt())
        b.build()
        assert (restartJob.isBuilt())
        assert (trove.isBuilt())
        assert (logPath == restartJob.troves.values()[0].logPath)

        # update the source and make sure it needs a rebuild
        fixtures.updateBuiltJob1(self)
        restartJob = self.getRestartJob(job)
        b = builder.Builder(self.rmakeCfg, restartJob, jobContext, db)
        b.initializeBuild()
        trove = restartJob.iterTroves().next()
        assert (not trove.isPrebuilt())
        b.build()
        assert (restartJob.isBuilt())
        assert (trove.isBuilt())
        assert (logPath != restartJob.troves.values()[0].logPath)

        buildReqRun = self.addComponent('buildreq:runtime', '2', ['/buildreq'])
        buildReq = self.addCollection('buildreq', '2', [':runtime'])

        # now update build req - that should start out as prebuilt
        # but in the end it should create new binaries not existing before.
        jobContext = [restartJob.jobId]
        restartJob2 = self.getRestartJob(restartJob)
        b = builder.Builder(self.rmakeCfg, restartJob2, jobContext, db)
        b.initializeBuild()
        trove2 = restartJob2.iterTroves().next()
        assert (trove2.isPrebuilt())
        b.dh.updateBuildableTroves()
        assert (trove2.isBuildable())