Skip to content

Commit

Permalink
parametrize deply intg tests with ws
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-gbloom committed Aug 22, 2024
1 parent 9a4d6a0 commit 550c3cf
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ def append_test_resource_suffix_to_identifier(
if isinstance(input_value, Identifier):
return input_value.model_copy(update=dict(name=with_suffix))
return with_suffix

@field_validator("artifacts")
@classmethod
def transform_artifacts(
cls, orig_artifacts: List[Union[PathMapping, str]]
) -> List[PathMapping]:
transformed_artifacts = []
if orig_artifacts is None:
return transformed_artifacts

for artifact in orig_artifacts:
if isinstance(artifact, PathMapping):
transformed_artifacts.append(artifact)
else:
transformed_artifacts.append(PathMapping(src=artifact))

return transformed_artifacts
168 changes: 150 additions & 18 deletions tests_integration/nativeapp/__snapshots__/test_deploy.ambr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_nativeapp_deploy[napp_init_v1]
# name: test_nativeapp_deploy[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.
Expand All @@ -14,7 +14,7 @@

'''
# ---
# name: test_nativeapp_deploy[napp_init_v2]
# name: test_nativeapp_deploy[app deploy-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.
Expand All @@ -29,7 +29,21 @@

'''
# ---
# name: test_nativeapp_deploy_dot[napp_init_v1]
# name: test_nativeapp_deploy[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.
Deployed successfully.

'''
# ---
# 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.
Expand All @@ -44,7 +58,7 @@

'''
# ---
# name: test_nativeapp_deploy_dot[napp_init_v2]
# name: test_nativeapp_deploy_dot[app deploy-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.
Expand All @@ -59,28 +73,85 @@

'''
# ---
# name: test_nativeapp_deploy_files[napp_init_v1]
# 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.
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.
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[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/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_files[napp_init_v2]
# name: test_nativeapp_deploy_looks_for_prefix_matches[app deploy-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. Application package and stage are up-to-date.

'''
Expand Down Expand Up @@ -115,7 +186,21 @@

'''
# ---
# name: test_nativeapp_deploy_nested_directories[napp_init_v1]
# 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.
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.
Expand All @@ -127,7 +212,7 @@

'''
# ---
# name: test_nativeapp_deploy_nested_directories[napp_init_v2]
# name: test_nativeapp_deploy_nested_directories[app deploy --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.
Expand All @@ -139,7 +224,19 @@

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v1-app deploy --no-prune-contains2-not_contains2]
# name: test_nativeapp_deploy_nested_directories[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/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.
Expand All @@ -153,7 +250,32 @@

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v1-app deploy --no-validate-contains1-not_contains1]
# name: test_nativeapp_deploy_prune[app deploy --no-prune-contains7-not_contains7-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.
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-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.
Expand All @@ -164,7 +286,7 @@

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v1-app deploy --prune --no-validate-contains0-not_contains0]
# name: test_nativeapp_deploy_prune[app deploy --prune --no-validate-contains0-not_contains0-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.
Expand All @@ -175,7 +297,18 @@

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v2-app deploy --no-prune-contains2-not_contains2]
# name: test_nativeapp_deploy_prune[app deploy --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.
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[ws deploy --entity-id=pkg --no-prune-contains8-not_contains8-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.
Expand All @@ -184,30 +317,29 @@

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.
Deployed successfully.

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v2-app deploy --no-validate-contains1-not_contains1]
# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg --prune-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.
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.
Deployed successfully.

'''
# ---
# name: test_nativeapp_deploy_prune[napp_init_v2-app deploy --prune --no-validate-contains0-not_contains0]
# name: test_nativeapp_deploy_prune[ws deploy --entity-id=pkg-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.
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.
Deployed successfully.

'''
# ---
Loading

0 comments on commit 550c3cf

Please sign in to comment.