Skip to content

Commit

Permalink
Fixing failing SDK test
Browse files Browse the repository at this point in the history
Signed-off-by: ddalvi <ddalvi@redhat.com>
  • Loading branch information
DharmitD committed Oct 11, 2024
1 parent 753a2f1 commit 5881e68
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions sdk/python/kfp/cli/component_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.
"""Tests for `components` command group in KFP CLI."""
import contextlib
import functools
import os
import pathlib
import subprocess
Expand Down Expand Up @@ -579,27 +578,28 @@ def test_existing_dockerfile_can_be_overwritten(self):
COPY . .
'''))

@unittest.skip(
"Skipping this test as it's failing. Refer to https://github.com/kubeflow/pipelines/issues/11038"
)
def test_dockerfile_can_contain_custom_kfp_package(self):
component = _make_component(
func_name='train', target_image='custom-image')
_write_components('components.py', component)
package_dir = os.path.dirname(os.path.dirname(self.current_dir))

# suppresses large stdout from subprocess that builds kfp package
with mock.patch.object(
subprocess,
'run',
new=functools.partial(subprocess.run, capture_output=True)):
result = self.runner.invoke(
self.cli,
[
'build',
str(self._working_dir), f'--kfp-package-path={package_dir}'
],
)
try:
subprocess.run(['python3', 'setup.py', 'bdist_wheel'],
cwd=package_dir,
check=True,
capture_output=True)
except subprocess.CalledProcessError as e:
print(f"Failed to build KFP package: {e.stderr.decode()}")
raise

result = self.runner.invoke(
self.cli,
[
'build',
str(self._working_dir), f'--kfp-package-path={package_dir}'
],
)
self.assertEqual(result.exit_code, 0)
self._docker_client.api.build.assert_called_once()
self.assert_file_exists('Dockerfile')
Expand Down

0 comments on commit 5881e68

Please sign in to comment.