Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-mccarthy committed Aug 22, 2023
1 parent a35e113 commit d0027c8
Show file tree
Hide file tree
Showing 49 changed files with 703 additions and 563 deletions.
10 changes: 5 additions & 5 deletions sdk/python/kfp/dsl/component_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_with_no_user_packages_to_install(self):

self.assertEqual(command, [
'sh', '-c',
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
])

def test_with_no_user_packages_to_install_and_install_kfp_false(self):
Expand All @@ -58,7 +58,7 @@ def test_with_no_user_packages_to_install_and_kfp_package_path(self):

self.assertEqual(command, [
'sh', '-c',
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location \'git+https://github.com/kubeflow/pipelines.git@master#subdirectory=sdk/python\' && "$0" "$@"\n'
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location \'git+https://github.com/kubeflow/pipelines.git@master#subdirectory=sdk/python\' && "$0" "$@"\n'
])

def test_with_no_user_packages_to_install_and_kfp_package_path_and_install_kfp_false(
Expand All @@ -84,7 +84,7 @@ def test_with_user_packages_to_install_and_kfp_package_path_and_install_kfp_fals

self.assertEqual(command, [
'sh', '-c',
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location \'sklearn\' && "$0" "$@"\n'
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location \'sklearn\' && "$0" "$@"\n'
])

def test_with_no_user_packages_to_install_and_kfp_package_path_and_target_image(
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_with_user_packages_to_install_and_no_pip_index_url(self):

self.assertEqual(command, [
'sh', '-c',
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location \'package1\' \'package2\' \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location \'package1\' \'package2\' \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
])

def test_with_packages_to_install_with_pip_index_url(self):
Expand All @@ -132,7 +132,7 @@ def test_with_packages_to_install_with_pip_index_url(self):

self.assertEqual(command, [
'sh', '-c',
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location --index-url https://myurl.org/simple --trusted-host https://myurl.org/simple \'package1\' \'package2\' \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
'\nif ! [ -x "$(command -v pip)" ]; then\n python3 -m ensurepip || python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1 python3 -m pip install --quiet --no-warn-script-location --index-url https://myurl.org/simple --trusted-host https://myurl.org/simple \'package1\' \'package2\' \'kfp==2.1.2\' \'--no-deps\' \'typing-extensions>=3.7.4,<5; python_version<"3.9"\' && "$0" "$@"\n'
])


Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/add_numbers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ --index-url https://pypi.org/simple --trusted-host https://pypi.org/simple\
\ 'yapf' 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
\ python3 -m pip install --quiet --no-warn-script-location --index-url\
\ https://pypi.org/simple --trusted-host https://pypi.org/simple 'yapf'\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/concat_message.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/dict_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/input_artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/nested_return.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/output_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
9 changes: 5 additions & 4 deletions sdk/python/test_data/components/preprocess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ deploymentSpec:
- -c
- "\nif ! [ -x \"$(command -v pip)\" ]; then\n python3 -m ensurepip ||\
\ python3 -m ensurepip --user || apt-get install python3-pip\nfi\n\nPIP_DISABLE_PIP_VERSION_CHECK=1\
\ _KFP_RUNTIME=true python3 -m pip install --quiet --no-warn-script-location\
\ 'kfp==2.1.2' '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"\
3.9\"' && \"$0\" \"$@\"\n"
\ python3 -m pip install --quiet --no-warn-script-location 'kfp==2.1.2'\
\ '--no-deps' 'typing-extensions>=3.7.4,<5; python_version<\"3.9\"' && \"\
$0\" \"$@\"\n"
- sh
- -ec
- 'program_path=$(mktemp -d)
printf "%s" "$0" > "$program_path/ephemeral_component.py"
python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
_KFP_RUNTIME=true python3 -m kfp.dsl.executor_main --component_module_path "$program_path/ephemeral_component.py" "$@"
'
- "\nimport kfp\nfrom kfp import dsl\nfrom kfp.dsl import *\nfrom typing import\
Expand Down
Loading

0 comments on commit d0027c8

Please sign in to comment.