Interpret pipeline libraries relative to spec#368
Interpret pipeline libraries relative to spec#368mukulmurthy merged 3 commits intodatabricks:masterfrom
Conversation
|
@mukulmurthy please take a look |
| runner = CliRunner() | ||
| runner.invoke(cli.deploy_cli, [path]) | ||
| assert pipelines_api_mock.create.call_args_list[0][0][1] is False | ||
| assert pipelines_api_mock.create.call_args_list[0][0][2] is False |
There was a problem hiding this comment.
What are these changes?
There was a problem hiding this comment.
These test that the allow_duplicate_names parameter of create and deploy is set correctly. Because I added a new parameter spec_dir, this shifts by one from position 1 to 2.
| spec['libraries'] = [] | ||
|
|
||
| pipelines_api.create(spec, allow_duplicate_names=False) | ||
| pipelines_api.create(spec, spec_dir='.', allow_duplicate_names=False) |
There was a problem hiding this comment.
If all these tests assume that the spec dir is the same as the current dir, would any of them actually fail even without the code changes?
There was a problem hiding this comment.
these tests use a spec without libraries, so it makes no difference to them.
There was a problem hiding this comment.
So which one's the test that would fail without the prod code changes?
There was a problem hiding this comment.
| expected_data['allow_duplicate_names'] = allow_duplicate_names | ||
|
|
||
| api_method(spec, allow_duplicate_names) | ||
| api_method(spec, tmpdir.strpath, allow_duplicate_names) |
There was a problem hiding this comment.
it's not obvious, but api_method is either create or deploy. So this is the test that would actually fail.
There was a problem hiding this comment.
Ah, didn't realize that you switched the spec to use a relative path to itself rather than to the cwd.
The library paths in a pipeline spec should be interpreted as relative to the spec's location, and not relative to the current working directory.