コード例 #1
0
ファイル: structured.py プロジェクト: light5551/dt-core
def get_test_db():
    results = {
        "analyzer": {
            "log1": {
                "value2": 1,
                "composite": {
                    "a": 2,
                    "b": {
                        "c": 3
                    }
                },
            }
        }
    }
    current = ResultDBEntry(regression_test_name="",
                            date="",
                            host="",
                            cpu="",
                            user="",
                            results=results,
                            branch="",
                            commit="")

    rdb = ResultDB(current=current, entries=[])
    return rdb
コード例 #2
0
def get_test_db():
    results = {'analyzer': {
    'log1': {
        'value2': 1,
        'composite': {'a':2, 'b':{'c':3}},
    }}}
    current = ResultDBEntry(regression_test_name='',
                            date='',
                           host='',
                           cpu='',
                           user='',
                           results=results,
                           branch='',
                           commit='')

    rdb = ResultDB(current=current, entries=[])
    return rdb
コード例 #3
0
ファイル: evaluation.py プロジェクト: light5551/dt-core
def get_test_db():
    results = {"analyzer": {"log1": {"value2": 2, "value3": 3, "changed": 98, "same": 10,}}}
    current = ResultDBEntry(
        regression_test_name="", date="", host="", cpu="", user="", results=results, branch="", commit=""
    )
    results_old = {"analyzer": {"log1": {"value2": 2, "value3": 3, "same": 10, "changed": 100,}}}
    old = ResultDBEntry(
        regression_test_name="",
        date=parse_date_spec("2017-01-01"),
        host="",
        cpu="",
        user="",
        results=results_old,
        branch="",
        commit="commit-id",
    )
    rdb = ResultDB(current=current, entries=[old])
    return rdb
コード例 #4
0
ファイル: checking.py プロジェクト: light5551/dt-core
def compute_check_results(rt_name, rt, results_all):
    current = make_entry(rt_name, results_all)

    algo_db = get_easy_algo_db()
    entries_names = algo_db.query("rdbe", f"parameters:regression_test_name:{rt_name}")
    dtu.logger.info(f"entries: {list(entries_names)}")
    entries = []
    for name in entries_names:
        e = algo_db.create_instance("rdbe", name)
        entries.append(e)

    rdb = ResultDB(current=current, entries=entries)

    res = []
    for cwc in rt.get_checks():
        for check in cwc.checks:
            r = check.check(rdb)
            assert isinstance(r, CheckResult)
            res.append(r)
    return res
コード例 #5
0
def compute_check_results(rt_name, rt, results_all):
    current = make_entry(rt_name, results_all)
    
    algo_db = get_easy_algo_db()
    entries_names = algo_db.query('rdbe', 'parameters:regression_test_name:%s'%rt_name)
    print('entries: %s' % list(entries_names))
    entries = []
    for name in entries_names:
        e = algo_db.create_instance('rdbe', name)
        entries.append(e)
    
    rdb = ResultDB(current=current, entries=entries)
    
    res = []
    for cwc in rt.get_checks():
        for check in cwc.checks:
            r = check.check(rdb)
            assert isinstance(r, CheckResult)
            res.append(r)
    return res
コード例 #6
0
ファイル: evaluation.py プロジェクト: yuanjun5681/Software
def get_test_db():
    results = {
        'analyzer': {
            'log1': {
                'value2': 2,
                'value3': 3,
                'changed': 98,
                'same': 10,
            }
        }
    }
    current = ResultDBEntry(regression_test_name='',
                            date='',
                            host='',
                            cpu='',
                            user='',
                            results=results,
                            branch='',
                            commit='')
    results_old = {
        'analyzer': {
            'log1': {
                'value2': 2,
                'value3': 3,
                'same': 10,
                'changed': 100,
            }
        }
    }
    old = ResultDBEntry(regression_test_name='',
                        date=parse_date_spec('2017-01-01'),
                        host='',
                        cpu='',
                        user='',
                        results=results_old,
                        branch='',
                        commit='commit-id')
    rdb = ResultDB(current=current, entries=[old])
    return rdb