Example #1
0
def cleanup(path=None, exclude=[]):
    """
    route for cleaning up testing files
    """
    exclude += glob.glob('**/*.cpp', recursive=True)
    exclude += glob.glob('**/Makefile', recursive=True)
    exclude += glob.glob('**/*.cu', recursive=True)
    helpers.Cleanup(path, exclude=exclude)
Example #2
0
def cleanup(path=None, exclude=[]):
    files = [
        "coverage.xml", "pyctest_tomopy_rec.py", "pyctest_tomopy_phantom.py",
        "pyctest_tomopy_utils.py"
    ]

    sp.call((sys.executable, os.path.join(os.getcwd(), "setup.py"), "clean"))
    helpers.Cleanup(path, extra=files, exclude=exclude)
Example #3
0
def cleanup(path=None, exclude=[]):
    """
    route for cleaning up testing files
    """
    sp.call((sys.executable, os.path.join(os.getcwd(), "setup.py"), "clean"))
    helpers.RemovePath(os.path.join(os.getcwd(), "tomopy.egg-info"))
    helpers.RemovePath(os.path.join(os.getcwd(), "dist"))
    helpers.RemovePath(os.path.join(os.getcwd(), "MANIFEST"))
    helpers.Cleanup(path, exclude=exclude)
Example #4
0
def run(build_profile, pyctest_args):
    pyctest.MODEL = build_profile["cdash_section"]
    pyctest.BUILD_NAME = build_profile["build_name"]

    # Test Timeout set in build profile, otherwise default to 10 minutes
    test_timeout = build_profile.get("test_timeout", 600)

    _ready_command = ["cp"]
    for cmd in ["configure_command", "build_command", "test_command"]:
        if cmd in build_profile:
            _ready_command.append(os.path.join(_HERE, build_profile[cmd]))
    _ready_command.append(".")
    ready_machine = pyctest.command(_ready_command)

    ready_machine.SetWorkingDirectory(pyctest.BINARY_DIRECTORY)
    ready_machine.SetErrorQuiet(False)
    ready_machine.Execute()
    helpers.Cleanup(pyctest.BINARY_DIRECTORY)

    # Try again a few times if the submission fails...maybe helps the problem
    # with tests completing but not submitting to CDash, I hope?
    # Also increase the time between attempts
    pyctest.SUBMIT_RETRY_COUNT = 3
    pyctest.SUBMIT_RETRY_DELAY = 45

    if "configure_command" in build_profile:
        pyctest.CONFIGURE_COMMAND = " ".join(
            ["bash", os.path.basename(build_profile["configure_command"])]
        )
        if "config_opts" in build_profile:
            # Add options to select BISICLES / CHOMBO versions
            pyctest.CONFIGURE_COMMAND += " {bisicles} {chombo}".format(
                **build_profile["config_opts"]
            )

    if "build_command" in build_profile:
        pyctest.BUILD_COMMAND = " ".join(
            ["bash", os.path.basename(build_profile["build_command"])]
        )

    if "tests" in build_profile:
        # Check links to see where BISICLES and Chombo point to
        if "BISICLES" in pyctest.BUILD_NAME:
            _bis_build = os.readlink(
                f"{build_profile['source_directory']}/BISICLES"
            ).split("_")[-1][:-1]
            _cho_build = os.readlink(
                f"{build_profile['source_directory']}/Chombo"
            ).split("_")[-1][:-1]
            pyctest.BUILD_NAME += f"_B{_bis_build[0].upper()}_C{_cho_build[0].upper()}"
        for test in build_profile["tests"]:
            test_runner = pyctest.test(properties={"TIMEOUT": f"{test_timeout:d}"})

            # Echo tests are comma separated so two arguments are passed to the
            # bash script to avoid bash having to do string processing
            # the test will be in the yaml file as (e.g.: echo,Dome_restart_test)
            # and the test `name` would be echo_Dome_restart_test to match the old style
            # If there's no comma in the test name, the split/re-join doesn't have any effect
            test_runner.SetName("_".join(test.split(",")))

            test_runner.SetCommand(
                [
                    "bash",
                    os.path.basename(build_profile["test_command"]),
                    *test.split(","),
                ]
            )
            test_runner.SetProperty("WORKING_DIRECTORY", pyctest.BINARY_DIRECTORY)
    pyctest.run(pyctest.ARGUMENTS)