diff --git a/src/snowflake/cli/plugins/nativeapp/commands.py b/src/snowflake/cli/plugins/nativeapp/commands.py index c104f7f961..ae94c93501 100644 --- a/src/snowflake/cli/plugins/nativeapp/commands.py +++ b/src/snowflake/cli/plugins/nativeapp/commands.py @@ -285,6 +285,7 @@ def app_teardown( @app.command("deploy", requires_connection=True) @with_project_definition() +@nativeapp_definition_v2_to_v1 def app_deploy( prune: Optional[bool] = typer.Option( default=None, @@ -351,6 +352,7 @@ def app_deploy( @app.command("validate", requires_connection=True) @with_project_definition() +@nativeapp_definition_v2_to_v1 def app_validate(**options): """ Validates a deployed Snowflake Native App's setup script. diff --git a/tests_integration/nativeapp/__snapshots__/test_deploy.ambr b/tests_integration/nativeapp/__snapshots__/test_deploy.ambr index f72c71c40c..002cfe8f03 100644 --- a/tests_integration/nativeapp/__snapshots__/test_deploy.ambr +++ b/tests_integration/nativeapp/__snapshots__/test_deploy.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_nativeapp_deploy +# name: test_nativeapp_deploy[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. @@ -14,7 +14,7 @@ ''' # --- -# name: test_nativeapp_deploy_dot +# name: test_nativeapp_deploy[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. @@ -29,20 +29,78 @@ ''' # --- -# name: test_nativeapp_deploy_files +# name: test_nativeapp_deploy_dot[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[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. Application package and stage are up-to-date. + + ''' +# --- +# name: test_nativeapp_deploy_files[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[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. Application package and stage are up-to-date. + + ''' +# --- +# name: test_nativeapp_deploy_looks_for_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 +# name: test_nativeapp_deploy_looks_for_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. @@ -57,7 +115,7 @@ ''' # --- -# name: test_nativeapp_deploy_nested_directories +# name: test_nativeapp_deploy_nested_directories[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. @@ -69,7 +127,55 @@ ''' # --- -# name: test_nativeapp_deploy_prune[app deploy --no-prune-contains2-not_contains2] +# name: test_nativeapp_deploy_nested_directories[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. Application package and stage are up-to-date. + + ''' +# --- +# name: test_nativeapp_deploy_prune[v1-app deploy --no-prune-contains2-not_contains2] + ''' + 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[v1-app deploy --no-validate-contains1-not_contains1] + ''' + 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[v1-app deploy --prune --no-validate-contains0-not_contains0] + ''' + 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[v2-app deploy --no-prune-contains2-not_contains2] ''' 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. @@ -83,7 +189,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[app deploy --no-validate-contains1-not_contains1] +# name: test_nativeapp_deploy_prune[v2-app deploy --no-validate-contains1-not_contains1] ''' 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. @@ -94,7 +200,7 @@ ''' # --- -# name: test_nativeapp_deploy_prune[app deploy --prune --no-validate-contains0-not_contains0] +# name: test_nativeapp_deploy_prune[v2-app deploy --prune --no-validate-contains0-not_contains0] ''' 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/test_deploy.py b/tests_integration/nativeapp/test_deploy.py index b54b4b0fb9..cf4747a96e 100644 --- a/tests_integration/nativeapp/test_deploy.py +++ b/tests_integration/nativeapp/test_deploy.py @@ -28,6 +28,7 @@ not_contains_row_with, pushd, row_from_snowflake_session, + enable_definition_v2_feature_flag, ) from tests_integration.testing_utils import ( assert_that_result_failed_with_message_containing, @@ -46,21 +47,18 @@ def sanitize_deploy_output(output): # Tests a simple flow of executing "snow app deploy", verifying that an application package was created, and an application was not @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy( + definition_version, + project_directory, runner, snowflake_session, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - result = runner.invoke_json( - ["app", "init", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_name)): + with project_directory(f"napp_init_{definition_version}"): result = runner.invoke_with_connection( ["app", "deploy"], env=TEST_ENV, @@ -117,6 +115,7 @@ def test_nativeapp_deploy( @pytest.mark.integration +@enable_definition_v2_feature_flag @pytest.mark.parametrize( "command,contains,not_contains", [ @@ -132,24 +131,19 @@ def test_nativeapp_deploy( ["app deploy --no-prune", ["stage/README.md"], []], ], ) +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_prune( command, contains, not_contains, + definition_version, + project_directory, runner, - snowflake_session, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - result = runner.invoke_json( - ["app", "init", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_name)): + with project_directory(f"napp_init_{definition_version}"): result = runner.invoke_with_connection_json( ["app", "deploy"], env=TEST_ENV, @@ -198,20 +192,17 @@ def test_nativeapp_deploy_prune( # Tests a simple flow of executing "snow app deploy [files]", verifying that only the specified files are synced to the stage @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_files( + definition_version, + project_directory, runner, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - result = runner.invoke_json( - ["app", "init", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_name)): + with project_directory(f"napp_init_{definition_version}"): # sync only two specific files to stage result = runner.invoke_with_connection( [ @@ -258,21 +249,17 @@ def test_nativeapp_deploy_files( # Tests that files inside of a symlinked directory are deployed @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_nested_directories( + definition_version, + project_directory, runner, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): # create nested file under app/ touch("app/nested/dir/file.txt") @@ -312,19 +299,15 @@ def test_nativeapp_deploy_nested_directories( # Tests that deploying a directory recursively syncs all of its contents @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_directory( + definition_version, + project_directory, runner, - temporary_working_directory, ): project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): touch("app/dir/file.txt") result = runner.invoke_with_connection( ["app", "deploy", "app/dir", "--no-recursive", "--no-validate"], @@ -367,19 +350,14 @@ def test_nativeapp_deploy_directory( # Tests that deploying a directory without specifying -r returns an error @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_directory_no_recursive( + definition_version, + project_directory, runner, - temporary_working_directory, ): - project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): try: touch("app/nested/dir/file.txt") result = runner.invoke_with_connection_json( @@ -399,19 +377,14 @@ def test_nativeapp_deploy_directory_no_recursive( # Tests that specifying an unknown path to deploy results in an error @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_unknown_path( + definition_version, + project_directory, runner, - temporary_working_directory, ): - project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): try: result = runner.invoke_with_connection_json( ["app", "deploy", "does_not_exist", "--no-validate"], @@ -431,19 +404,14 @@ def test_nativeapp_deploy_unknown_path( # Tests that specifying a path with no deploy artifact results in an error @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_path_with_no_mapping( + definition_version, + project_directory, runner, - temporary_working_directory, ): - project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): try: result = runner.invoke_with_connection_json( ["app", "deploy", "snowflake.yml", "--no-validate"], @@ -463,19 +431,14 @@ def test_nativeapp_deploy_path_with_no_mapping( # Tests that specifying a path and pruning result in an error @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_rejects_pruning_when_path_is_specified( + definition_version, + project_directory, runner, - temporary_working_directory, ): - project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): try: os.unlink("app/README.md") result = runner.invoke_with_connection_json( @@ -498,39 +461,19 @@ def test_nativeapp_deploy_rejects_pruning_when_path_is_specified( # Tests that specifying a path with no direct mapping falls back to search for prefix matches @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_looks_for_prefix_matches( + definition_version, + project_directory, runner, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - project_dir = Path(os.getcwd(), project_dir) - with pushd(project_dir): + with project_directory(f"napp_deploy_prefix_matches_{definition_version}"): try: - snowflake_yml = project_dir / "snowflake.yml" - project_definition_file = yaml.load( - snowflake_yml.read_text(), yaml.BaseLoader - ) - project_definition_file["native_app"]["artifacts"].append("src") - project_definition_file["native_app"]["artifacts"].append( - {"src": "lib/parent", "dest": "parent-lib"} - ) - snowflake_yml.write_text(yaml.dump(project_definition_file)) - - touch(str(project_dir / "src/main.py")) - - touch(str(project_dir / "lib/parent/child/a.py")) - touch(str(project_dir / "lib/parent/child/b.py")) - touch(str(project_dir / "lib/parent/child/c/c.py")) - result = runner.invoke_with_connection( ["app", "deploy", "-r", "app"], env=TEST_ENV, @@ -623,21 +566,17 @@ def test_nativeapp_deploy_looks_for_prefix_matches( # Tests that snow app deploy -r . deploys all changes @pytest.mark.integration +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) def test_nativeapp_deploy_dot( + definition_version, + project_directory, runner, - temporary_working_directory, snapshot, print_paths_as_posix, ): project_name = "myapp" - project_dir = "app root" - result = runner.invoke_json( - ["app", "init", project_dir, "--name", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0 - - with pushd(Path(os.getcwd(), project_dir)): + with project_directory(f"napp_init_{definition_version}"): try: result = runner.invoke_with_connection( ["app", "deploy", "-r", "."], diff --git a/tests_integration/nativeapp/test_validate.py b/tests_integration/nativeapp/test_validate.py index aaabf68dd1..73c69a207b 100644 --- a/tests_integration/nativeapp/test_validate.py +++ b/tests_integration/nativeapp/test_validate.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import uuid from snowflake.cli.api.project.util import generate_user_env from tests.project.fixtures import * from tests_integration.test_utils import ( - pushd, + enable_definition_v2_feature_flag, ) USER_NAME = f"user_{uuid.uuid4().hex}" @@ -26,15 +25,10 @@ @pytest.mark.integration -def test_nativeapp_validate(runner, temporary_working_directory): - project_name = "myapp" - result = runner.invoke_json( - ["app", "init", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0, result.output - - with pushd(Path(os.getcwd(), project_name)): +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) +def test_nativeapp_validate(definition_version, project_directory, runner): + with project_directory(f"napp_init_{definition_version}"): try: # validate the app's setup script result = runner.invoke_with_connection( @@ -52,15 +46,10 @@ def test_nativeapp_validate(runner, temporary_working_directory): @pytest.mark.integration -def test_nativeapp_validate_failing(runner, temporary_working_directory): - project_name = "myapp" - result = runner.invoke_json( - ["app", "init", project_name], - env=TEST_ENV, - ) - assert result.exit_code == 0, result.output - - with pushd(Path(os.getcwd(), project_name)): +@enable_definition_v2_feature_flag +@pytest.mark.parametrize("definition_version", ["v1", "v2"]) +def test_nativeapp_validate_failing(definition_version, project_directory, runner): + with project_directory(f"napp_init_{definition_version}"): # Create invalid SQL file Path("app/setup_script.sql").write_text("Lorem ipsum dolor sit amet") diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/README.md b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/README.md new file mode 100644 index 0000000000..f66bf75c9b --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/README.md @@ -0,0 +1,4 @@ +# README + +This directory contains an extremely simple application that is used for +integration testing SnowCLI. diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/manifest.yml b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/manifest.yml new file mode 100644 index 0000000000..5b8ef74e8a --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/manifest.yml @@ -0,0 +1,9 @@ +# This is a manifest.yml file, a required component of creating a Snowflake Native App. +# This file defines properties required by the application package, including the location of the setup script and version definitions. +# Refer to https://docs.snowflake.com/en/developer-guide/native-apps/creating-manifest for a detailed understanding of this file. + +manifest_version: 1 + +artifacts: + setup_script: setup_script.sql + readme: README.md diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/setup_script.sql b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/setup_script.sql new file mode 100644 index 0000000000..7fc3682b6e --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/app/setup_script.sql @@ -0,0 +1,11 @@ +-- This is the setup script that runs while installing a Snowflake Native App in a consumer account. +-- To write this script, you can familiarize yourself with some of the following concepts: +-- Application Roles +-- Versioned Schemas +-- UDFs/Procs +-- Extension Code +-- Refer to https://docs.snowflake.com/en/developer-guide/native-apps/creating-setup-script for a detailed understanding of this file. + +CREATE OR ALTER VERSIONED SCHEMA core; + +-- The rest of this script is left blank for purposes of your learning and exploration. diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/a.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/a.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/b.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/b.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/c/c.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/lib/parent/child/c/c.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/snowflake.yml b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/snowflake.yml new file mode 100644 index 0000000000..01b20a8f98 --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/snowflake.yml @@ -0,0 +1,10 @@ +definition_version: 1 +native_app: + name: myapp + source_stage: app_src.stage + artifacts: + - src: app/* + dest: ./ + - src + - src: lib/parent + dest: parent-lib diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/src/main.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v1/src/main.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/README.md b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/README.md new file mode 100644 index 0000000000..6a446bcf55 --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/README.md @@ -0,0 +1,3 @@ +# README + +This is the v2 version of the napp_deploy_prefix_matches_v1 project diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/manifest.yml b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/manifest.yml new file mode 100644 index 0000000000..1b444dab00 --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/manifest.yml @@ -0,0 +1,7 @@ +# This is the v2 version of the napp_deploy_prefix_matches_v1 project + +manifest_version: 1 + +artifacts: + setup_script: setup_script.sql + readme: README.md diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/setup_script.sql b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/setup_script.sql new file mode 100644 index 0000000000..352e2b23bf --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/app/setup_script.sql @@ -0,0 +1,3 @@ +-- This is the v2 version of the napp_deploy_prefix_matches_v1 project + +CREATE OR ALTER VERSIONED SCHEMA core; diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/a.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/a.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/b.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/b.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/c/c.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/lib/parent/child/c/c.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/snowflake.yml b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/snowflake.yml new file mode 100644 index 0000000000..966b0fb35f --- /dev/null +++ b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/snowflake.yml @@ -0,0 +1,19 @@ +# This is the v2 version of the napp_deploy_prefix_matches_v1 project definition + +definition_version: 2 +entities: + pkg: + type: application package + name: myapp_pkg_<% ctx.env.USER %> + artifacts: + - src: app/* + dest: ./ + - src + - src: lib/parent + dest: parent-lib + manifest: app/manifest.yml + app: + type: application + name: myapp_<% ctx.env.USER %> + from: + target: pkg diff --git a/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/src/main.py b/tests_integration/test_data/projects/napp_deploy_prefix_matches_v2/src/main.py new file mode 100644 index 0000000000..e69de29bb2