Пример #1
0
                        '--branch',
                        help="Branch you want to use for preCICE",
                        default="develop")
    parser.add_argument('-d',
                        '--dockerfile',
                        help="Dockerfile used to create preCICE base image",
                        default="Dockerfile.Ubuntu1604.home")
    parser.add_argument(
        '--keep',
        help="Keep containers and docker volumes upon finishing",
        action='store_true')
    parser.add_argument('-s',
                        '--systemtest',
                        nargs='+',
                        help="System tests you want to use",
                        default=common.get_tests(),
                        choices=common.get_tests())

    parser.add_argument('-f',
                        '--force_rebuild',
                        nargs='+',
                        help="Force rebuild of variable parts of docker image",
                        default=[],
                        choices=["precice", "tests"])
    args = parser.parse_args()
    test_names = args.systemtest

    tests = []
    for test_name in test_names:
        tests += get_test_variants(test_name)
    tests = filter_tests(tests, args.dockerfile)
Пример #2
0
    return tag


if __name__ == "__main__":
    # Parsing flags
    parser = argparse.ArgumentParser(description='Build local.')
    parser.add_argument(
        '-l',
        '--local',
        action='store_true',
        help="Use local preCICE image (default: use remote image)")
    parser.add_argument('-s',
                        '--systemtest',
                        type=str,
                        help="Choose system tests you want to use",
                        choices=common.get_tests(),
                        required=True)
    parser.add_argument(
        '-b', '--branch', help="preCICE branch to use", default="develop"
    )  # make sure that branch corresponding to system tests branch is used, if no branch is explicitly specified. If we are testing a pull request, will test against develop by default.
    # Usage of the branch argument:
    #   When on a PR, this will by default use the develop versions of preCICE and adapter images.
    #   This makes it easier to experiment with tests, which are most commonly addressed by PRs
    #   (otherwise you would need to also create preCICE and adapter images for your branch which are only different in name)
    parser.add_argument('-f',
                        '--force_rebuild',
                        nargs='+',
                        help="Force rebuild of variable parts of docker image",
                        default=[],
                        choices=["precice", "tests"])
    parser.add_argument('--base',
Пример #3
0
    base_features = base_dockerfile.split('.')  # put features of base Dockerfile separated by . in a list (e.g. Dockerfile.Ubuntu1604 has feature Ubuntu1604)
    base_features.remove('Dockerfile')  # remove Dockerfile    
    executed_tests = []
    for test in all_tests:        
        if test_is_considered(test, base_features):  # check all tests for compatibility with features of base image (e.g. base image with Ubuntu1604 feature cannot run tests with Ubuntu1804 specialization
            executed_tests.append(test)
    executed_tests = filter_for_most_specialized_tests(executed_tests)
    return list(executed_tests.values())
    

# Parsing flags
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
                                 description='Build local.')
parser.add_argument('-b', '--branch', help="Branch you want to use for preCICE", default = "develop")
parser.add_argument('-d', '--dockerfile', help="Dockerfile used to create preCICE base image", default = "Dockerfile.Ubuntu1604")
parser.add_argument('-s', '--systemtest', nargs='+', help="System tests you want to use", default = common.get_tests(), choices = common.get_tests())
parser.add_argument('-f', '--force_rebuild', nargs='+', help="Force rebuild of variable parts of docker image", default = [], choices  = ["precice", "tests"])
args = parser.parse_args()

if __name__ == "__main__":
    test_names = args.systemtest
    
    tests = []
    for test_name in test_names:
        tests += get_test_variants(test_name)
    tests = filter_tests(tests, args.dockerfile)
   
    # Checking for older docker containers
    lst2 = docker.get_containers()
    if lst2:
        print("Deleting following docker containers:", lst2)