예제 #1
0
def test_fireworks_server_example():
    """Make sure the Fireworks example works as intended"""

    testing.check_active_mongo_server()

    kwargs = {"dump_stdout": True}

    with testing.preserve_cwd():
        os.chdir(os.path.join(_pwd, "fireworks_dataset"))
        server_args = [
            "qcfractal-server", "qca_fw_testing", "--fireworks-manager"
        ]
        with testing.popen(server_args, **kwargs) as server:
            time.sleep(5)  # Boot up server

            assert testing.run_process(["python", "build_database.py"],
                                       **kwargs)
            assert testing.run_process(["python", "compute_database.py"],
                                       **kwargs)

            time.sleep(3)  # Ensure tasks are pushed to QueueManager
            assert testing.run_process(
                ["rlaunch", "-l", "fw_lpad.yaml", "rapidfire"], **kwargs)

            time.sleep(3)  # Ensure all tasks are gathered
            assert testing.run_process(["python", "query_database.py"],
                                       **kwargs)
예제 #2
0
def active_server(request):
    port = str(testing.find_open_port())
    args = ["qcfractal-server", "mydb", "--port=" + port]
    with testing.popen(args, **_options) as server:
        time.sleep(2)

        server.test_uri_cli = "--fractal-uri=localhost:" + port
        yield server
예제 #3
0
def active_server(request, qcfractal_base_init):
    port = str(testing.find_open_port())
    args = ["qcfractal-server", "start", qcfractal_base_init, f"--port={port}"]
    assert testing.run_process(args, interupt_after=10, **_options)
    with testing.popen(args, **_options) as server:
        time.sleep(2)

        server.test_uri_cli = "--fractal-uri=localhost:" + port
        yield server
예제 #4
0
def test_parsl_server_example():
    """Make sure the Parsl example works as intended"""

    testing.check_active_mongo_server()

    kwargs = {"dump_stdout": True}

    with testing.preserve_cwd():
        os.chdir(os.path.join(_pwd, "parsl_torsiondrive"))
        server_args = ["qcfractal-server", "qca_parsl_testing"]
        with testing.popen(server_args, **kwargs) as server:
            time.sleep(5)  # Boot up server

            manager_args = ["python", "parsl_manager.py"]
            with testing.popen(manager_args, **kwargs) as manager:

                assert testing.run_process(["python", "compute_torsion.py"],
                                           **kwargs)
                assert wait_true(40, testing.run_process,
                                 ["python", "query_torsion.py"], **kwargs)
예제 #5
0
def test_local_server_example():
    """Make sure the Fireworks example works as intended"""

    testing.check_active_mongo_server()

    kwargs = {"dump_stdout": True}

    with testing.preserve_cwd():
        os.chdir(os.path.join(_pwd, "local_dataset"))
        server_args = ["qcfractal-server", "qca_local_testing", "--local-manager"]
        with testing.popen(server_args, **kwargs) as server:
            time.sleep(5)  # Boot up server

            assert testing.run_process(["python", "build_database.py"], **kwargs)
            assert testing.run_process(["python", "compute_database.py"], **kwargs)

            assert wait_true(40, testing.run_process, ["python", "query_database.py"], **kwargs)