コード例 #1
0
ファイル: testrun.py プロジェクト: erichuanggit/Nitrate
def testrun_progress_handler(sender, *args, **kwargs):
    ''' Sending the progress of current TestRun '''

    tcr = kwargs['instance']
    tr = tcr.run
    if not kwargs.get('created'):
        # testrun is progress
        run_info = {
            "plan_id": tr.plan_id,
            "run_id": tr.run_id,
            "errata_id": tr.errata_id,
            "when": datetime.now().strftime("%Y-%m-%d %X"),
        }

        if not tr.check_all_case_runs():
            # testrun is progress
            completed_percent = str(tr.completed_case_run_percent) + "%"
            run_info["completed_percent"] = completed_percent
            try:
                p().send(run_info, "testrun.progress", False)
            except:
                pass

        else:
            # testrun is finished
            try:
                p().send(run_info, "testrun.finished", False)
            except:
                pass
    else:
        # FIXME: log, plugin and other editing functions
        pass
コード例 #2
0
ファイル: testrun.py プロジェクト: erichuanggit/Nitrate
def testrun_progress_handler(sender, *args, **kwargs):
    ''' Sending the progress of current TestRun '''

    tcr = kwargs['instance']
    tr = tcr.run
    if not kwargs.get('created'):
        # testrun is progress
        run_info = {
            "plan_id": tr.plan_id,
            "run_id": tr.run_id,
            "errata_id": tr.errata_id,
            "when": datetime.now().strftime("%Y-%m-%d %X"),
        }

        if not tr.check_all_case_runs():
            # testrun is progress
            completed_percent =  str(tr.completed_case_run_percent) + "%"
            run_info["completed_percent"] = completed_percent
            try:
                p().send(run_info, "testrun.progress", False)
            except:
                pass

        else:
            # testrun is finished 
            try:
                p().send(run_info, "testrun.finished", False)
            except:
                pass
    else:
        # FIXME: log, plugin and other editing functions
        pass
コード例 #3
0
ファイル: testrun.py プロジェクト: erichuanggit/Nitrate
def testrun_created_handler(sender, *args, **kwargs):
    ''' Sending current TestRun newly created '''

    tr = kwargs['instance']
    if kwargs.get('created'):
        run_create_info = {
            "plan_id": tr.plan_id,
            "run_id": tr.run_id,
            "errata_id": tr.errata_id,
            "when": datetime.now().strftime("%Y-%m-%d %X")
        }
        try:
            p().send(run_create_info, "testrun.created", False)
        except:
            pass

    else:
        # FIXME: Log, Plugin and other editing functions
        pass
コード例 #4
0
ファイル: testrun.py プロジェクト: erichuanggit/Nitrate
def testrun_created_handler(sender, *args, **kwargs):
    ''' Sending current TestRun newly created '''

    tr = kwargs['instance']
    if kwargs.get('created'):
        run_create_info = {
            "plan_id": tr.plan_id,
            "run_id": tr.run_id,
            "errata_id": tr.errata_id,
            "when": datetime.now().strftime("%Y-%m-%d %X")
        }
        try:
            p().send(run_create_info, "testrun.created", False)
        except:
            pass

    else:
        # FIXME: Log, Plugin and other editing functions
        pass
コード例 #5
0
ファイル: bugs.py プロジェクト: zhangqiusheng/Nitrate
def bug_added_handler(sender, *args, **kwargs):
    tcr_bug = kwargs['instance']
    if tcr_bug.case_run:
        # signal is raise by testcaserun
        tr = tcr_bug.case_run.run
    else:
        # signal is raise by testcase
        return
    if tr.errata_id:
        qpid_bug_add = {
            "run_id": tr.run_id,
            "errata_id": tr.errata_id,
            "bug_id": tcr_bug.bug_id,
            "when": datetime.now().strftime("%Y-%m-%d %X"),
        }
        # qpid message send
        try:
            p().send(qpid_bug_add, "bugs.added", False)
        except:
            pass
    else:
        # FIXME
        pass