예제 #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
예제 #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
예제 #3
0
def test_single_internal_dev(generated_bldconfigs):
    # The VCS info indicates there is no "dev" branch for TheRepo, so
    # this build configuration should not exist.
    expected = BldConfig(
        "TheRepo", "regular", "dev", "standard", BranchReq("TheRepo", "dev"), [
            BldRepoRev("TheRepo", "master", "project_primary"),
        ], [])
    assert expected not in generated_bldconfigs.cfg_build_configs
예제 #4
0
def test_example_internal_regular_master_HEADs(generated_bldconfigs):
    for each in [
            BldConfig("Repo1", "regular", "master", "HEADs",
                      BranchReq("Repo1", "master"), [
                          BldRepoRev("Repo1", "master", "project_primary"),
                          BldRepoRev("Repo2", "master", "project_primary"),
                          BldRepoRev("Repo3", "master", "project_primary"),
                          BldRepoRev("Repo4", "master", "project_primary"),
                      ], [
                          BldVariable("Repo1", "ghcver", G),
                      ]) for G in GS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #5
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
예제 #6
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
예제 #7
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
예제 #8
0
def test_example_internal_regular_develop_submodules(generated_bldconfigs):
    for each in [
            BldConfig(
                "Repo1", "regular", "develop", "submodules",
                BranchReq("Repo1", "develop"), [
                    BldRepoRev("Repo1", "develop", "project_primary"),
                    BldRepoRev("Repo2", "r2_develop_head", "project_primary"),
                    BldRepoRev("Repo3", "r3_develop_head", "project_primary"),
                    BldRepoRev("Repo4", "r4_master_head", "project_primary"),
                ], [
                    BldVariable("Repo1", "ghcver", G),
                ]) for G in GS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #9
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
예제 #10
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
예제 #11
0
def test_example_internal_regular_develop_standard(generated_bldconfigs):
    for each in [
            BldConfig(projectname="Repo1",
                      branchtype="regular",
                      branchname="develop",
                      strategy="standard",
                      description=BranchReq("Repo1", "develop"),
                      blds=[
                          BldRepoRev("Repo1", "develop", "project_primary"),
                          BldRepoRev("Repo2", "develop", "project_primary"),
                          BldRepoRev("Repo3", "develop", "project_primary"),
                      ],
                      bldvars=[BldVariable("Repo1", "ghcver", G)]) for G in GS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #12
0
def test_example_internal_dev_regular_HEADs(generated_bldconfigs):
    for each in [
            BldConfig(projectname="R10",
                      branchtype="regular",
                      branchname="dev",
                      strategy="HEADs",
                      description=BranchReq("R10", "dev"),
                      blds=[
                          BldRepoRev("R10", "master", "project_primary"),
                          BldRepoRev("R3", "master", "project_primary"),
                          BldRepoRev("R4", "master", "project_primary"),
                      ],
                      bldvars=[BldVariable("R10", "ghcver", G)]) for G in GS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #13
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
예제 #14
0
def test_example_internal_dev_regular_HEADs(generated_bldconfigs):
    for each in [
            BldConfig("Project #1", "regular", "dev", "HEADs",
                      BranchReq("Project #1", "dev"), [
                          BldRepoRev("R1", "master", "project_primary"),
                          BldRepoRev("R2", "master", "project_primary"),
                          BldRepoRev("R3", "master", "project_primary"),
                          BldRepoRev("R5", "dev", "project_primary"),
                          BldRepoRev("R6", "master", "project_primary"),
                          BldRepoRev("R4", "master", "project_primary"),
                      ], [
                          BldVariable("Project #1", "ghcver", G),
                          BldVariable("Project #1", "c_compiler", C),
                      ]) for G in GS for C in CS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #15
0
def test_example_internal_master_regular_submodules(generated_bldconfigs):
    for each in [
            BldConfig(
                "Project #1", "regular", "master", "submodules",
                BranchReq("Project #1", "master"), [
                    BldRepoRev("R1", "master", "project_primary"),
                    BldRepoRev("R2", "r2_master_head", "project_primary"),
                    BldRepoRev("R3", "r3_master_head^3", "project_primary"),
                    BldRepoRev("R5", "master", "project_primary"),
                    BldRepoRev("R6", "master", "project_primary"),
                    BldRepoRev("R4", "r4_master_head^1", "project_primary"),
                ], [
                    BldVariable("Project #1", "ghcver", G),
                    BldVariable("Project #1", "c_compiler", C),
                ]) for G in GS for C in CS
    ]:
        assert each in generated_bldconfigs.cfg_build_configs
예제 #16
0
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc865')
        ],
        blddesc=PR_Solo('master', '1'),
    ),
    StatusReport(
        status='succeeded',
        project='Repo1',
        strategy='standard',
        branchtype="regular",
        branch="master",
        buildname='master.standard-ghc881',
        bldvars=[
            BldVariable(project='Repo1', varname='ghcver', varvalue='ghc881')
        ],
        blddesc=BranchReq('Repo1', 'master'),
    ),
]


@pytest.fixture(scope="module")
def example_hydra_results(generate_hydra_results):
    return generate_hydra_results(build_results=build_results, prior=prior)


analysis_time_budget = timedelta(seconds=1, milliseconds=500)  # avg 1.03s

GS = ["ghc865", "ghc881"]
top_level = [
    "regular develop standard",
    "regular master standard",
예제 #17
0
def test_single_internal_feat1(generated_bldconfigs):
    expected = BldConfig("TheRepo", "regular", "feat1", "standard",
                         BranchReq("TheRepo", "feat1"), [
                             BldRepoRev("TheRepo", "feat1", "project_primary"),
                         ], [])
    assert expected in generated_bldconfigs.cfg_build_configs
예제 #18
0
 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',
     bldvars=[
         BldVariable(project='Project #1',
                     varname='ghcver',
                     varvalue='ghc865'),
         BldVariable(project='Project #1',
                     varname='c_compiler',
                     varvalue='gnucc'),