Skip to content

Commit

Permalink
Fix FilesystemRunStorage instantiations
Browse files Browse the repository at this point in the history
Summary: The args for `FilesystemRunStorage` were changed, but some instantiations were not updated.

Test Plan: unit

Reviewers: #ft, schrockn

Reviewed By: #ft, schrockn

Differential Revision: https://dagster.phacility.com/D872
  • Loading branch information
helloworld committed Aug 22, 2019
1 parent 22bee0f commit dc2c6e1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python_modules/dagit/dagit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def ui(host, port, sync, log, log_dir, schedule_dir, no_watch=False, **kwargs):
def host_dagit_ui(log, log_dir, schedule_dir, handle, use_sync, host, port):
check.inst_param(handle, 'handle', ExecutionTargetHandle)

pipeline_run_storage = FilesystemRunStorage(log_dir) if log else InMemoryRunStorage()
pipeline_run_storage = FilesystemRunStorage(base_dir=log_dir) if log else InMemoryRunStorage()

if Features.SCHEDULER.is_enabled:
scheduler = SystemCronScheduler(schedule_dir)
Expand Down
2 changes: 1 addition & 1 deletion python_modules/dagster-graphql/dagster_graphql/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def execute_query_from_cli(handle, query, variables=None, log=False, log_dir=Non

query = query.strip('\'" \n\t')

pipeline_run_storage = FilesystemRunStorage(log_dir) if log else InMemoryRunStorage()
pipeline_run_storage = FilesystemRunStorage(base_dir=log_dir) if log else InMemoryRunStorage()

result_dict = execute_query(
handle,
Expand Down
27 changes: 26 additions & 1 deletion python_modules/dagster-graphql/dagster_graphql_tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import os

from click.testing import CliRunner

Expand All @@ -13,7 +14,7 @@
seven,
)
from dagster.utils import script_relative_path

from dagster.seven import mock
from dagster_graphql.cli import ui


Expand Down Expand Up @@ -197,3 +198,27 @@ def test_start_execution_predefined():
assert result_data['data']
except Exception as e:
raise Exception('Failed with {} Exception: {}'.format(result.output, e))


@mock.patch.dict(os.environ, {"DAGSTER_HOME": "~/dagster"})
def test_start_execution_predefined_with_logs():
variables = seven.json.dumps(
{
'executionParams': {
'selector': {'name': 'math'},
'environmentConfigData': {
'solids': {'add_one': {'inputs': {'num': {'value': 123}}}}
},
'mode': 'default',
}
}
)

repo_path = script_relative_path('./repository.yaml')

runner = CliRunner()
result = runner.invoke(
ui, ['-y', repo_path, '-v', variables, '-p', 'startPipelineExecution', '--log']
)

assert result.exit_code == 0

0 comments on commit dc2c6e1

Please sign in to comment.