def test_job_launch_only_selects_job(): job_kwargs = { "workspace": None, "pipeline_or_job": "my_job", "python_file": file_relative_path(__file__, "repo_pipeline_and_job.py"), "module_name": None, "attribute": "my_repo", } pipeline_kwargs = job_kwargs.copy() pipeline_kwargs["pipeline_or_job"] = "my_pipeline" with default_cli_test_instance() as instance: execute_launch_command( instance, job_kwargs, using_job_op_graph_apis=True, ) with pytest.raises(Exception, match="not found in repository"): execute_launch_command(instance, pipeline_kwargs, using_job_op_graph_apis=True)
def job_launch_command(**kwargs): with DagsterInstance.get() as instance: return execute_launch_command(instance, kwargs)
def run_launch(kwargs, instance, expected_count=None): run = execute_launch_command(instance, kwargs) assert run if expected_count: assert instance.get_runs_count() == expected_count instance.run_launcher.join()