diff --git a/tests_integration/nativeapp/__snapshots__/test_deploy.ambr b/tests_integration/nativeapp/__snapshots__/test_deploy.ambr index 146eeeebf2..2f21ef98b9 100644 --- a/tests_integration/nativeapp/__snapshots__/test_deploy.ambr +++ b/tests_integration/nativeapp/__snapshots__/test_deploy.ambr @@ -44,21 +44,6 @@ ''' # --- -# name: test_nativeapp_deploy_dot[app deploy-napp_init_v1] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/README.md -> README.md - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Validating Snowflake Native App setup script. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- # name: test_nativeapp_deploy_dot[app deploy-napp_init_v2] ''' Creating new application package myapp_pkg_@@USER@@ in account. @@ -74,34 +59,6 @@ ''' # --- -# name: test_nativeapp_deploy_dot[ws deploy --entity-id=pkg-napp_init_v2] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/README.md -> README.md - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Validating Snowflake Native App setup script. - Deployed successfully. - - ''' -# --- -# name: test_nativeapp_deploy_files[app deploy --no-validate-napp_init_v1] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- # name: test_nativeapp_deploy_files[app deploy --no-validate-napp_init_v2] ''' Creating new application package myapp_pkg_@@USER@@ in account. @@ -115,34 +72,6 @@ ''' # --- -# name: test_nativeapp_deploy_files[ws deploy --entity-id=pkg --no-validate-napp_init_v2] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. - - ''' -# --- -# name: test_nativeapp_deploy_looks_for_prefix_matches[app deploy-napp_deploy_prefix_matches_v1] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/README.md -> README.md - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Validating Snowflake Native App setup script. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- # name: test_nativeapp_deploy_looks_for_prefix_matches[app deploy-napp_deploy_prefix_matches_v2] ''' Creating new application package myapp_pkg_@@USER@@ in account. @@ -158,33 +87,6 @@ ''' # --- -# name: test_nativeapp_deploy_looks_for_prefix_matches[ws deploy --entity-id=pkg-napp_deploy_prefix_matches_v2] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/README.md -> README.md - added: app/manifest.yml -> manifest.yml - added: app/setup_script.sql -> setup_script.sql - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Validating Snowflake Native App setup script. - Deployed successfully. - - ''' -# --- -# name: test_nativeapp_deploy_nested_directories[app deploy --no-validate-napp_init_v1] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/nested/dir/file.txt -> nested/dir/file.txt - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- # name: test_nativeapp_deploy_nested_directories[app deploy --no-validate-napp_init_v2] ''' Creating new application package myapp_pkg_@@USER@@ in account. @@ -197,33 +99,7 @@ ''' # --- -# name: test_nativeapp_deploy_nested_directories[ws deploy --entity-id=pkg --no-validate-napp_init_v2] - ''' - Creating new application package myapp_pkg_@@USER@@ in account. - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Local changes to be deployed: - added: app/nested/dir/file.txt -> nested/dir/file.txt - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. - - ''' -# --- -# name: test_nativeapp_deploy_prune[app deploy --no-prune-contains6-not_contains6-napp_init_v1] - ''' - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - The following files exist only on the stage: - README.md - - Use the --prune flag to delete them from the stage. - Your stage is up-to-date with your local deploy root. - Validating Snowflake Native App setup script. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- -# name: test_nativeapp_deploy_prune[app deploy --no-prune-contains7-not_contains7-napp_init_v2] +# name: test_nativeapp_deploy_prune[app deploy --no-prune-contains4-not_contains4-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. @@ -237,29 +113,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[app deploy --no-validate-contains3-not_contains3-napp_init_v1] - ''' - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Deleted paths to be removed from your stage: - deleted: README.md - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- -# name: test_nativeapp_deploy_prune[app deploy --no-validate-contains4-not_contains4-napp_init_v2] - ''' - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Deleted paths to be removed from your stage: - deleted: README.md - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. Application package and stage are up-to-date. - - ''' -# --- -# name: test_nativeapp_deploy_prune[app deploy --prune --no-validate-contains0-not_contains0-napp_init_v1] +# name: test_nativeapp_deploy_prune[app deploy --no-validate-contains2-not_contains2-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. @@ -270,7 +124,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[app deploy --prune --no-validate-contains1-not_contains1-napp_init_v2] +# name: test_nativeapp_deploy_prune[app deploy --prune --no-validate-contains0-not_contains0-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. @@ -281,7 +135,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --no-prune-contains8-not_contains8-napp_init_v2] +# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --no-prune-contains5-not_contains5-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. @@ -295,18 +149,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --no-validate-contains0-not_contains0-napp_init_v2] - ''' - Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. - Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. - Deleted paths to be removed from your stage: - deleted: README.md - Updating the Snowflake stage from your local @@DEPLOY_ROOT@@ directory. - Deployed successfully. - - ''' -# --- -# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --no-validate-contains5-not_contains5-napp_init_v2] +# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --no-validate-contains3-not_contains3-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. @@ -317,7 +160,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --prune --no-validate-contains2-not_contains2-napp_init_v2] +# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --prune --no-validate-contains1-not_contains1-napp_init_v2] ''' Checking if stage myapp_pkg_@@USER@@.app_src.stage exists, or creating a new one if none exists. Performing a diff between the Snowflake stage and your local deploy_root ('@@DEPLOY_ROOT@@') directory. diff --git a/tests_integration/nativeapp/__snapshots__/test_version.ambr b/tests_integration/nativeapp/__snapshots__/test_version.ambr index 49960a36ea..56183312cd 100644 --- a/tests_integration/nativeapp/__snapshots__/test_version.ambr +++ b/tests_integration/nativeapp/__snapshots__/test_version.ambr @@ -1,30 +1,4 @@ # serializer version: 1 -# name: test_nativeapp_version_create_package_no_magic_comment[app version create-app version list-app version drop-napp_init_v1] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- # name: test_nativeapp_version_create_package_no_magic_comment[app version create-app version list-app version drop-napp_init_v2] list([ dict({ @@ -51,263 +25,3 @@ }), ]) # --- -# name: test_nativeapp_version_create_package_no_magic_comment[app version create-app version list-ws version drop --entity-id=pkg-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[app version create-ws version list --entity-id=pkg-app version drop-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[app version create-ws version list --entity-id=pkg-ws version drop --entity-id=pkg-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[app version list-napp_init_v1] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[app version list-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[ws version create --entity-id=pkg-app version list-app version drop-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[ws version create --entity-id=pkg-app version list-ws version drop --entity-id=pkg-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[ws version create --entity-id=pkg-ws version list --entity-id=pkg-app version drop-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[ws version create --entity-id=pkg-ws version list --entity-id=pkg-ws version drop --entity-id=pkg-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- -# name: test_nativeapp_version_create_package_no_magic_comment[ws version list --entity-id=pkg-napp_init_v2] - list([ - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 0, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - dict({ - 'comment': None, - 'dropped_on': None, - 'label': None, - 'log_level': 'OFF', - 'patch': 1, - 'review_status': 'NOT_REVIEWED', - 'state': 'READY', - 'trace_level': 'OFF', - 'version': 'V1', - }), - ]) -# --- diff --git a/tests_integration/nativeapp/test_bundle.py b/tests_integration/nativeapp/test_bundle.py index 97f53b810c..654f874574 100644 --- a/tests_integration/nativeapp/test_bundle.py +++ b/tests_integration/nativeapp/test_bundle.py @@ -25,6 +25,15 @@ ) +@pytest.fixture +def template_setup(runner, nativeapp_project_directory): + command = "app bundle" + test_project = "napp_init_v1" + yield from _template_setup( + runner, nativeapp_project_directory, command, test_project + ) + + @pytest.fixture( scope="function", params=[ @@ -33,12 +42,19 @@ ["ws bundle --entity-id=pkg", "napp_init_v2"], ], ) -def template_setup(runner, nativeapp_project_directory, request): +def template_setup_all(runner, nativeapp_project_directory, request): + """Tests all permutations. Only necessary for a happy-path test""" + command, test_project = request.param + yield from _template_setup( + runner, nativeapp_project_directory, command, test_project + ) + + +def _template_setup(runner, nativeapp_project_directory, command, test_project): """ Sets up a project directory and runs the bundle command on the application package. Returns (project_root, execute_bundle_command, test_project) """ - command, test_project = request.param with nativeapp_project_directory(test_project) as project_root: # Vanilla bundle on the unmodified template if command.startswith("ws"): @@ -97,9 +113,9 @@ def override_snowflake_yml_artifacts( # Tests that we copy files/directories directly to the deploy root instead of creating symlinks. @pytest.mark.integration def test_nativeapp_bundle_does_explicit_copy( - template_setup, + template_setup_all, ): - project_root, execute_bundle_command, definition_version = template_setup + project_root, execute_bundle_command, definition_version = template_setup_all override_snowflake_yml_artifacts( definition_version, diff --git a/tests_integration/nativeapp/test_deploy.py b/tests_integration/nativeapp/test_deploy.py index 8312fcd3cc..f07710f571 100644 --- a/tests_integration/nativeapp/test_deploy.py +++ b/tests_integration/nativeapp/test_deploy.py @@ -111,12 +111,6 @@ def test_nativeapp_deploy( "command,contains,not_contains,test_project", [ # deploy --prune removes remote-only files - [ - "app deploy --prune --no-validate", - ["stage/manifest.yml"], - ["stage/README.md"], - "napp_init_v1", - ], [ "app deploy --prune --no-validate", ["stage/manifest.yml"], @@ -130,12 +124,6 @@ def test_nativeapp_deploy( "napp_init_v2", ], # deploy removes remote-only files (--prune is the default value) - [ - "app deploy --no-validate", - ["stage/manifest.yml"], - ["stage/README.md"], - "napp_init_v1", - ], [ "app deploy --no-validate", ["stage/manifest.yml"], @@ -149,12 +137,6 @@ def test_nativeapp_deploy( "napp_init_v2", ], # deploy --no-prune does not delete remote-only files - [ - "app deploy --no-prune", - ["stage/README.md"], - [], - "napp_init_v1", - ], [ "app deploy --no-prune", ["stage/README.md"], @@ -212,9 +194,7 @@ def test_nativeapp_deploy_prune( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_files( @@ -257,9 +237,7 @@ def test_nativeapp_deploy_files( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_nested_directories( @@ -299,9 +277,7 @@ def test_nativeapp_deploy_nested_directories( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_directory( @@ -339,9 +315,7 @@ def test_nativeapp_deploy_directory( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_directory_no_recursive( @@ -361,9 +335,7 @@ def test_nativeapp_deploy_directory_no_recursive( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_unknown_path( @@ -383,9 +355,7 @@ def test_nativeapp_deploy_unknown_path( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy --no-validate", "napp_init_v1"], ["app deploy --no-validate", "napp_init_v2"], - ["ws deploy --entity-id=pkg --no-validate", "napp_init_v2"], ], ) def test_nativeapp_deploy_path_with_no_mapping( @@ -405,9 +375,7 @@ def test_nativeapp_deploy_path_with_no_mapping( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy", "napp_init_v1"], ["app deploy", "napp_init_v2"], - ["ws deploy --entity-id=pkg", "napp_init_v2"], ], ) def test_nativeapp_deploy_rejects_pruning_when_path_is_specified( @@ -433,9 +401,7 @@ def test_nativeapp_deploy_rejects_pruning_when_path_is_specified( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy", "napp_deploy_prefix_matches_v1"], ["app deploy", "napp_deploy_prefix_matches_v2"], - ["ws deploy --entity-id=pkg", "napp_deploy_prefix_matches_v2"], ], ) def test_nativeapp_deploy_looks_for_prefix_matches( @@ -523,9 +489,7 @@ def test_nativeapp_deploy_looks_for_prefix_matches( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy", "napp_init_v1"], ["app deploy", "napp_init_v2"], - ["ws deploy --entity-id=pkg", "napp_init_v2"], ], ) def test_nativeapp_deploy_dot( @@ -559,9 +523,7 @@ def test_nativeapp_deploy_dot( @pytest.mark.parametrize( "command,test_project", [ - ["app deploy", "napp_init_v1"], ["app deploy", "napp_init_v2"], - ["ws deploy --entity-id=pkg", "napp_init_v2"], ], ) def test_nativeapp_deploy_validate_failing( @@ -580,13 +542,7 @@ def test_nativeapp_deploy_validate_failing( @pytest.mark.integration -@pytest.mark.parametrize( - "test_project", - [ - "napp_init_v1", - "napp_init_v2", - ], -) +@pytest.mark.parametrize("test_project", ["napp_init_v2"]) def test_nativeapp_deploy_package_no_magic_comment( runner, snowflake_session, diff --git a/tests_integration/nativeapp/test_events.py b/tests_integration/nativeapp/test_events.py index fe846cd5c2..836e59790b 100644 --- a/tests_integration/nativeapp/test_events.py +++ b/tests_integration/nativeapp/test_events.py @@ -19,7 +19,7 @@ # Tests that snow app events with incompatible flags exits with an error @pytest.mark.integration -@pytest.mark.parametrize("test_project", ["napp_init_v1", "napp_init_v2"]) +@pytest.mark.parametrize("test_project", ["napp_init_v2"]) @pytest.mark.parametrize( ["flag_names", "command"], [ @@ -52,7 +52,7 @@ def test_app_events_mutually_exclusive_options( # Tests that snow app events without paired flags exits with an error @pytest.mark.integration -@pytest.mark.parametrize("test_project", ["napp_init_v1", "napp_init_v2"]) +@pytest.mark.parametrize("test_project", ["napp_init_v2"]) @pytest.mark.parametrize( ["flag_names", "command"], [ @@ -80,7 +80,7 @@ def test_app_events_paired_options( @pytest.mark.integration -@pytest.mark.parametrize("test_project", ["napp_init_v1", "napp_init_v2"]) +@pytest.mark.parametrize("test_project", ["napp_init_v2"]) def test_app_events_reject_invalid_type( test_project, runner, nativeapp_project_directory ): diff --git a/tests_integration/nativeapp/test_init_run.py b/tests_integration/nativeapp/test_init_run.py index f8165f13dc..57c9488d6d 100644 --- a/tests_integration/nativeapp/test_init_run.py +++ b/tests_integration/nativeapp/test_init_run.py @@ -178,9 +178,7 @@ def test_nativeapp_run_existing( @pytest.mark.parametrize( "command,test_project", [ - ["app run", "napp_init_v1"], ["app run", "napp_init_v2"], - ["ws deploy --entity-id=app", "napp_init_v2"], ], ) def test_nativeapp_init_run_handles_spaces( @@ -222,9 +220,7 @@ def test_nativeapp_init_run_handles_spaces( @pytest.mark.parametrize( "command,test_project", [ - ["app run", "integration_external"], ["app run", "integration_external_v2"], - ["ws deploy --entity-id=app", "integration_external_v2"], ], ) def test_nativeapp_run_existing_w_external( @@ -293,9 +289,7 @@ def test_nativeapp_run_existing_w_external( @pytest.mark.parametrize( "base_command,test_project", [ - ["app", "napp_init_v1"], ["app", "napp_init_v2"], - ["ws", "napp_init_v2"], ], ) def test_nativeapp_run_after_deploy( @@ -349,9 +343,7 @@ def test_nativeapp_run_after_deploy( @pytest.mark.parametrize( "command,test_project", [ - ["app run", "integration_external"], ["app run", "integration_external_v2"], - ["ws deploy --entity-id=app", "integration_external_v2"], ], ) @pytest.mark.parametrize("force_flag", [True, False]) @@ -447,7 +439,7 @@ def test_nativeapp_run_orphan( # run configurations as long as we pass the --force flag to "app run" # TODO: add back all parameterizations and implement --force for "app teardown" @pytest.mark.integration -@pytest.mark.parametrize("test_project", ["napp_init_v1", "napp_init_v2"]) +@pytest.mark.parametrize("test_project", ["napp_init_v2"]) @pytest.mark.parametrize( "run_args_from, run_args_to", [ diff --git a/tests_integration/nativeapp/test_large_upload.py b/tests_integration/nativeapp/test_large_upload.py index 9331f2e367..729caa6eb3 100644 --- a/tests_integration/nativeapp/test_large_upload.py +++ b/tests_integration/nativeapp/test_large_upload.py @@ -30,9 +30,7 @@ reason="Requires AWS + python connector to support threshold=" ) @pytest.mark.integration -@pytest.mark.parametrize( - "project_definition_files", ["integration", "integration_v2"], indirect=True -) +@pytest.mark.parametrize("project_definition_files", ["integration_v2"], indirect=True) def test_large_upload_skips_reupload( runner, snowflake_session, diff --git a/tests_integration/nativeapp/test_post_deploy.py b/tests_integration/nativeapp/test_post_deploy.py index bf86b080b3..69c48213a9 100644 --- a/tests_integration/nativeapp/test_post_deploy.py +++ b/tests_integration/nativeapp/test_post_deploy.py @@ -205,9 +205,7 @@ def test_nativeapp_post_deploy( @pytest.mark.parametrize( "base_command,test_project", [ - ["app", "napp_application_post_deploy_v1"], ["app", "napp_application_post_deploy_v2"], - ["ws", "napp_application_post_deploy_v2"], ], ) def test_nativeapp_post_deploy_with_windows_path( diff --git a/tests_integration/nativeapp/test_project_templating.py b/tests_integration/nativeapp/test_project_templating.py index ad8753edda..ebd3c2eb23 100644 --- a/tests_integration/nativeapp/test_project_templating.py +++ b/tests_integration/nativeapp/test_project_templating.py @@ -96,7 +96,7 @@ def test_nativeapp_project_templating_use_env_from_os( @pytest.mark.integration @pytest.mark.parametrize( "project_definition_files", - ["integration_templated", "integration_templated_v2"], + ["integration_templated_v2"], indirect=True, ) def test_nativeapp_project_templating_use_env_from_os_through_intermediate_var( @@ -165,7 +165,7 @@ def test_nativeapp_project_templating_use_env_from_os_through_intermediate_var( @pytest.mark.integration @pytest.mark.parametrize( "project_definition_files", - ["integration_templated", "integration_templated_v2"], + ["integration_templated_v2"], indirect=True, ) def test_nativeapp_project_templating_use_default_env_from_project( @@ -234,7 +234,7 @@ def test_nativeapp_project_templating_use_default_env_from_project( @pytest.mark.integration @pytest.mark.parametrize( "project_definition_files", - ["integration_templated", "integration_templated_v2"], + ["integration_templated_v2"], indirect=True, ) def test_nativeapp_project_templating_use_env_from_cli_as_highest_priority( @@ -312,7 +312,7 @@ def test_nativeapp_project_templating_use_env_from_cli_as_highest_priority( @pytest.mark.integration @pytest.mark.parametrize( "project_definition_files", - ["integration_templated", "integration_templated_v2"], + ["integration_templated_v2"], indirect=True, ) def test_nativeapp_project_templating_bundle_deploy_successful( @@ -341,9 +341,7 @@ def test_nativeapp_project_templating_bundle_deploy_successful( @pytest.mark.integration -@pytest.mark.parametrize( - "test_project", ["napp_templates_processors_v1", "napp_templates_processors_v2"] -) +@pytest.mark.parametrize("test_project", ["napp_templates_processors_v2"]) @pytest.mark.parametrize("with_project_flag", [True, False]) def test_nativeapp_templates_processor_with_run( runner, @@ -389,9 +387,7 @@ def test_nativeapp_templates_processor_with_run( @pytest.mark.integration -@pytest.mark.parametrize( - "test_project", ["napp_templates_processors_v1", "napp_templates_processors_v2"] -) +@pytest.mark.parametrize("test_project", ["napp_templates_processors_v2"]) @pytest.mark.parametrize("with_project_flag", [True, False]) def test_nativeapp_templates_processor_with_deploy( runner, diff --git a/tests_integration/nativeapp/test_teardown.py b/tests_integration/nativeapp/test_teardown.py index 21399058f0..44c94a8389 100644 --- a/tests_integration/nativeapp/test_teardown.py +++ b/tests_integration/nativeapp/test_teardown.py @@ -174,9 +174,7 @@ def test_nativeapp_teardown_cascade( @pytest.mark.parametrize( "command,test_project", [ - ["app teardown", "napp_init_v1"], ["app teardown", "napp_init_v2"], - ["ws drop --entity-id=app", "napp_init_v2"], ], ) def test_nativeapp_teardown_unowned_app( @@ -212,9 +210,7 @@ def test_nativeapp_teardown_unowned_app( @pytest.mark.parametrize( "command,test_project", [ - ["app teardown", "napp_init_v1"], ["app teardown", "napp_init_v2"], - ["ws drop --entity-id=pkg", "napp_init_v2"], ], ) def test_nativeapp_teardown_pkg_versions( diff --git a/tests_integration/nativeapp/test_validate.py b/tests_integration/nativeapp/test_validate.py index 52b75b042d..2b67a3342c 100644 --- a/tests_integration/nativeapp/test_validate.py +++ b/tests_integration/nativeapp/test_validate.py @@ -40,9 +40,7 @@ def test_nativeapp_validate(command, test_project, nativeapp_project_directory, @pytest.mark.parametrize( "command,test_project", [ - ["app validate", "napp_init_v1"], ["app validate", "napp_init_v2"], - ["ws validate --entity-id=pkg", "napp_init_v2"], ], ) def test_nativeapp_validate_failing( diff --git a/tests_integration/nativeapp/test_version.py b/tests_integration/nativeapp/test_version.py index d6f7965654..72b0de756a 100644 --- a/tests_integration/nativeapp/test_version.py +++ b/tests_integration/nativeapp/test_version.py @@ -48,48 +48,32 @@ def normalize_identifier(identifier: Union[str, int]) -> str: return unquote_identifier(to_identifier(id_str)) -@pytest.fixture(params=["napp_init_v1", "napp_init_v2"]) -def _test_project(request): - return request.param - - -@pytest.fixture(params=["app version create", "ws version create --entity-id=pkg"]) -def _create_command(request): - return request.param - - -@pytest.fixture(params=["app version list", "ws version list --entity-id=pkg"]) -def _list_command(request): - return request.param - - -@pytest.fixture(params=["app version drop", "ws version drop --entity-id=pkg"]) -def _drop_command(request): - return request.param - - -@pytest.fixture() -def command_parametrization( - _create_command, _list_command, _drop_command, _test_project -): - if "v1" in _test_project and ( - "ws" in " ".join([_create_command, _list_command, _drop_command]) - ): - pytest.skip("ws commands are not supported on v1 projects") - return _create_command, _list_command, _drop_command, _test_project - - # Tests a simple flow of an existing project, executing snow app version create, drop and teardown, all with distribution=internal @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [ + ["app version create", "app version list", "app version drop", "napp_init_v1"], + ["app version create", "app version list", "app version drop", "napp_init_v2"], + [ + "ws version create --entity-id=pkg", + "ws version list --entity-id=pkg", + "ws version drop --entity-id=pkg", + "napp_init_v2", + ], + ], +) def test_nativeapp_version_create_and_drop( runner, snowflake_session, default_username, resource_suffix, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization project_name = "myapp" with nativeapp_project_directory(test_project): result_create = runner.invoke_with_connection_json( @@ -125,15 +109,21 @@ def test_nativeapp_version_create_and_drop( # Tests upgrading an app from an existing loose files installation to versioned installation. @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [["app version create", "app version list", "app version drop", "napp_init_v2"]], +) def test_nativeapp_upgrade( runner, snowflake_session, default_username, resource_suffix, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization project_name = "myapp" with nativeapp_project_directory(test_project): runner.invoke_with_connection_json(["app", "run"]) @@ -165,6 +155,10 @@ def test_nativeapp_upgrade( # Make sure we can create 3+ patches on the same version @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [["app version create", "app version list", "app version drop", "napp_init_v2"]], +) def test_nativeapp_version_create_3_patches( runner, snowflake_session, @@ -172,9 +166,11 @@ def test_nativeapp_version_create_3_patches( resource_suffix, nativeapp_teardown, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization project_name = "myapp" with nativeapp_project_directory(test_project): package_name = f"{project_name}_pkg_{default_username}{resource_suffix}".upper() @@ -208,6 +204,10 @@ def test_nativeapp_version_create_3_patches( @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [["app version create", "app version list", "app version drop", "napp_init_v2"]], +) def test_nativeapp_version_create_patch_is_integer( runner, snowflake_session, @@ -215,9 +215,11 @@ def test_nativeapp_version_create_patch_is_integer( resource_suffix, nativeapp_teardown, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization with nativeapp_project_directory(test_project): # create initial version result = runner.invoke_with_connection_json( @@ -273,6 +275,10 @@ def test_nativeapp_version_create_patch_is_integer( # Tests creating a version for a package that was not created by the CLI # (doesn't have the magic CLI comment) @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [["app version create", "app version list", "app version drop", "napp_init_v2"]], +) def test_nativeapp_version_create_package_no_magic_comment( runner, snowflake_session, @@ -281,9 +287,11 @@ def test_nativeapp_version_create_package_no_magic_comment( nativeapp_teardown, snapshot, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization project_name = "myapp" with nativeapp_project_directory(test_project): result_create_abort = runner.invoke_with_connection_json(["app", "deploy"]) @@ -355,15 +363,21 @@ def test_nativeapp_version_create_package_no_magic_comment( # Tests a simple flow of an existing project, executing snow app version create, drop and teardown, all with distribution=internal @pytest.mark.integration +@pytest.mark.parametrize( + "create_command,list_command,drop_command,test_project", + [["app version create", "app version list", "app version drop", "napp_init_v2"]], +) def test_nativeapp_version_create_and_drop_from_manifest( runner, snowflake_session, default_username, resource_suffix, nativeapp_project_directory, - command_parametrization, + create_command, + list_command, + drop_command, + test_project, ): - create_command, list_command, drop_command, test_project = command_parametrization with nativeapp_project_directory(test_project) as project_dir: # not using pytest parameterization here because we need # to guarantee that the initial version gets created before the patches