diff --git a/src/snowflake/cli/_plugins/nativeapp/application_entity.py b/src/snowflake/cli/_plugins/nativeapp/application_entity.py index bfe4e91f5..5864dfb58 100644 --- a/src/snowflake/cli/_plugins/nativeapp/application_entity.py +++ b/src/snowflake/cli/_plugins/nativeapp/application_entity.py @@ -107,9 +107,9 @@ def action_deploy( app_name = model.fqn.identifier debug_mode = model.debug if model.meta: - app_role = getattr(model.meta, "role", ctx.default_role) - app_warehouse = getattr(model.meta, "warehouse", ctx.default_warehouse) - post_deploy_hooks = getattr(model.meta, "post_deploy", None) + app_role = model.meta.role or ctx.default_role + app_warehouse = model.meta.warehouse or ctx.default_warehouse + post_deploy_hooks = model.meta.post_deploy else: app_role = ctx.default_role app_warehouse = ctx.default_warehouse diff --git a/tests_integration/nativeapp/test_post_deploy.py b/tests_integration/nativeapp/test_post_deploy.py index ee9fe6f81..bf86b080b 100644 --- a/tests_integration/nativeapp/test_post_deploy.py +++ b/tests_integration/nativeapp/test_post_deploy.py @@ -14,8 +14,13 @@ def run(runner, base_command, args): - # TODO Run "ws deploy --entity-id=app" once ApplicationEntity deploy is implemented - result = runner.invoke_with_connection_json(["app", "run"] + args) + if base_command == "ws": + result = runner.invoke_with_connection_json( + ["ws", "deploy", "--entity-id", "app"] + args + ) + else: + result = runner.invoke_with_connection_json(["app", "run"] + args) + assert result.exit_code == 0 @@ -92,6 +97,12 @@ def test_nativeapp_post_deploy( is_versioned, with_project_flag, ): + + if base_command == "ws" and is_versioned: + pytest.skip( + "TODO: ws commands do not support deploying applications from versions yet" + ) + version = "v1" project_name = "myapp" app_name = f"{project_name}_{default_username}{resource_suffix}"