Ejemplo n.º 1
0
def test_example_report_statusMany(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    # Check for all entries that should be present
    for C in CS:
        for G in GS:
            for S in SS:
                for B in BS:
                    r = StatusReport(
                        status=('succeeded' if C == 'gnucc' and G == 'ghc844'
                                and S == 'submodules' and B == 'master' else
                                'fixed' if C == 'gnucc' and G == 'ghc865'
                                and S == 'HEADs' and B == 'master' else
                                'succeeded' if C == 'gnucc' and G == 'ghc844'
                                and S == 'HEADs' and B == 'master' else
                                2 if C == 'clang' else 'initial_success'),
                        project='Project #1',
                        strategy=S,
                        branchtype="pullreq"
                        if B.startswith('PR') else "regular",
                        branch=B.split('-')[-1] if B.startswith('PR') else B,
                        buildname='-'.join(['.'.join([B, S]), C, G]),
                        bldvars=[
                            BldVariable(project='Project #1',
                                        varname='ghcver',
                                        varvalue=G),
                            BldVariable(project='Project #1',
                                        varname='c_compiler',
                                        varvalue=C),
                        ],
                        blddesc=(PR_Grouped(B[3:]) if B.startswith('PR-') else
                                 BranchReq('Project #1', B)),
                    )
                    assert r in reps
Ejemplo n.º 2
0
def test_example_report_status3(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    # Check for all entries that should be present
    for C in CS:
        for G in GS:
            S = 'HEADs'
            B = 'PR-blah'  # PR1-PR11-PR111-PR1111-blah
            r = StatusReport(
                status=(2 if C == 'clang' else 'initial_success'),
                project='Project #1',
                strategy=S,
                branchtype="pullreq" if B.startswith('PR') else "regular",
                branch=B.split('-')[-1] if B.startswith('PR') else B,
                buildname='-'.join(['.'.join([B, S]), C, G]),
                bldvars=[
                    BldVariable(project='Project #1',
                                varname='ghcver',
                                varvalue=G),
                    BldVariable(project='Project #1',
                                varname='c_compiler',
                                varvalue=C),
                ],
                blddesc=PR_Grouped(B[3:]) if B.startswith('PR-') else
                (MainBranch('R1', B) if B == 'master' else BranchReq(
                    'Project #1', B)),
            )
            assert r in reps
Ejemplo n.º 3
0
def test_example_report_status4_2(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(status=1,
                        project='Repo1',
                        strategy='standard',
                        branchtype="pullreq",
                        branch="master",
                        buildname='PR2-master.standard-ghc881',
                        bldvars=[
                            BldVariable(project='Repo1',
                                        varname='ghcver',
                                        varvalue='ghc881')
                        ],
                        blddesc=PR_Solo('Repo1', '2')) in reps
Ejemplo n.º 4
0
def test_example_report_status3(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(status=1,
                        project='Repo1',
                        strategy='standard',
                        branchtype="pullreq",
                        branch="foo",
                        buildname='PR-foo.standard-ghc881',
                        bldvars=[
                            BldVariable(project='Repo1',
                                        varname='ghcver',
                                        varvalue='ghc881')
                        ],
                        blddesc=PR_Grouped('foo')) in reps
Ejemplo n.º 5
0
def test_example_report_status8(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(status='initial_success',
                        project='Repo1',
                        strategy='standard',
                        branchtype="regular",
                        branch="master",
                        buildname='master.standard-ghc865',
                        bldvars=[
                            BldVariable(project='Repo1',
                                        varname='ghcver',
                                        varvalue='ghc865')
                        ],
                        blddesc=BranchReq('Repo1', 'master')) in reps
Ejemplo n.º 6
0
def test_example_report_status5(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(status=1,
                        project='Repo1',
                        strategy='standard',
                        branchtype="regular",
                        branch="develop",
                        buildname='develop.standard-ghc881',
                        bldvars=[
                            BldVariable(project='Repo1',
                                        varname='ghcver',
                                        varvalue='ghc881')
                        ],
                        blddesc=BranchReq('Repo1', 'develop')) in reps
Ejemplo n.º 7
0
def test_example_report_status13(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(
        status='bad_config',
        project='Repo1',
        strategy='submodules',
        branchtype="regular",
        branch="develop",
        buildname='develop.submodules-ghc844',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc844')
        ],
        blddesc=BranchReq('Repo1', 'develop'),
    ) in reps
Ejemplo n.º 8
0
def test_example_report_status12(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(
        status=1,
        project='Repo1',
        strategy='submodules',
        branchtype="regular",
        branch="master",
        buildname='master.submodules-ghc881',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc881')
        ],
        blddesc=BranchReq('Repo1', 'master'),
    ) in reps
Ejemplo n.º 9
0
def test_example_report_status1(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    assert StatusReport(
        status='initial_success',
        project='Repo1',
        strategy='HEADs',
        branchtype="regular",
        branch="develop",
        buildname='develop.HEADs-ghc844',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc844')
        ],
        blddesc=BranchReq('Repo1', 'develop'),
    ) in reps
Ejemplo n.º 10
0
def test_example_report_status9(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    # This one had a prior success
    assert StatusReport(
        status=1,
        project='Repo1',
        strategy='HEADs',
        branchtype="regular",
        branch="master",
        buildname='master.HEADs-ghc881',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc881')
        ],
        blddesc=BranchReq('Repo1', 'master'),
    ) in reps
Ejemplo n.º 11
0
def test_example_report_status12(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    for each in reps:
        print(each)
        print('')
    assert StatusReport(status='bad_config',
                        project='Repo1',
                        strategy='standard',
                        branchtype="pullreq",
                        branch="develop",
                        buildname='PR-develop.standard-ghc865',
                        bldvars=[
                            BldVariable(project='Repo1',
                                        varname='ghcver',
                                        varvalue='ghc865')
                        ],
                        blddesc=PR_Grouped('develop')) in reps
Ejemplo n.º 12
0
def test_example_report_status1(example_hydra_results):
    bldcfgs, reps = example_hydra_results
    # Check for a single entry
    assert StatusReport(
        status=2,
        project='Project #1',
        strategy="HEADs",
        branchtype="pullreq",
        branch="blah",
        buildname='PR-blah.HEADs-clang-ghc844',
        bldvars=[
            BldVariable(project='Project #1',
                        varname='ghcver',
                        varvalue='ghc844'),
            BldVariable(project='Project #1',
                        varname='c_compiler',
                        varvalue='clang'),
        ],
        blddesc=PR_Grouped('blah'),
    ) in reps
Ejemplo n.º 13
0
        "name": "PR-dog.standard-ghc881",
        "nrtotal": 4,
        "nrsucceeded": 3,
        "nrfailed": 1,
        "nrscheduled": 0,
        "haserrormsg": False,
    },
]

prior = [
    StatusReport(
        status='initial_success',
        project='Repo1',
        strategy='standard',
        branchtype="pullreq",
        branch="foo",
        buildname='PR-foo.standard-ghc881',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc881')
        ],
        blddesc=PR_Grouped('foo'),
    ),
    StatusReport(
        status='initial_success',
        project='Repo1',
        strategy='standard',
        branchtype="pullreq",
        branch="foo",
        buildname='PR-foo.standard-ghc865',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc865')
        ],
Ejemplo n.º 14
0
        "master.submodules-gnucc-ghc865",
        "master.submodules-clang-ghc881",
        "master.submodules-gnucc-ghc881",
    ]
]

prior = [
    StatusReport(
        status='initial_success',
        project='Project #1',
        strategy="submodules",
        branchtype="regular",
        branch="master",
        buildname='master.submodules-gnucc-ghc844',
        bldvars=[
            BldVariable(project='Project #1',
                        varname='ghcver',
                        varvalue='ghc844'),
            BldVariable(project='Project #1',
                        varname='c_compiler',
                        varvalue='gnucc'),
        ],
        blddesc=BranchReq('Project #1', 'master'),
    ),
    StatusReport(
        status=2,
        project='Project #1',
        strategy="HEADs",
        branchtype="regular",
        branch="master",
        buildname='master.HEADs-gnucc-ghc865',
Ejemplo n.º 15
0
        "name": "master.submodules-ghc881",
        "nrtotal": 4,
        "nrsucceeded": 3,
        "nrfailed": 1,
        "nrscheduled": 0,
        "haserrormsg": False,
    },
]

prior = [
    StatusReport(
        status='initial_success',
        project='Repo1',
        strategy='submodules',
        branchtype="regular",
        branch="master",
        buildname='master.submodules-ghc844',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc844')
        ],
        blddesc=BranchReq('Repo1', 'master'),
    ),
    StatusReport(
        status=1,
        project='Repo1',
        strategy='HEADs',
        branchtype="regular",
        branch="master",
        buildname='master.HEADs-ghc865',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc865')
        ],