def test_single_internal_master(generated_bldconfigs): expected = BldConfig( "TheRepo", "regular", "master", "standard", MainBranch("TheRepo", "master"), [ BldRepoRev("TheRepo", "master", "project_primary"), ], []) assert expected in generated_bldconfigs.cfg_build_configs
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
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
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
def test_example_internal_pr101r3_prReq8r1_standard(generated_bldconfigs): for each in [ BldConfig(projectname="Repo1", branchtype="pullreq", branchname="dog", strategy="standard", description=PR_Grouped("dog"), blds=[ BldRepoRev("Repo1", "dog", "Req8"), BldRepoRev("Repo2", "master", "project_primary"), BldRepoRev("Repo3", "dog", "101"), ], bldvars=[BldVariable("Repo1", "ghcver", G)]) for G in GS ]: assert each in generated_bldconfigs.cfg_build_configs
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
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
def test_example_internal_bugfix9_pullreq_HEADs(generated_bldconfigs): for each in [ BldConfig(projectname="R10", branchtype="pullreq", branchname="bugfix9", strategy="HEADs", description=PR_Grouped("bugfix9"), blds=[ BldRepoRev("R10", "master", "project_primary"), BldRepoRev("R3", "master", "project_primary"), BldRepoRev("R4", "bugfix9", "8192"), ], bldvars=[BldVariable("R10", "ghcver", G)]) for G in GS ]: assert each in generated_bldconfigs.cfg_build_configs
def test_example_internal_bugfix9_pullreq_HEADs(generated_bldconfigs): for each in [ BldConfig("Project #1", "pullreq", "bugfix9", "HEADs", PR_Grouped("bugfix9"), [ BldRepoRev("R1", "master", "project_primary"), BldRepoRev("R2", "bugfix9", "23"), BldRepoRev("R3", "master", "project_primary"), BldRepoRev("R5", "bugfix9", "project_primary"), BldRepoRev("R6", "master", "project_primary"), BldRepoRev("R4", "bugfix9", "8192"), ], [ 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
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
def test_example_internal_master_regular_submodules(generated_bldconfigs): for each in [ BldConfig(projectname="R10", branchtype="regular", branchname="master", strategy="submodules", description=MainBranch("R10", "master"), blds=[ BldRepoRev("R10", "master", "project_primary"), BldRepoRev("R3", "r3_master_head^9", "project_primary"), BldRepoRev("R4", "r4_master_head^1", "project_primary"), ], bldvars=[BldVariable("R10", "ghcver", G)]) for G in GS ]: assert each in generated_bldconfigs.cfg_build_configs
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
def test_example_internal_devtest_pullreq_submods(generated_bldconfigs): for each in [ BldConfig(projectname="R10", branchtype="pullreq", branchname="devtest", strategy="submodules", description=PR_Grouped("devtest"), blds=[ BldRepoRev("R10", "devtest", "321"), BldRepoRev("R3", "r3_master_head^7", "project_primary"), BldRepoRev("R4", "r4_master_head^11", "project_primary"), ], bldvars=[BldVariable("R10", "ghcver", G)]) for G in GS ]: assert each in generated_bldconfigs.cfg_build_configs
def test_example_internal_blah_pullreq_HEADs(generated_bldconfigs): # See note for the submodules strategy test. for each in [ BldConfig("Project #1", "pullreq", "blah", "HEADs", PR_Grouped("blah"), [ BldRepoRev("R1", "blah", "1", "ignored"), BldRepoRev("R2", "blah", "1111", 9999), BldRepoRev("R3", "blah", "11"), BldRepoRev("R5", "blah", "project_primary"), BldRepoRev("R6", "blah", "111"), BldRepoRev("R7", "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
def test_example_internal_pr9r3_standard(generated_bldconfigs): for each in generated_bldconfigs.cfg_build_configs: print(each) print('') for each in [ BldConfig(projectname="Repo1", branchtype="pullreq", branchname="master", strategy="standard", description=PR_Solo("Repo3", "9"), blds=[ BldRepoRev("Repo1", "master", "project_primary"), BldRepoRev("Repo2", "master", "project_primary"), BldRepoRev("Repo3", "master", "9"), ], bldvars=[BldVariable("Repo1", "ghcver", G)]) for G in GS ]: assert each in generated_bldconfigs.cfg_build_configs
def test_example_internal_blah_pullreq_submods(generated_bldconfigs): # Note that R1 has a pullreq for the blah branch, and this pullreq # has submodule specifications that are respected for the # "submodules" strategy, therefore the blah PR's for R2 and R3 are # ignored. They will be used for the "heads" strategy though. for each in [ BldConfig( "Project #1", "pullreq", "blah", "submodules", PR_Grouped("blah"), [ BldRepoRev("R1", "blah", "1", "X"), BldRepoRev("R2", "r2_master_head^22", "project_primary"), BldRepoRev("R3", "r3_master_head", "project_primary"), BldRepoRev("R5", "blah", "project_primary"), BldRepoRev("R6", "blah", "111"), BldRepoRev("R7", "r7_master_head^4", "project_primary", "Y"), ], [ 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
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
def test_single_internal_frog(generated_bldconfigs): expected = BldConfig("TheRepo", "pullreq", "frog", "standard", PR_Grouped("frog"), [ BldRepoRev("TheRepo", "frog", "91"), ], []) assert expected in generated_bldconfigs.cfg_build_configs