Skip to content

Commit

Permalink
SDK - Tests - Fixed two test failures in hermetic systems (4057)
Browse files Browse the repository at this point in the history
Removed path resolving in two tests.
The `.resolve()` should be harmless, but I've seen these tests fail to work in some unusual strict hermetic systems. The test code file path was resolving to a tree which was different from the parent of the file, so the test could not find the test data.
  • Loading branch information
Ark-kun authored Jun 25, 2020
1 parent 757d43c commit 51b1c74
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sdk/python/kfp/components_tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ def _test_load_component_from_file(self, component_path: str):
self.assertEqual(resolved_cmd.args[1], str(arg2))

def test_load_component_from_yaml_file(self):
_this_file = Path(__file__).resolve()
_this_dir = _this_file.parent
_test_data_dir = _this_dir.joinpath('test_data')
component_path = _test_data_dir.joinpath('python_add.component.yaml')
component_path = Path(__file__).parent / 'test_data' / 'python_add.component.yaml'
self._test_load_component_from_file(str(component_path))

def test_load_component_from_zipped_yaml_file(self):
_this_file = Path(__file__).resolve()
_this_dir = _this_file.parent
_test_data_dir = _this_dir.joinpath('test_data')
component_path = _test_data_dir.joinpath('python_add.component.zip')
component_path = Path(__file__).parent / 'test_data' / 'python_add.component.zip'
self._test_load_component_from_file(str(component_path))

def test_load_component_from_url(self):
Expand Down

0 comments on commit 51b1c74

Please sign in to comment.