Beispiel #1
0
def create_app(app_dir, publish=False, build_options=None):
    """
    Runs dx-build-app on the specified directory.
    """
    os.chdir(app_dir)
    install_app_depends(app_dir)

    if not build_options:
        build_options = {}

    dx_build_app.build_and_upload_locally('.', mode='app', use_temp_build_project=False, publish=publish, **build_options)
Beispiel #2
0
def create_applet(app_dir, build_options=None):
    """
    Runs dx-build-applet on the specified directory.
    """
    os.chdir(app_dir)
    install_app_depends(app_dir)

    if not build_options:
        build_options = {}

    output = dx_build_app.build_and_upload_locally('.', mode='applet', return_object_dump=True, **build_options)
    return output['id']
 def test_dx_run_app_locally_and_compare_results(self):
     appdir = create_app_dir()
     print("Setting current project to", self.project)
     dxpy.WORKSPACE_ID = self.project
     dxpy.PROJECT_CONTEXT_ID = self.project
     applet_id = dx_build_app.build_and_upload_locally(appdir,
                                                       mode='applet',
                                                       overwrite=True,
                                                       dx_toolkit_autodep=False,
                                                       return_object_dump=True)['id']
     remote_job = dxpy.DXApplet(applet_id).run({"in1": 8})
     print("Waiting for", remote_job, "to complete")
     remote_job.wait_on_done()
     result = remote_job.describe()
     self.assertEqual(result["output"]["out1"], 140)
Beispiel #4
0
 def test_dx_run_app_locally_and_compare_results(self):
     appdir = create_app_dir()
     print("Setting current project to", self.project)
     dxpy.WORKSPACE_ID = self.project
     dxpy.PROJECT_CONTEXT_ID = self.project
     applet_id = dx_build_app.build_and_upload_locally(appdir,
                                                       mode='applet',
                                                       overwrite=True,
                                                       dx_toolkit_autodep=False,
                                                       return_object_dump=True)['id']
     remote_job = dxpy.DXApplet(applet_id).run({"in1": 8})
     print("Waiting for", remote_job, "to complete")
     remote_job.wait_on_done()
     result = remote_job.describe()
     self.assertEqual(result["output"]["out1"], 140)