From 9c6e8d9439de466297f75d9cf4ef261273eca9fd Mon Sep 17 00:00:00 2001 From: Luciano Resende Date: Thu, 30 Sep 2021 10:20:32 -0700 Subject: [PATCH] Refactor tests to common parent folder to better code sharing (#2160) --- elyra/metadata/schemas/metadata-test.json | 4 +- elyra/metadata/schemas/metadata-test2.json | 2 +- elyra/pipeline/airflow/tests/__init__.py | 15 ------ elyra/pipeline/kfp/tests/__init__.py | 15 ------ elyra/pipeline/kfp/tests/conftest.py | 40 ---------------- elyra/pipeline/local/tests/__init__.py | 15 ------ elyra/pipeline/tests/__init__.py | 15 ------ elyra/pipeline/tests/conftest.py | 40 ---------------- elyra/pipeline/tests/resources/__init__.py | 15 ------ .../tests/resources/node_util/__init__.py | 15 ------ elyra/tests/__init__.py | 0 elyra/tests/airflow/__init__.py | 0 .../airflow}/test_airflow_operator.py | 0 elyra/tests/cli/__init__.py | 0 .../tests => tests/cli}/test_pipeline_app.py | 3 +- elyra/tests/contents/__init__.py | 0 .../tests => tests/contents}/conftest.py | 14 +++--- elyra/tests/contents/resources/__init__.py | 0 .../contents}/resources/parse.py | 0 .../contents}/resources/parse.r | 0 .../contents}/resources/parse.txt | 0 .../contents}/resources/parse_empty.py | 0 .../contents}/resources/parse_empty.r | 0 .../contents}/resources/parse_no_kernel.ipynb | 0 .../resources/parse_no_language.ipynb | 0 .../contents}/resources/parse_python.ipynb | 0 .../resources/parse_python_empty.ipynb | 0 .../contents}/resources/parse_r.ipynb | 0 .../contents}/resources/parse_r_empty.ipynb | 0 .../contents}/test_content_parser.py | 0 .../tests => tests/contents}/test_handlers.py | 4 +- .../tests => tests/contents}/test_utils.py | 0 elyra/tests/kfp/__init__.py | 0 .../kfp}/resources/test-archive.tgz | Bin .../kfp}/resources/test-bad-archive.tgz | Bin .../kfp}/resources/test-bad-archiveB.tgz | Bin .../kfp}/resources/test-bad-notebookA.ipynb | 0 .../kfp}/resources/test-bad-notebookB.ipynb | 0 .../resources/test-bad-requirements-elyra.txt | 0 .../kfp}/resources/test-notebookA.ipynb | 0 .../resources/test-requirements-elyra.txt | 0 .../tests => tests/kfp}/test_bootstrapper.py | 44 +++++++++--------- .../{kfp/tests => tests/kfp}/test_operator.py | 0 elyra/tests/metadata/__init__.py | 0 .../tests => tests/metadata}/conftest.py | 30 ++++++------ .../tests => tests/metadata}/test_handlers.py | 10 ++-- .../tests => tests/metadata}/test_metadata.py | 22 ++++----- .../metadata}/test_metadata_app.py | 14 +++--- .../tests => tests/metadata}/test_utils.py | 2 +- elyra/tests/pipeline/__init__.py | 0 elyra/tests/pipeline/airflow/__init__.py | 0 .../airflow}/test_component_parser_airflow.py | 20 ++++++-- .../airflow}/test_processor_airflow.py | 2 +- .../tests => tests/pipeline}/conftest.py | 2 +- elyra/tests/pipeline/kfp/__init__.py | 0 .../kfp}/test_component_parser_kfp.py | 14 +++++- .../pipeline/kfp}/test_processor_kfp.py | 6 +-- elyra/tests/pipeline/local/__init__.py | 0 .../local}/test_pipeline_processor_local.py | 8 ++-- .../pipeline/resources}/__init__.py | 0 .../pipeline}/resources/archive/airflow.json | 0 .../pipeline}/resources/archive/test.ipynb | 0 .../pipeline/resources/components/__init__.py | 0 .../components/airflow_test_operator.py | 0 .../airflow_test_operator_no_inputs.py | 0 .../resources/components/filter_text.yaml | 0 .../components/kfp_test_operator.yaml | 0 .../kfp_test_operator_no_inputs.yaml | 0 .../pipeline/resources/node_util}/__init__.py | 0 .../pipeline}/resources/node_util/node.ipynb | 0 .../pipeline}/resources/node_util/node.py | 2 +- .../resources/node_util/node_util.py | 0 .../pipeline}/resources/palette.json | 0 .../pipeline}/resources/properties.json | 0 .../pipeline_3_node_sample.json | 0 ...eline_3_node_sample_with_dependencies.json | 0 .../pipeline_dependency_complex.json | 0 .../pipeline_dependency_simple.json | 0 .../sample_pipelines/pipeline_invalid.json | 0 ...ipeline_multiple_pipeline_definitions.json | 0 .../sample_pipelines/pipeline_valid.json | 0 .../pipeline_with_airflow_components.json | 0 .../pipeline_with_invalid_list_values.json | 0 .../pipeline_with_supernode.json | 0 .../validation_pipelines/NotebookA.ipynb | 0 .../aa_invalid_node_op.pipeline | 0 .../generic_basic_filepath_check.pipeline | 0 ...eric_basic_pipeline_only_notebook.pipeline | 0 ...neric_basic_pipeline_with_scripts.pipeline | 0 .../generic_double_cycle.pipeline | 0 ...ode_property_dependency_file_path.pipeline | 0 ..._node_property_hardware_resources.pipeline | 0 ..._invalid_node_property_image_name.pipeline | 0 ...c_invalid_node_property_structure.pipeline | 0 ...rmed_basic_pipeline_only_notebook.pipeline | 0 .../generic_single_cycle.pipeline | 0 .../generic_singleton.pipeline | 0 .../kf_invalid_node_op.pipeline | 0 ...kf_invalid_node_op_with_supernode.pipeline | 0 ...nvalid_node_property_in_component.pipeline | 0 .../subdirectoryA/TestFileA.txt | 0 .../tests => tests/pipeline}/test_handlers.py | 2 +- .../pipeline}/test_pipeline_constructor.py | 0 .../pipeline}/test_pipeline_definition.py | 2 +- .../pipeline}/test_pipeline_parser.py | 2 +- .../pipeline}/test_validation.py | 2 +- .../tests => tests/pipeline}/util.py | 0 elyra/tests/util/__init__.py | 0 .../tests => tests/util}/test_archive.py | 0 109 files changed, 116 insertions(+), 265 deletions(-) delete mode 100644 elyra/pipeline/airflow/tests/__init__.py delete mode 100644 elyra/pipeline/kfp/tests/__init__.py delete mode 100644 elyra/pipeline/kfp/tests/conftest.py delete mode 100644 elyra/pipeline/local/tests/__init__.py delete mode 100644 elyra/pipeline/tests/__init__.py delete mode 100644 elyra/pipeline/tests/conftest.py delete mode 100644 elyra/pipeline/tests/resources/__init__.py delete mode 100644 elyra/pipeline/tests/resources/node_util/__init__.py create mode 100644 elyra/tests/__init__.py create mode 100644 elyra/tests/airflow/__init__.py rename elyra/{airflow/tests => tests/airflow}/test_airflow_operator.py (100%) create mode 100644 elyra/tests/cli/__init__.py rename elyra/{cli/tests => tests/cli}/test_pipeline_app.py (99%) create mode 100644 elyra/tests/contents/__init__.py rename elyra/{contents/tests => tests/contents}/conftest.py (83%) create mode 100644 elyra/tests/contents/resources/__init__.py rename elyra/{contents/tests => tests/contents}/resources/parse.py (100%) rename elyra/{contents/tests => tests/contents}/resources/parse.r (100%) rename elyra/{contents/tests => tests/contents}/resources/parse.txt (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_empty.py (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_empty.r (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_no_kernel.ipynb (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_no_language.ipynb (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_python.ipynb (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_python_empty.ipynb (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_r.ipynb (100%) rename elyra/{contents/tests => tests/contents}/resources/parse_r_empty.ipynb (100%) rename elyra/{contents/tests => tests/contents}/test_content_parser.py (100%) rename elyra/{contents/tests => tests/contents}/test_handlers.py (95%) rename elyra/{contents/tests => tests/contents}/test_utils.py (100%) create mode 100644 elyra/tests/kfp/__init__.py rename elyra/{kfp/tests => tests/kfp}/resources/test-archive.tgz (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-bad-archive.tgz (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-bad-archiveB.tgz (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-bad-notebookA.ipynb (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-bad-notebookB.ipynb (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-bad-requirements-elyra.txt (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-notebookA.ipynb (100%) rename elyra/{kfp/tests => tests/kfp}/resources/test-requirements-elyra.txt (100%) rename elyra/{kfp/tests => tests/kfp}/test_bootstrapper.py (96%) rename elyra/{kfp/tests => tests/kfp}/test_operator.py (100%) create mode 100644 elyra/tests/metadata/__init__.py rename elyra/{metadata/tests => tests/metadata}/conftest.py (72%) rename elyra/{metadata/tests => tests/metadata}/test_handlers.py (98%) rename elyra/{metadata/tests => tests/metadata}/test_metadata.py (98%) rename elyra/{metadata/tests => tests/metadata}/test_metadata_app.py (98%) rename elyra/{metadata/tests => tests/metadata}/test_utils.py (99%) create mode 100644 elyra/tests/pipeline/__init__.py create mode 100644 elyra/tests/pipeline/airflow/__init__.py rename elyra/{pipeline/airflow/tests => tests/pipeline/airflow}/test_component_parser_airflow.py (95%) rename elyra/{pipeline/airflow/tests => tests/pipeline/airflow}/test_processor_airflow.py (99%) rename elyra/{pipeline/airflow/tests => tests/pipeline}/conftest.py (93%) create mode 100644 elyra/tests/pipeline/kfp/__init__.py rename elyra/{pipeline/kfp/tests => tests/pipeline/kfp}/test_component_parser_kfp.py (97%) rename elyra/{pipeline/kfp/tests => tests/pipeline/kfp}/test_processor_kfp.py (98%) create mode 100644 elyra/tests/pipeline/local/__init__.py rename elyra/{pipeline/local/tests => tests/pipeline/local}/test_pipeline_processor_local.py (96%) rename elyra/{contents/tests => tests/pipeline/resources}/__init__.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/archive/airflow.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/archive/test.ipynb (100%) create mode 100644 elyra/tests/pipeline/resources/components/__init__.py rename elyra/{pipeline/tests => tests/pipeline}/resources/components/airflow_test_operator.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/components/airflow_test_operator_no_inputs.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/components/filter_text.yaml (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/components/kfp_test_operator.yaml (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/components/kfp_test_operator_no_inputs.yaml (100%) rename elyra/{metadata/tests => tests/pipeline/resources/node_util}/__init__.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/node_util/node.ipynb (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/node_util/node.py (96%) rename elyra/{pipeline/tests => tests/pipeline}/resources/node_util/node_util.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/palette.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/properties.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_3_node_sample.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_3_node_sample_with_dependencies.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_dependency_complex.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_dependency_simple.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_invalid.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_multiple_pipeline_definitions.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_valid.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_with_airflow_components.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_with_invalid_list_values.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/sample_pipelines/pipeline_with_supernode.json (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/NotebookA.ipynb (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/aa_invalid_node_op.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_basic_filepath_check.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_basic_pipeline_only_notebook.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_basic_pipeline_with_scripts.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_double_cycle.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_invalid_node_property_dependency_file_path.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_invalid_node_property_hardware_resources.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_invalid_node_property_image_name.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_invalid_node_property_structure.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_malformed_basic_pipeline_only_notebook.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_single_cycle.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/generic_singleton.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/kf_invalid_node_op.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/kf_invalid_node_op_with_supernode.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/kf_invalid_node_property_in_component.pipeline (100%) rename elyra/{pipeline/tests => tests/pipeline}/resources/validation_pipelines/subdirectoryA/TestFileA.txt (100%) rename elyra/{pipeline/tests => tests/pipeline}/test_handlers.py (97%) rename elyra/{pipeline/tests => tests/pipeline}/test_pipeline_constructor.py (100%) rename elyra/{pipeline/tests => tests/pipeline}/test_pipeline_definition.py (98%) rename elyra/{pipeline/tests => tests/pipeline}/test_pipeline_parser.py (99%) rename elyra/{pipeline/tests => tests/pipeline}/test_validation.py (99%) rename elyra/{pipeline/tests => tests/pipeline}/util.py (100%) create mode 100644 elyra/tests/util/__init__.py rename elyra/{util/tests => tests/util}/test_archive.py (100%) diff --git a/elyra/metadata/schemas/metadata-test.json b/elyra/metadata/schemas/metadata-test.json index d11241d4e..e06c26ca4 100644 --- a/elyra/metadata/schemas/metadata-test.json +++ b/elyra/metadata/schemas/metadata-test.json @@ -4,8 +4,8 @@ "name": "metadata-test", "display_name": "Metadata Test", "namespace": "metadata-tests", - "metadata_class_name": "elyra.metadata.tests.test_utils.MockMetadataTest", - "schema_filter_class_name": "elyra.metadata.tests.test_utils.TestSchemaFilter", + "metadata_class_name": "elyra.tests.metadata.test_utils.MockMetadataTest", + "schema_filter_class_name": "elyra.tests.metadata.test_utils.TestSchemaFilter", "properties": { "schema_name": { "title": "Schema Name", diff --git a/elyra/metadata/schemas/metadata-test2.json b/elyra/metadata/schemas/metadata-test2.json index b676f0e83..a6420e473 100644 --- a/elyra/metadata/schemas/metadata-test2.json +++ b/elyra/metadata/schemas/metadata-test2.json @@ -4,7 +4,7 @@ "name": "metadata-test2", "display_name": "Metadata Test2", "namespace": "metadata-tests", - "metadata_class_name": "elyra.metadata.tests.test_utils.MockMetadataTestRollback", + "metadata_class_name": "elyra.tests.metadata.test_utils.MockMetadataTestRollback", "properties": { "schema_name": { "title": "Schema Name", diff --git a/elyra/pipeline/airflow/tests/__init__.py b/elyra/pipeline/airflow/tests/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/airflow/tests/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/pipeline/kfp/tests/__init__.py b/elyra/pipeline/kfp/tests/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/kfp/tests/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/pipeline/kfp/tests/conftest.py b/elyra/pipeline/kfp/tests/conftest.py deleted file mode 100644 index 778a0ead9..000000000 --- a/elyra/pipeline/kfp/tests/conftest.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import shutil - -import pytest - - -@pytest.fixture -def setup_factory_data(jp_environ, jp_env_jupyter_path): - """Copies the factory metadata instances for runtime-images and compontent-registries to test hierarchy.""" - source = os.path.join(os.path.dirname(__file__), '../../../../etc/config/metadata') - destination = os.path.join(jp_env_jupyter_path, 'metadata') - shutil.copytree(source, destination) - yield destination # this return value probably won't be used, but here nonetheless - - -# Set Elyra server extension as enabled (overriding server_config fixture from jupyter_server) -@pytest.fixture -def jp_server_config(setup_factory_data): - return { - "ServerApp": { - "jpserver_extensions": { - "elyra": True - } - } - } diff --git a/elyra/pipeline/local/tests/__init__.py b/elyra/pipeline/local/tests/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/local/tests/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/pipeline/tests/__init__.py b/elyra/pipeline/tests/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/tests/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/pipeline/tests/conftest.py b/elyra/pipeline/tests/conftest.py deleted file mode 100644 index bf5d73f97..000000000 --- a/elyra/pipeline/tests/conftest.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import shutil - -import pytest - - -@pytest.fixture -def setup_factory_data(jp_environ, jp_env_jupyter_path): - """Copies the factory metadata instances for runtime-images and compontent-registries to test hierarchy.""" - source = os.path.join(os.path.dirname(__file__), '../../../etc/config/metadata') - destination = os.path.join(jp_env_jupyter_path, 'metadata') - shutil.copytree(source, destination) - yield destination # this return value probably won't be used, but here nonetheless - - -# Set Elyra server extension as enabled (overriding server_config fixture from jupyter_server) -@pytest.fixture -def jp_server_config(setup_factory_data): - return { - "ServerApp": { - "jpserver_extensions": { - "elyra": True - } - } - } diff --git a/elyra/pipeline/tests/resources/__init__.py b/elyra/pipeline/tests/resources/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/tests/resources/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/pipeline/tests/resources/node_util/__init__.py b/elyra/pipeline/tests/resources/node_util/__init__.py deleted file mode 100644 index febc0a251..000000000 --- a/elyra/pipeline/tests/resources/node_util/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright 2018-2021 Elyra Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/elyra/tests/__init__.py b/elyra/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/tests/airflow/__init__.py b/elyra/tests/airflow/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/airflow/tests/test_airflow_operator.py b/elyra/tests/airflow/test_airflow_operator.py similarity index 100% rename from elyra/airflow/tests/test_airflow_operator.py rename to elyra/tests/airflow/test_airflow_operator.py diff --git a/elyra/tests/cli/__init__.py b/elyra/tests/cli/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/cli/tests/test_pipeline_app.py b/elyra/tests/cli/test_pipeline_app.py similarity index 99% rename from elyra/cli/tests/test_pipeline_app.py rename to elyra/tests/cli/test_pipeline_app.py index ba66a87a5..2e3a47c6e 100644 --- a/elyra/cli/tests/test_pipeline_app.py +++ b/elyra/tests/cli/test_pipeline_app.py @@ -258,8 +258,7 @@ def test_submit_pipeline_with_no_nodes(monkeypatch): monkeypatch.setattr(pipeline_app, "_get_runtime_type", mock_get_runtime_type) - result = runner.invoke(pipeline, ['submit', pipeline_file_path, - '--runtime-config', 'foo']) + result = runner.invoke(pipeline, ['submit', pipeline_file_path, '--runtime-config', 'foo']) assert "At least one node must exist in the primary pipeline." in result.output assert result.exit_code != 0 diff --git a/elyra/tests/contents/__init__.py b/elyra/tests/contents/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/contents/tests/conftest.py b/elyra/tests/contents/conftest.py similarity index 83% rename from elyra/contents/tests/conftest.py rename to elyra/tests/contents/conftest.py index d8b61f8db..c1fd74b4d 100644 --- a/elyra/contents/tests/conftest.py +++ b/elyra/tests/contents/conftest.py @@ -17,13 +17,13 @@ import pytest -from elyra.contents.tests.test_utils import create_dir -from elyra.contents.tests.test_utils import create_file -from elyra.contents.tests.test_utils import empty_notebook_content -from elyra.contents.tests.test_utils import notebook_content -from elyra.contents.tests.test_utils import python_content -from elyra.contents.tests.test_utils import r_content -from elyra.contents.tests.test_utils import text_content +from elyra.tests.contents.test_utils import create_dir +from elyra.tests.contents.test_utils import create_file +from elyra.tests.contents.test_utils import empty_notebook_content +from elyra.tests.contents.test_utils import notebook_content +from elyra.tests.contents.test_utils import python_content +from elyra.tests.contents.test_utils import r_content +from elyra.tests.contents.test_utils import text_content @pytest.fixture diff --git a/elyra/tests/contents/resources/__init__.py b/elyra/tests/contents/resources/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/contents/tests/resources/parse.py b/elyra/tests/contents/resources/parse.py similarity index 100% rename from elyra/contents/tests/resources/parse.py rename to elyra/tests/contents/resources/parse.py diff --git a/elyra/contents/tests/resources/parse.r b/elyra/tests/contents/resources/parse.r similarity index 100% rename from elyra/contents/tests/resources/parse.r rename to elyra/tests/contents/resources/parse.r diff --git a/elyra/contents/tests/resources/parse.txt b/elyra/tests/contents/resources/parse.txt similarity index 100% rename from elyra/contents/tests/resources/parse.txt rename to elyra/tests/contents/resources/parse.txt diff --git a/elyra/contents/tests/resources/parse_empty.py b/elyra/tests/contents/resources/parse_empty.py similarity index 100% rename from elyra/contents/tests/resources/parse_empty.py rename to elyra/tests/contents/resources/parse_empty.py diff --git a/elyra/contents/tests/resources/parse_empty.r b/elyra/tests/contents/resources/parse_empty.r similarity index 100% rename from elyra/contents/tests/resources/parse_empty.r rename to elyra/tests/contents/resources/parse_empty.r diff --git a/elyra/contents/tests/resources/parse_no_kernel.ipynb b/elyra/tests/contents/resources/parse_no_kernel.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_no_kernel.ipynb rename to elyra/tests/contents/resources/parse_no_kernel.ipynb diff --git a/elyra/contents/tests/resources/parse_no_language.ipynb b/elyra/tests/contents/resources/parse_no_language.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_no_language.ipynb rename to elyra/tests/contents/resources/parse_no_language.ipynb diff --git a/elyra/contents/tests/resources/parse_python.ipynb b/elyra/tests/contents/resources/parse_python.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_python.ipynb rename to elyra/tests/contents/resources/parse_python.ipynb diff --git a/elyra/contents/tests/resources/parse_python_empty.ipynb b/elyra/tests/contents/resources/parse_python_empty.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_python_empty.ipynb rename to elyra/tests/contents/resources/parse_python_empty.ipynb diff --git a/elyra/contents/tests/resources/parse_r.ipynb b/elyra/tests/contents/resources/parse_r.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_r.ipynb rename to elyra/tests/contents/resources/parse_r.ipynb diff --git a/elyra/contents/tests/resources/parse_r_empty.ipynb b/elyra/tests/contents/resources/parse_r_empty.ipynb similarity index 100% rename from elyra/contents/tests/resources/parse_r_empty.ipynb rename to elyra/tests/contents/resources/parse_r_empty.ipynb diff --git a/elyra/contents/tests/test_content_parser.py b/elyra/tests/contents/test_content_parser.py similarity index 100% rename from elyra/contents/tests/test_content_parser.py rename to elyra/tests/contents/test_content_parser.py diff --git a/elyra/contents/tests/test_handlers.py b/elyra/tests/contents/test_handlers.py similarity index 95% rename from elyra/contents/tests/test_handlers.py rename to elyra/tests/contents/test_handlers.py index 659460878..9c1aec6d5 100644 --- a/elyra/contents/tests/test_handlers.py +++ b/elyra/tests/contents/test_handlers.py @@ -19,8 +19,8 @@ import pytest from tornado.httpclient import HTTPClientError -from elyra.contents.tests.test_utils import expected_response -from elyra.contents.tests.test_utils import expected_response_empty +from elyra.tests.contents.test_utils import expected_response +from elyra.tests.contents.test_utils import expected_response_empty async def test_file_not_found(jp_fetch): diff --git a/elyra/contents/tests/test_utils.py b/elyra/tests/contents/test_utils.py similarity index 100% rename from elyra/contents/tests/test_utils.py rename to elyra/tests/contents/test_utils.py diff --git a/elyra/tests/kfp/__init__.py b/elyra/tests/kfp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/kfp/tests/resources/test-archive.tgz b/elyra/tests/kfp/resources/test-archive.tgz similarity index 100% rename from elyra/kfp/tests/resources/test-archive.tgz rename to elyra/tests/kfp/resources/test-archive.tgz diff --git a/elyra/kfp/tests/resources/test-bad-archive.tgz b/elyra/tests/kfp/resources/test-bad-archive.tgz similarity index 100% rename from elyra/kfp/tests/resources/test-bad-archive.tgz rename to elyra/tests/kfp/resources/test-bad-archive.tgz diff --git a/elyra/kfp/tests/resources/test-bad-archiveB.tgz b/elyra/tests/kfp/resources/test-bad-archiveB.tgz similarity index 100% rename from elyra/kfp/tests/resources/test-bad-archiveB.tgz rename to elyra/tests/kfp/resources/test-bad-archiveB.tgz diff --git a/elyra/kfp/tests/resources/test-bad-notebookA.ipynb b/elyra/tests/kfp/resources/test-bad-notebookA.ipynb similarity index 100% rename from elyra/kfp/tests/resources/test-bad-notebookA.ipynb rename to elyra/tests/kfp/resources/test-bad-notebookA.ipynb diff --git a/elyra/kfp/tests/resources/test-bad-notebookB.ipynb b/elyra/tests/kfp/resources/test-bad-notebookB.ipynb similarity index 100% rename from elyra/kfp/tests/resources/test-bad-notebookB.ipynb rename to elyra/tests/kfp/resources/test-bad-notebookB.ipynb diff --git a/elyra/kfp/tests/resources/test-bad-requirements-elyra.txt b/elyra/tests/kfp/resources/test-bad-requirements-elyra.txt similarity index 100% rename from elyra/kfp/tests/resources/test-bad-requirements-elyra.txt rename to elyra/tests/kfp/resources/test-bad-requirements-elyra.txt diff --git a/elyra/kfp/tests/resources/test-notebookA.ipynb b/elyra/tests/kfp/resources/test-notebookA.ipynb similarity index 100% rename from elyra/kfp/tests/resources/test-notebookA.ipynb rename to elyra/tests/kfp/resources/test-notebookA.ipynb diff --git a/elyra/kfp/tests/resources/test-requirements-elyra.txt b/elyra/tests/kfp/resources/test-requirements-elyra.txt similarity index 100% rename from elyra/kfp/tests/resources/test-requirements-elyra.txt rename to elyra/tests/kfp/resources/test-requirements-elyra.txt diff --git a/elyra/kfp/tests/test_bootstrapper.py b/elyra/tests/kfp/test_bootstrapper.py similarity index 96% rename from elyra/kfp/tests/test_bootstrapper.py rename to elyra/tests/kfp/test_bootstrapper.py index a72fcb91a..2dc73f2c7 100644 --- a/elyra/kfp/tests/test_bootstrapper.py +++ b/elyra/tests/kfp/test_bootstrapper.py @@ -39,8 +39,8 @@ # 2. Manually launch test_minio container: docker run --name test_minio -d -p 9000:9000 minio/minio server /data # (this is located in Makefile) # -# NOTE: Any changes to elyra/kfp/tests/resources/test-notebookA.ipynb require an -# update of elyra/kfp/tests/resources/test-archive.tgz using the command below: +# NOTE: Any changes to elyra/tests/kfp/resources/test-notebookA.ipynb require an +# update of elyra/tests/kfp/resources/test-archive.tgz using the command below: # tar -cvzf test-archive.tgz test-notebookA.ipynb @@ -116,13 +116,13 @@ def main_method_setup_execution(monkeypatch, s3_setup, tmpdir, argument_dict): s3_setup.fput_object(bucket_name=argument_dict['cos-bucket'], object_name="test-directory/test-file.txt", - file_path="elyra/kfp/tests/resources/test-requirements-elyra.txt") + file_path="elyra/tests/kfp/resources/test-requirements-elyra.txt") s3_setup.fput_object(bucket_name=argument_dict['cos-bucket'], object_name="test-directory/test,file.txt", - file_path="elyra/kfp/tests/resources/test-bad-requirements-elyra.txt") + file_path="elyra/tests/kfp/resources/test-bad-requirements-elyra.txt") s3_setup.fput_object(bucket_name=argument_dict['cos-bucket'], object_name="test-directory/test-archive.tgz", - file_path="elyra/kfp/tests/resources/test-archive.tgz") + file_path="elyra/tests/kfp/resources/test-archive.tgz") with tmpdir.as_cwd(): bootstrapper.main() @@ -173,7 +173,7 @@ def test_main_method(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/test-file-copy.txt;test-file/test,file/test,file-copy.txt', 'user-volume-path': None} @@ -185,7 +185,7 @@ def test_main_method_with_wildcard_outputs(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/*', 'user-volume-path': None} @@ -197,7 +197,7 @@ def test_main_method_with_dir_outputs(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file', # this is the directory that contains the outputs 'user-volume-path': None} @@ -245,7 +245,7 @@ def test_process_metrics_method_not_writable_dir(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/test-file-copy.txt;test-file/test,file/test,file-copy.txt', 'user-volume-path': None} @@ -267,7 +267,7 @@ def test_process_metrics_method_no_metadata_file(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/test-file-copy.txt;test-file/test,file/test,file-copy.txt', 'user-volume-path': None} @@ -319,7 +319,7 @@ def test_process_metrics_method_valid_metadata_file(monkeypatch, s3_setup, tmpdi 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/test-file-copy.txt;test-file/test,file/test,file-copy.txt', 'user-volume-path': None} @@ -396,7 +396,7 @@ def test_process_metrics_method_invalid_metadata_file(monkeypatch, s3_setup, tmp 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt;test,file.txt', 'outputs': 'test-file/test-file-copy.txt;test-file/test,file/test,file-copy.txt', 'user-volume-path': None} @@ -453,7 +453,7 @@ def test_fail_bad_endpoint_main_method(monkeypatch, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-archive.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-notebookA.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-notebookA.ipynb', 'inputs': 'test-file.txt', 'outputs': 'test-file/test-file-copy.txt', 'user-volume-path': None} @@ -480,7 +480,7 @@ def test_fail_bad_notebook_main_method(monkeypatch, s3_setup, tmpdir): 'cos-bucket': 'test-bucket', 'cos-directory': 'test-directory', 'cos-dependencies-archive': 'test-bad-archiveB.tgz', - 'filepath': 'elyra/kfp/tests/resources/test-bad-notebookB.ipynb', + 'filepath': 'elyra/tests/kfp/resources/test-bad-notebookB.ipynb', 'inputs': 'test-file.txt', 'outputs': 'test-file/test-copy-file.txt', 'user-volume-path': None} @@ -503,7 +503,7 @@ def test_fail_bad_notebook_main_method(monkeypatch, s3_setup, tmpdir): file_path="README.md") s3_setup.fput_object(bucket_name=argument_dict['cos-bucket'], object_name="test-bad-archiveB.tgz", - file_path="elyra/kfp/tests/resources/test-bad-archiveB.tgz") + file_path="elyra/tests/kfp/resources/test-bad-archiveB.tgz") with tmpdir.as_cwd(): with pytest.raises(papermill.exceptions.PapermillExecutionError): @@ -603,7 +603,7 @@ def test_package_installation_with_target_path(monkeypatch, virtualenv): def test_convert_notebook_to_html(tmpdir): - notebook_file = os.getcwd() + "/elyra/kfp/tests/resources/test-notebookA.ipynb" + notebook_file = os.getcwd() + "/elyra/tests/kfp/resources/test-notebookA.ipynb" notebook_output_html_file = "test-notebookA.html" with tmpdir.as_cwd(): @@ -619,7 +619,7 @@ def test_convert_notebook_to_html(tmpdir): def test_fail_convert_notebook_to_html(tmpdir): - notebook_file = os.getcwd() + "/elyra/kfp/tests/resources/test-bad-notebookA.ipynb" + notebook_file = os.getcwd() + "/elyra/tests/kfp/resources/test-bad-notebookA.ipynb" notebook_output_html_file = "bad-notebookA.html" with tmpdir.as_cwd(): # Recent versions raising typeError due to #1130 @@ -687,7 +687,7 @@ def test_fail_bucket_put_file_object_store(monkeypatch, s3_setup): def test_find_best_kernel_nb(tmpdir): - source_nb_file = os.path.join(os.getcwd(), "elyra/kfp/tests/resources/test-notebookA.ipynb") + source_nb_file = os.path.join(os.getcwd(), "elyra/tests/kfp/resources/test-notebookA.ipynb") nb_file = os.path.join(tmpdir, "test-notebookA.ipynb") # "Copy" nb file to destination - this test does not update the kernel or language. @@ -701,7 +701,7 @@ def test_find_best_kernel_nb(tmpdir): def test_find_best_kernel_lang(tmpdir, caplog): caplog.set_level(logging.INFO) - source_nb_file = os.path.join(os.getcwd(), "elyra/kfp/tests/resources/test-notebookA.ipynb") + source_nb_file = os.path.join(os.getcwd(), "elyra/tests/kfp/resources/test-notebookA.ipynb") nb_file = os.path.join(tmpdir, "test-notebookA.ipynb") # "Copy" nb file to destination after updating the kernel name - forcing a language match @@ -718,7 +718,7 @@ def test_find_best_kernel_lang(tmpdir, caplog): def test_find_best_kernel_nomatch(tmpdir, caplog): - source_nb_file = os.path.join(os.getcwd(), "elyra/kfp/tests/resources/test-notebookA.ipynb") + source_nb_file = os.path.join(os.getcwd(), "elyra/tests/kfp/resources/test-notebookA.ipynb") nb_file = os.path.join(tmpdir, "test-notebookA.ipynb") # "Copy" nb file to destination after updating the kernel name and language - forcing use of updated name @@ -800,14 +800,14 @@ def test_fail_missing_directory_parse_arguments(): @pytest.mark.skip(reason='leaving as informational - not sure worth checking if reqs change') def test_requirements_file(): - requirements_file = "elyra/kfp/tests/resources/test-requirements-elyra.txt" + requirements_file = "elyra/tests/kfp/resources/test-requirements-elyra.txt" correct_number_of_packages = 18 list_dict = bootstrapper.OpUtil.package_list_to_dict(requirements_file) assert len(list_dict) == correct_number_of_packages def test_fail_requirements_file_bad_delimiter(): - bad_requirements_file = "elyra/kfp/tests/resources/test-bad-requirements-elyra.txt" + bad_requirements_file = "elyra/tests/kfp/resources/test-bad-requirements-elyra.txt" with pytest.raises(ValueError): bootstrapper.OpUtil.package_list_to_dict(bad_requirements_file) diff --git a/elyra/kfp/tests/test_operator.py b/elyra/tests/kfp/test_operator.py similarity index 100% rename from elyra/kfp/tests/test_operator.py rename to elyra/tests/kfp/test_operator.py diff --git a/elyra/tests/metadata/__init__.py b/elyra/tests/metadata/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/metadata/tests/conftest.py b/elyra/tests/metadata/conftest.py similarity index 72% rename from elyra/metadata/tests/conftest.py rename to elyra/tests/metadata/conftest.py index f89126bd5..7b1f5d1af 100644 --- a/elyra/metadata/tests/conftest.py +++ b/elyra/tests/metadata/conftest.py @@ -18,14 +18,14 @@ from elyra.metadata.manager import MetadataManager from elyra.metadata.schema import METADATA_TEST_NAMESPACE from elyra.metadata.schema import SchemaManager -from elyra.metadata.tests.test_utils import another_metadata_json -from elyra.metadata.tests.test_utils import byo_metadata_json -from elyra.metadata.tests.test_utils import create_instance -from elyra.metadata.tests.test_utils import create_json_file -from elyra.metadata.tests.test_utils import invalid_json -from elyra.metadata.tests.test_utils import invalid_metadata_json -from elyra.metadata.tests.test_utils import invalid_schema_name_json -from elyra.metadata.tests.test_utils import valid_metadata_json +from elyra.tests.metadata.test_utils import another_metadata_json +from elyra.tests.metadata.test_utils import byo_metadata_json +from elyra.tests.metadata.test_utils import create_instance +from elyra.tests.metadata.test_utils import create_json_file +from elyra.tests.metadata.test_utils import invalid_json +from elyra.tests.metadata.test_utils import invalid_metadata_json +from elyra.tests.metadata.test_utils import invalid_schema_name_json +from elyra.tests.metadata.test_utils import valid_metadata_json def mkdir(tmp_path, *parts): @@ -36,14 +36,10 @@ def mkdir(tmp_path, *parts): # These location fixtures will need to be revisited once we support multiple metadata storage types. -namespace_location = pytest.fixture(lambda jp_data_dir: - mkdir(jp_data_dir, "metadata", METADATA_TEST_NAMESPACE)) -bogus_location = pytest.fixture(lambda jp_data_dir: - mkdir(jp_data_dir, "metadata", "bogus")) -shared_location = pytest.fixture(lambda jp_system_jupyter_path: - mkdir(jp_system_jupyter_path, "metadata", METADATA_TEST_NAMESPACE)) -factory_location = pytest.fixture(lambda jp_env_jupyter_path: - mkdir(jp_env_jupyter_path, "metadata", METADATA_TEST_NAMESPACE)) +namespace_location = pytest.fixture(lambda jp_data_dir: mkdir(jp_data_dir, "metadata", METADATA_TEST_NAMESPACE)) +bogus_location = pytest.fixture(lambda jp_data_dir: mkdir(jp_data_dir, "metadata", "bogus")) +shared_location = pytest.fixture(lambda jp_system_jupyter_path: mkdir(jp_system_jupyter_path, "metadata", METADATA_TEST_NAMESPACE)) # noqa +factory_location = pytest.fixture(lambda jp_env_jupyter_path: mkdir(jp_env_jupyter_path, "metadata", METADATA_TEST_NAMESPACE)) # noqa @pytest.fixture @@ -69,7 +65,7 @@ def store_manager(tests_manager): @pytest.fixture(params=["elyra.metadata.storage.FileMetadataStore", - "elyra.metadata.tests.test_utils.MockMetadataStore"]) # Add types as needed + "elyra.tests.metadata.test_utils.MockMetadataStore"]) # Add types as needed def tests_manager(jp_environ, namespace_location, request): metadata_mgr = MetadataManager(namespace=METADATA_TEST_NAMESPACE, metadata_store_class=request.param) store_mgr = metadata_mgr.metadata_store diff --git a/elyra/metadata/tests/test_handlers.py b/elyra/tests/metadata/test_handlers.py similarity index 98% rename from elyra/metadata/tests/test_handlers.py rename to elyra/tests/metadata/test_handlers.py index 45708551b..b402b8c0b 100644 --- a/elyra/metadata/tests/test_handlers.py +++ b/elyra/tests/metadata/test_handlers.py @@ -24,11 +24,11 @@ from tornado.httpclient import HTTPClientError from elyra.metadata.schema import METADATA_TEST_NAMESPACE -from elyra.metadata.tests.test_utils import byo_metadata_json -from elyra.metadata.tests.test_utils import create_json_file -from elyra.metadata.tests.test_utils import get_instance -from elyra.metadata.tests.test_utils import invalid_metadata_json -from elyra.metadata.tests.test_utils import valid_metadata_json +from elyra.tests.metadata.test_utils import byo_metadata_json +from elyra.tests.metadata.test_utils import create_json_file +from elyra.tests.metadata.test_utils import get_instance +from elyra.tests.metadata.test_utils import invalid_metadata_json +from elyra.tests.metadata.test_utils import valid_metadata_json os.environ["METADATA_TESTING"] = "1" # Enable metadata-tests namespace diff --git a/elyra/metadata/tests/test_metadata.py b/elyra/tests/metadata/test_metadata.py similarity index 98% rename from elyra/metadata/tests/test_metadata.py rename to elyra/tests/metadata/test_metadata.py index bab27212a..0c0f6f32e 100644 --- a/elyra/metadata/tests/test_metadata.py +++ b/elyra/tests/metadata/test_metadata.py @@ -35,17 +35,17 @@ from elyra.metadata.storage import FileMetadataCache from elyra.metadata.storage import FileMetadataStore from elyra.metadata.storage import MetadataStore -from elyra.metadata.tests.test_utils import byo_metadata_json -from elyra.metadata.tests.test_utils import create_instance -from elyra.metadata.tests.test_utils import create_json_file -from elyra.metadata.tests.test_utils import get_unfiltered_schema -from elyra.metadata.tests.test_utils import invalid_metadata_json -from elyra.metadata.tests.test_utils import invalid_no_display_name_json -from elyra.metadata.tests.test_utils import MockMetadataStore -from elyra.metadata.tests.test_utils import TestSchemaFilter -from elyra.metadata.tests.test_utils import valid_display_name_json -from elyra.metadata.tests.test_utils import valid_metadata2_json -from elyra.metadata.tests.test_utils import valid_metadata_json +from elyra.tests.metadata.test_utils import byo_metadata_json +from elyra.tests.metadata.test_utils import create_instance +from elyra.tests.metadata.test_utils import create_json_file +from elyra.tests.metadata.test_utils import get_unfiltered_schema +from elyra.tests.metadata.test_utils import invalid_metadata_json +from elyra.tests.metadata.test_utils import invalid_no_display_name_json +from elyra.tests.metadata.test_utils import MockMetadataStore +from elyra.tests.metadata.test_utils import TestSchemaFilter +from elyra.tests.metadata.test_utils import valid_display_name_json +from elyra.tests.metadata.test_utils import valid_metadata2_json +from elyra.tests.metadata.test_utils import valid_metadata_json os.environ["METADATA_TESTING"] = "1" # Enable metadata-tests namespace diff --git a/elyra/metadata/tests/test_metadata_app.py b/elyra/tests/metadata/test_metadata_app.py similarity index 98% rename from elyra/metadata/tests/test_metadata_app.py rename to elyra/tests/metadata/test_metadata_app.py index 69a7972ae..1e29fc7de 100644 --- a/elyra/metadata/tests/test_metadata_app.py +++ b/elyra/tests/metadata/test_metadata_app.py @@ -25,13 +25,13 @@ from elyra.metadata.manager import MetadataManager from elyra.metadata.metadata import Metadata from elyra.metadata.schema import METADATA_TEST_NAMESPACE -from elyra.metadata.tests.test_utils import another_metadata_json -from elyra.metadata.tests.test_utils import create_json_file -from elyra.metadata.tests.test_utils import invalid_metadata_json -from elyra.metadata.tests.test_utils import invalid_no_display_name_json -from elyra.metadata.tests.test_utils import invalid_schema_name_json -from elyra.metadata.tests.test_utils import PropertyTester -from elyra.metadata.tests.test_utils import valid_metadata_json +from elyra.tests.metadata.test_utils import another_metadata_json +from elyra.tests.metadata.test_utils import create_json_file +from elyra.tests.metadata.test_utils import invalid_metadata_json +from elyra.tests.metadata.test_utils import invalid_no_display_name_json +from elyra.tests.metadata.test_utils import invalid_schema_name_json +from elyra.tests.metadata.test_utils import PropertyTester +from elyra.tests.metadata.test_utils import valid_metadata_json os.environ["METADATA_TESTING"] = "1" # Enable metadata-tests namespace diff --git a/elyra/metadata/tests/test_utils.py b/elyra/tests/metadata/test_utils.py similarity index 99% rename from elyra/metadata/tests/test_utils.py rename to elyra/tests/metadata/test_utils.py index 1c53b81b4..adc8cc751 100644 --- a/elyra/metadata/tests/test_utils.py +++ b/elyra/tests/metadata/test_utils.py @@ -193,7 +193,7 @@ def create_instance(metadata_store: MetadataStore, location: str, name: str, con def get_unfiltered_schema(schema_name): - schema_file = os.path.join(os.path.dirname(__file__), '..', 'schemas', schema_name + '.json') + schema_file = os.path.join(os.path.dirname(__file__), '..', '..', 'metadata', 'schemas', schema_name + '.json') if not os.path.exists(schema_file): raise ValidationError("Metadata schema file '{}' is missing!".format(schema_file)) diff --git a/elyra/tests/pipeline/__init__.py b/elyra/tests/pipeline/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/tests/pipeline/airflow/__init__.py b/elyra/tests/pipeline/airflow/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/pipeline/airflow/tests/test_component_parser_airflow.py b/elyra/tests/pipeline/airflow/test_component_parser_airflow.py similarity index 95% rename from elyra/pipeline/airflow/tests/test_component_parser_airflow.py rename to elyra/tests/pipeline/airflow/test_component_parser_airflow.py index 0980314d4..92b870239 100644 --- a/elyra/pipeline/airflow/tests/test_component_parser_airflow.py +++ b/elyra/tests/pipeline/airflow/test_component_parser_airflow.py @@ -36,7 +36,7 @@ def invalid_url(request): def _get_resource_path(filename): root = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) - resource_path = os.path.join(root, '../../tests', 'resources', 'components', filename) + resource_path = os.path.join(root, '..', '..', '..', 'tests/pipeline', 'resources', 'components', filename) resource_path = os.path.normpath(resource_path) return resource_path @@ -62,7 +62,7 @@ def test_modify_component_registries(): metadata_manager = MetadataManager(namespace=MetadataManager.NAMESPACE_COMPONENT_REGISTRIES) # Create new registry instance with a single URL-based component - paths = ["https://raw.githubusercontent.com/elyra-ai/elyra/master/elyra/pipeline/tests/resources/components/" + paths = ["https://raw.githubusercontent.com/elyra-ai/elyra/master/elyra/tests/pipeline/resources/components/" "airflow_test_operator.py"] instance_metadata = { @@ -77,10 +77,17 @@ def test_modify_component_registries(): display_name="New Registry", metadata=instance_metadata) + try: + if metadata_manager.get("new_registry"): + metadata_manager.remove("new_registry") + except Exception: + pass + metadata_manager.create("new_registry", registry_instance) # Get new set of components from all active registries, including added test registry added_components = component_registry.get_all_components() + added_components = sorted(added_components, key=lambda component: component.id) assert len(added_components) > len(initial_components) added_component_names = [component.name for component in added_components] @@ -88,12 +95,13 @@ def test_modify_component_registries(): assert 'TestOperatorNoInputs' not in added_component_names # Modify the test registry to add an additional path to - paths.append("https://raw.githubusercontent.com/elyra-ai/elyra/master/elyra/pipeline/tests/resources/components" + paths.append("https://raw.githubusercontent.com/elyra-ai/elyra/master/elyra/tests/pipeline/resources/components" "/airflow_test_operator_no_inputs.py") metadata_manager.update("new_registry", registry_instance) # Get set of components from all active registries, including modified test registry modified_components = component_registry.get_all_components() + modified_components = sorted(modified_components, key=lambda component: component.id) assert len(modified_components) > len(added_components) modified_component_names = [component.name for component in modified_components] @@ -139,6 +147,12 @@ def test_directory_based_component_registry(): display_name="New Registry", metadata=instance_metadata) + try: + if metadata_manager.get("new_registry"): + metadata_manager.remove("new_registry") + except Exception: + pass + metadata_manager.create("new_registry", registry_instance) # Get new set of components from all active registries, including added test registry diff --git a/elyra/pipeline/airflow/tests/test_processor_airflow.py b/elyra/tests/pipeline/airflow/test_processor_airflow.py similarity index 99% rename from elyra/pipeline/airflow/tests/test_processor_airflow.py rename to elyra/tests/pipeline/airflow/test_processor_airflow.py index 2ac3d86fd..344b148f0 100644 --- a/elyra/pipeline/airflow/tests/test_processor_airflow.py +++ b/elyra/tests/pipeline/airflow/test_processor_airflow.py @@ -26,7 +26,7 @@ from elyra.pipeline.airflow.processor_airflow import AirflowPipelineProcessor from elyra.pipeline.parser import PipelineParser from elyra.pipeline.pipeline import GenericOperation -from elyra.pipeline.tests.test_pipeline_parser import _read_pipeline_resource +from elyra.tests.pipeline.test_pipeline_parser import _read_pipeline_resource from elyra.util import git PIPELINE_FILE_COMPLEX = 'resources/sample_pipelines/pipeline_dependency_complex.json' diff --git a/elyra/pipeline/airflow/tests/conftest.py b/elyra/tests/pipeline/conftest.py similarity index 93% rename from elyra/pipeline/airflow/tests/conftest.py rename to elyra/tests/pipeline/conftest.py index 778a0ead9..daaca8c24 100644 --- a/elyra/pipeline/airflow/tests/conftest.py +++ b/elyra/tests/pipeline/conftest.py @@ -22,7 +22,7 @@ @pytest.fixture def setup_factory_data(jp_environ, jp_env_jupyter_path): """Copies the factory metadata instances for runtime-images and compontent-registries to test hierarchy.""" - source = os.path.join(os.path.dirname(__file__), '../../../../etc/config/metadata') + source = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'etc/config/metadata') destination = os.path.join(jp_env_jupyter_path, 'metadata') shutil.copytree(source, destination) yield destination # this return value probably won't be used, but here nonetheless diff --git a/elyra/tests/pipeline/kfp/__init__.py b/elyra/tests/pipeline/kfp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/pipeline/kfp/tests/test_component_parser_kfp.py b/elyra/tests/pipeline/kfp/test_component_parser_kfp.py similarity index 97% rename from elyra/pipeline/kfp/tests/test_component_parser_kfp.py rename to elyra/tests/pipeline/kfp/test_component_parser_kfp.py index 4779ecd47..46254014c 100644 --- a/elyra/pipeline/kfp/tests/test_component_parser_kfp.py +++ b/elyra/tests/pipeline/kfp/test_component_parser_kfp.py @@ -30,7 +30,7 @@ def _get_resource_path(filename): root = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) - resource_path = os.path.join(root, '../../tests', 'resources', 'components', filename) + resource_path = os.path.join(root, '..', '..', '..', 'tests/pipeline', 'resources', 'components', filename) resource_path = os.path.normpath(resource_path) return resource_path @@ -70,6 +70,12 @@ def test_modify_component_registries(): display_name="New Registry", metadata=instance_metadata) + try: + if metadata_manager.get("new_registry"): + metadata_manager.remove("new_registry") + except Exception: + pass + metadata_manager.create("new_registry", registry_instance) # Get new set of components from all active registries, including added test registry @@ -131,6 +137,12 @@ def test_directory_based_component_registry(): display_name="New Registry", metadata=instance_metadata) + try: + if metadata_manager.get("new_registry"): + metadata_manager.remove("new_registry") + except Exception: + pass + metadata_manager.create("new_registry", registry_instance) # Get new set of components from all active registries, including added test registry diff --git a/elyra/pipeline/kfp/tests/test_processor_kfp.py b/elyra/tests/pipeline/kfp/test_processor_kfp.py similarity index 98% rename from elyra/pipeline/kfp/tests/test_processor_kfp.py rename to elyra/tests/pipeline/kfp/test_processor_kfp.py index 693f56eff..5291919b1 100644 --- a/elyra/pipeline/kfp/tests/test_processor_kfp.py +++ b/elyra/tests/pipeline/kfp/test_processor_kfp.py @@ -29,7 +29,7 @@ from elyra.pipeline.pipeline import GenericOperation from elyra.pipeline.pipeline import Operation from elyra.pipeline.pipeline import Pipeline -from elyra.pipeline.tests.test_pipeline_parser import _read_pipeline_resource +from elyra.tests.pipeline.test_pipeline_parser import _read_pipeline_resource @pytest.fixture @@ -63,7 +63,7 @@ def test_fail_get_metadata_configuration_invalid_namespace(processor): def test_generate_dependency_archive(processor): - pipelines_test_file = processor.root_dir + '/elyra/pipeline/tests/resources/archive/test.ipynb' + pipelines_test_file = processor.root_dir + '/elyra/tests/pipeline/resources/archive/test.ipynb' pipeline_dependencies = ['airflow.json'] correct_filelist = ['test.ipynb', 'airflow.json'] component_parameters = { @@ -274,7 +274,7 @@ def test_process_dictionary_value_function(processor): def test_processing_url_runtime_specific_component(monkeypatch, processor, sample_metadata, tmpdir): # Assign test resource location url = 'https://raw.githubusercontent.com/elyra-ai/elyra/master/' \ - 'elyra/pipeline/tests/resources/components/filter_text.yaml' + 'elyra/tests/pipeline/resources/components/filter_text.yaml' # Instantiate a url-based component component_id = 'filter-text' diff --git a/elyra/tests/pipeline/local/__init__.py b/elyra/tests/pipeline/local/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/pipeline/local/tests/test_pipeline_processor_local.py b/elyra/tests/pipeline/local/test_pipeline_processor_local.py similarity index 96% rename from elyra/pipeline/local/tests/test_pipeline_processor_local.py rename to elyra/tests/pipeline/local/test_pipeline_processor_local.py index 7eb43ac8f..74f7c8e61 100644 --- a/elyra/pipeline/local/tests/test_pipeline_processor_local.py +++ b/elyra/tests/pipeline/local/test_pipeline_processor_local.py @@ -21,10 +21,10 @@ from elyra.pipeline.local.processor_local import LocalPipelineProcessor from elyra.pipeline.parser import PipelineParser from elyra.pipeline.pipeline import GenericOperation -from elyra.pipeline.tests.util import _read_pipeline_resource -from elyra.pipeline.tests.util import construct_pipeline -from elyra.pipeline.tests.util import NotebookNode -from elyra.pipeline.tests.util import PythonNode +from elyra.tests.pipeline.util import _read_pipeline_resource +from elyra.tests.pipeline.util import construct_pipeline +from elyra.tests.pipeline.util import NotebookNode +from elyra.tests.pipeline.util import PythonNode @pytest.fixture diff --git a/elyra/contents/tests/__init__.py b/elyra/tests/pipeline/resources/__init__.py similarity index 100% rename from elyra/contents/tests/__init__.py rename to elyra/tests/pipeline/resources/__init__.py diff --git a/elyra/pipeline/tests/resources/archive/airflow.json b/elyra/tests/pipeline/resources/archive/airflow.json similarity index 100% rename from elyra/pipeline/tests/resources/archive/airflow.json rename to elyra/tests/pipeline/resources/archive/airflow.json diff --git a/elyra/pipeline/tests/resources/archive/test.ipynb b/elyra/tests/pipeline/resources/archive/test.ipynb similarity index 100% rename from elyra/pipeline/tests/resources/archive/test.ipynb rename to elyra/tests/pipeline/resources/archive/test.ipynb diff --git a/elyra/tests/pipeline/resources/components/__init__.py b/elyra/tests/pipeline/resources/components/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/pipeline/tests/resources/components/airflow_test_operator.py b/elyra/tests/pipeline/resources/components/airflow_test_operator.py similarity index 100% rename from elyra/pipeline/tests/resources/components/airflow_test_operator.py rename to elyra/tests/pipeline/resources/components/airflow_test_operator.py diff --git a/elyra/pipeline/tests/resources/components/airflow_test_operator_no_inputs.py b/elyra/tests/pipeline/resources/components/airflow_test_operator_no_inputs.py similarity index 100% rename from elyra/pipeline/tests/resources/components/airflow_test_operator_no_inputs.py rename to elyra/tests/pipeline/resources/components/airflow_test_operator_no_inputs.py diff --git a/elyra/pipeline/tests/resources/components/filter_text.yaml b/elyra/tests/pipeline/resources/components/filter_text.yaml similarity index 100% rename from elyra/pipeline/tests/resources/components/filter_text.yaml rename to elyra/tests/pipeline/resources/components/filter_text.yaml diff --git a/elyra/pipeline/tests/resources/components/kfp_test_operator.yaml b/elyra/tests/pipeline/resources/components/kfp_test_operator.yaml similarity index 100% rename from elyra/pipeline/tests/resources/components/kfp_test_operator.yaml rename to elyra/tests/pipeline/resources/components/kfp_test_operator.yaml diff --git a/elyra/pipeline/tests/resources/components/kfp_test_operator_no_inputs.yaml b/elyra/tests/pipeline/resources/components/kfp_test_operator_no_inputs.yaml similarity index 100% rename from elyra/pipeline/tests/resources/components/kfp_test_operator_no_inputs.yaml rename to elyra/tests/pipeline/resources/components/kfp_test_operator_no_inputs.yaml diff --git a/elyra/metadata/tests/__init__.py b/elyra/tests/pipeline/resources/node_util/__init__.py similarity index 100% rename from elyra/metadata/tests/__init__.py rename to elyra/tests/pipeline/resources/node_util/__init__.py diff --git a/elyra/pipeline/tests/resources/node_util/node.ipynb b/elyra/tests/pipeline/resources/node_util/node.ipynb similarity index 100% rename from elyra/pipeline/tests/resources/node_util/node.ipynb rename to elyra/tests/pipeline/resources/node_util/node.ipynb diff --git a/elyra/pipeline/tests/resources/node_util/node.py b/elyra/tests/pipeline/resources/node_util/node.py similarity index 96% rename from elyra/pipeline/tests/resources/node_util/node.py rename to elyra/tests/pipeline/resources/node_util/node.py index 050d5e348..d4f00a232 100644 --- a/elyra/pipeline/tests/resources/node_util/node.py +++ b/elyra/tests/pipeline/resources/node_util/node.py @@ -33,7 +33,7 @@ import os import requests # noqa -from elyra.pipeline.tests.resources.node_util.node_util import PythonNode +from elyra.tests.pipeline.resources.node_util.node_util import PythonNode # These getenv calls are here to help seed the environment variables diff --git a/elyra/pipeline/tests/resources/node_util/node_util.py b/elyra/tests/pipeline/resources/node_util/node_util.py similarity index 100% rename from elyra/pipeline/tests/resources/node_util/node_util.py rename to elyra/tests/pipeline/resources/node_util/node_util.py diff --git a/elyra/pipeline/tests/resources/palette.json b/elyra/tests/pipeline/resources/palette.json similarity index 100% rename from elyra/pipeline/tests/resources/palette.json rename to elyra/tests/pipeline/resources/palette.json diff --git a/elyra/pipeline/tests/resources/properties.json b/elyra/tests/pipeline/resources/properties.json similarity index 100% rename from elyra/pipeline/tests/resources/properties.json rename to elyra/tests/pipeline/resources/properties.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_3_node_sample.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_3_node_sample.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_3_node_sample.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_3_node_sample.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_3_node_sample_with_dependencies.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_3_node_sample_with_dependencies.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_3_node_sample_with_dependencies.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_3_node_sample_with_dependencies.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_dependency_complex.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_dependency_complex.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_dependency_complex.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_dependency_complex.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_dependency_simple.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_dependency_simple.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_dependency_simple.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_dependency_simple.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_invalid.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_invalid.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_invalid.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_invalid.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_multiple_pipeline_definitions.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_multiple_pipeline_definitions.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_multiple_pipeline_definitions.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_multiple_pipeline_definitions.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_valid.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_valid.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_valid.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_valid.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_airflow_components.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_airflow_components.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_airflow_components.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_airflow_components.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_invalid_list_values.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_invalid_list_values.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_invalid_list_values.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_invalid_list_values.json diff --git a/elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_supernode.json b/elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_supernode.json similarity index 100% rename from elyra/pipeline/tests/resources/sample_pipelines/pipeline_with_supernode.json rename to elyra/tests/pipeline/resources/sample_pipelines/pipeline_with_supernode.json diff --git a/elyra/pipeline/tests/resources/validation_pipelines/NotebookA.ipynb b/elyra/tests/pipeline/resources/validation_pipelines/NotebookA.ipynb similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/NotebookA.ipynb rename to elyra/tests/pipeline/resources/validation_pipelines/NotebookA.ipynb diff --git a/elyra/pipeline/tests/resources/validation_pipelines/aa_invalid_node_op.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/aa_invalid_node_op.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/aa_invalid_node_op.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/aa_invalid_node_op.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_basic_filepath_check.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_basic_filepath_check.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_basic_filepath_check.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_basic_filepath_check.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_basic_pipeline_only_notebook.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_basic_pipeline_only_notebook.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_basic_pipeline_only_notebook.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_basic_pipeline_only_notebook.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_basic_pipeline_with_scripts.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_basic_pipeline_with_scripts.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_basic_pipeline_with_scripts.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_basic_pipeline_with_scripts.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_double_cycle.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_double_cycle.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_double_cycle.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_double_cycle.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_dependency_file_path.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_dependency_file_path.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_dependency_file_path.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_dependency_file_path.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_hardware_resources.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_hardware_resources.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_hardware_resources.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_hardware_resources.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_image_name.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_image_name.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_image_name.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_image_name.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_structure.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_structure.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_invalid_node_property_structure.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_invalid_node_property_structure.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_malformed_basic_pipeline_only_notebook.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_malformed_basic_pipeline_only_notebook.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_malformed_basic_pipeline_only_notebook.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_malformed_basic_pipeline_only_notebook.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_single_cycle.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_single_cycle.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_single_cycle.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_single_cycle.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/generic_singleton.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/generic_singleton.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/generic_singleton.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/generic_singleton.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_op.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_op.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_op.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_op.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_op_with_supernode.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_op_with_supernode.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_op_with_supernode.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_op_with_supernode.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_property_in_component.pipeline b/elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_property_in_component.pipeline similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/kf_invalid_node_property_in_component.pipeline rename to elyra/tests/pipeline/resources/validation_pipelines/kf_invalid_node_property_in_component.pipeline diff --git a/elyra/pipeline/tests/resources/validation_pipelines/subdirectoryA/TestFileA.txt b/elyra/tests/pipeline/resources/validation_pipelines/subdirectoryA/TestFileA.txt similarity index 100% rename from elyra/pipeline/tests/resources/validation_pipelines/subdirectoryA/TestFileA.txt rename to elyra/tests/pipeline/resources/validation_pipelines/subdirectoryA/TestFileA.txt diff --git a/elyra/pipeline/tests/test_handlers.py b/elyra/tests/pipeline/test_handlers.py similarity index 97% rename from elyra/pipeline/tests/test_handlers.py rename to elyra/tests/pipeline/test_handlers.py index 52a335051..2d18a5392 100644 --- a/elyra/pipeline/tests/test_handlers.py +++ b/elyra/tests/pipeline/test_handlers.py @@ -16,7 +16,7 @@ import json -from elyra.pipeline.tests import resources +from elyra.tests.pipeline import resources # from jupyter_server.tests.utils import expected_http_error # from tornado.httpclient import HTTPClientError diff --git a/elyra/pipeline/tests/test_pipeline_constructor.py b/elyra/tests/pipeline/test_pipeline_constructor.py similarity index 100% rename from elyra/pipeline/tests/test_pipeline_constructor.py rename to elyra/tests/pipeline/test_pipeline_constructor.py diff --git a/elyra/pipeline/tests/test_pipeline_definition.py b/elyra/tests/pipeline/test_pipeline_definition.py similarity index 98% rename from elyra/pipeline/tests/test_pipeline_definition.py rename to elyra/tests/pipeline/test_pipeline_definition.py index 9454ada23..2211ee2ff 100644 --- a/elyra/pipeline/tests/test_pipeline_definition.py +++ b/elyra/tests/pipeline/test_pipeline_definition.py @@ -14,7 +14,7 @@ # limitations under the License. # from elyra.pipeline.pipeline_definition import PipelineDefinition -from elyra.pipeline.tests.util import _read_pipeline_resource +from elyra.tests.pipeline.util import _read_pipeline_resource def test_valid_pipeline(): diff --git a/elyra/pipeline/tests/test_pipeline_parser.py b/elyra/tests/pipeline/test_pipeline_parser.py similarity index 99% rename from elyra/pipeline/tests/test_pipeline_parser.py rename to elyra/tests/pipeline/test_pipeline_parser.py index 857fb4b34..9d9007cb4 100644 --- a/elyra/pipeline/tests/test_pipeline_parser.py +++ b/elyra/tests/pipeline/test_pipeline_parser.py @@ -17,7 +17,7 @@ from elyra.pipeline.parser import PipelineParser from elyra.pipeline.pipeline import GenericOperation -from elyra.pipeline.tests.util import _read_pipeline_resource +from elyra.tests.pipeline.util import _read_pipeline_resource @pytest.fixture diff --git a/elyra/pipeline/tests/test_validation.py b/elyra/tests/pipeline/test_validation.py similarity index 99% rename from elyra/pipeline/tests/test_validation.py rename to elyra/tests/pipeline/test_validation.py index fa5275bb0..75fac028e 100644 --- a/elyra/pipeline/tests/test_validation.py +++ b/elyra/tests/pipeline/test_validation.py @@ -20,9 +20,9 @@ from elyra.pipeline.pipeline import PIPELINE_CURRENT_VERSION from elyra.pipeline.pipeline_definition import PipelineDefinition -from elyra.pipeline.tests.util import _read_pipeline_resource from elyra.pipeline.validation import PipelineValidationManager from elyra.pipeline.validation import ValidationResponse +from elyra.tests.pipeline.util import _read_pipeline_resource @pytest.fixture diff --git a/elyra/pipeline/tests/util.py b/elyra/tests/pipeline/util.py similarity index 100% rename from elyra/pipeline/tests/util.py rename to elyra/tests/pipeline/util.py diff --git a/elyra/tests/util/__init__.py b/elyra/tests/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elyra/util/tests/test_archive.py b/elyra/tests/util/test_archive.py similarity index 100% rename from elyra/util/tests/test_archive.py rename to elyra/tests/util/test_archive.py