Пример #1
0
    def test_dynamic8_clean(self):
        #         """ Re-execution creates more jobs.  """
        mockup8(self.cc)
        # run it
        TestDynamic8.define_other = True
        self.assert_cmd_success('make recurse=1')
        # we have three jobs defined
        self.assertJobsEqual('all', ['fd', 'fd-always', 'fd-other'])
        # clean and remake fd
        TestDynamic8.define_other = False

        self.assertJobsEqual('done', ['fd', 'fd-always', 'fd-other'])
        self.assertEqualSet(jobs_defined('fd', self.db),
                            ['fd-always', 'fd-other'])

        self.assertEqualSet(definition_closure(['fd'], self.db),
                            ['fd-always', 'fd-other'])
        direct = direct_uptodate_deps_inverse('fd', self.db)
        self.assertEqualSet(direct, ['fd-always', 'fd-other'])
        direct_closure = direct_uptodate_deps_inverse_closure('fd', self.db)
        self.assertEqualSet(direct_closure, ['fd-always', 'fd-other'])

        self.assert_cmd_success('clean fd')
        # clean should get rid of the jobs
        self.assertJobsEqual('all', ['fd'])
        self.assert_cmd_success('make fd')
        # now the "other" job should disappear
        self.assertJobsEqual('all', ['fd', 'fd-always'])
Пример #2
0
    def job_failed(self, job_id, deleted_jobs):
        """ The specified job has failed. Update the structures,
            mark any parent as failed as well. """
        self.log('job_failed', job_id=job_id, deleted_jobs=deleted_jobs)
        self.check_invariants()
        assert job_id in self.processing

        for _ in deleted_jobs:
            self.job_is_deleted(_)

        self.failed.add(job_id)
        self.processing.remove(job_id)
        del self.processing2result[job_id]

        self.check_invariants()

        publish(self.context, 'manager-job-failed', job_id=job_id)

        # TODO: more efficient query
        # parent_jobs = set(parents(job_id, db=self.db))
        from compmake.jobs.uptodate import direct_uptodate_deps_inverse_closure
        parent_jobs = direct_uptodate_deps_inverse_closure(job_id, db=self.db)

        parents_todo = set(self.todo & parent_jobs)
        for p in parents_todo:
            mark_as_blocked(p, job_id, db=self.db)
            self.todo.remove(p)
            self.blocked.add(p)

        self.publish_progress()
        self.check_invariants()
Пример #3
0
    def test_dynamic8_clean(self):
#         """ Re-execution creates more jobs.  """ 
        mockup8(self.cc)
        # run it
        TestDynamic8.define_other = True
        self.assert_cmd_success('make recurse=1')
        # we have three jobs defined
        self.assertJobsEqual('all', ['fd', 'fd-always', 'fd-other'])
        # clean and remake fd
        TestDynamic8.define_other = False
                
        self.assertJobsEqual('done', ['fd', 'fd-always', 'fd-other'])
        self.assertEqualSet(jobs_defined('fd', self.db),                              ['fd-always', 'fd-other'])
        
        
        self.assertEqualSet(definition_closure(['fd'], self.db), ['fd-always', 'fd-other'])
        direct = direct_uptodate_deps_inverse('fd', self.db)
        self.assertEqualSet(direct, ['fd-always', 'fd-other'])
        direct_closure = direct_uptodate_deps_inverse_closure('fd', self.db)
        self.assertEqualSet(direct_closure, ['fd-always', 'fd-other'])
        
        self.assert_cmd_success('clean fd')
        # clean should get rid of the jobs
        self.assertJobsEqual('all', ['fd'])
        self.assert_cmd_success('make fd')
        # now the "other" job should disappear
        self.assertJobsEqual('all', ['fd', 'fd-always'])
Пример #4
0
    def job_failed(self, job_id, deleted_jobs):
        """ The specified job has failed. Update the structures,
            mark any parent as failed as well. """
        self.log('job_failed', job_id=job_id, deleted_jobs=deleted_jobs)
        self.check_invariants()
        assert job_id in self.processing

        for _ in deleted_jobs:
            self.job_is_deleted(_)

        self.failed.add(job_id)
        self.processing.remove(job_id)
        del self.processing2result[job_id]

        self.check_invariants()

        publish(self.context, 'manager-job-failed', job_id=job_id)

        # TODO: more efficient query
        # parent_jobs = set(parents(job_id, db=self.db))
        from compmake.jobs.uptodate import direct_uptodate_deps_inverse_closure
        parent_jobs = direct_uptodate_deps_inverse_closure(job_id, db=self.db)

        parents_todo = set(self.todo & parent_jobs)
        for p in parents_todo:
            mark_as_blocked(p, job_id, db=self.db)
            self.todo.remove(p)
            self.blocked.add(p)

        self.publish_progress()
        self.check_invariants()