Skip to content

Commit

Permalink
Add v2 tests (#1887)
Browse files Browse the repository at this point in the history
* Test_function

* Test Procedure

* Test streamlit

* Fixes

* Fixup
  • Loading branch information
sfc-gh-jsikorski authored Dec 4, 2024
1 parent 6475e23 commit e9783ef
Show file tree
Hide file tree
Showing 49 changed files with 1,181 additions and 98 deletions.
69 changes: 65 additions & 4 deletions tests/snowpark/__snapshots__/test_function.ambr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_deploy_function_fully_qualified_name[ok]
# name: test_deploy_function_fully_qualified_name[snowpark_function_fully_qualified_name-snowpark.functions.5.name][ok]
'''
Performing initial validation
Checking remote state
Expand Down Expand Up @@ -28,7 +28,36 @@

'''
# ---
# name: test_deploy_function_fully_qualified_name_duplicated_database[database error]
# name: test_deploy_function_fully_qualified_name[snowpark_function_fully_qualified_name_v2-entities.custom_database_custom_schema_fqn_function_error.identifier.name][ok]
'''
Performing initial validation
Checking remote state
Preparing required stages and artifacts
Creating (if not exists) stage: dev_deployment
Uploading app.zip to @MockDatabase.MockSchema.dev_deployment/my_snowpark_project/
Creating Snowpark entities
Creating function custom_database.custom_schema.fqn_function3
Creating function custom_db.custom_schema.fqn_function
Creating function custom_db.custom_schema.database_function
Creating function custom_schema.fqn_function_only_schema
Creating function custom_db.PUBLIC.database_function
Creating function custom_schema.schema_function
+------------------------------------------------------------------------------+
| object | type | status |
|---------------------------------------------------------+----------+---------|
| custom_database.custom_schema.fqn_function3(name | function | created |
| string) | | |
| custom_db.custom_schema.fqn_function(name string) | function | created |
| custom_db.custom_schema.database_function(name string) | function | created |
| MockDatabase.custom_schema.fqn_function_only_schema(nam | function | created |
| e string) | | |
| custom_db.MockSchema.database_function(name string) | function | created |
| MockDatabase.custom_schema.schema_function(name string) | function | created |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_function_fully_qualified_name_duplicated_database[snowpark_function_fully_qualified_name][database error]
'''
Performing initial validation
Checking remote state
Expand All @@ -39,7 +68,29 @@

'''
# ---
# name: test_deploy_function_fully_qualified_name_duplicated_schema[schema error]
# name: test_deploy_function_fully_qualified_name_duplicated_database[snowpark_function_fully_qualified_name_v2][database error]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Database provided but name |
| 'custom_database.custom_schema.fqn_function_error' is fully qualified name. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_function_fully_qualified_name_duplicated_schema[snowpark_function_fully_qualified_name-snowpark.functions.5.name][schema error]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Schema provided but name 'custom_schema.fqn_function_error' is fully |
| qualified name. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_function_fully_qualified_name_duplicated_schema[snowpark_function_fully_qualified_name_v2-entities.custom_database_custom_schema_fqn_function_error.identifier.name][schema error]
'''
Performing initial validation
Checking remote state
Expand All @@ -50,7 +101,17 @@

'''
# ---
# name: test_deploy_function_secrets_without_external_access
# name: test_deploy_function_secrets_without_external_access[snowpark_function_secrets_without_external_access]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| func1 defined with secrets but without external integration. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_function_secrets_without_external_access[snowpark_function_secrets_without_external_access_v2]
'''
Performing initial validation
Checking remote state
Expand Down
65 changes: 60 additions & 5 deletions tests/snowpark/__snapshots__/test_procedure.ambr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_deploy_procedure_fails_if_integration_does_not_exists
# name: test_deploy_procedure_fails_if_integration_does_not_exists[snowpark_procedure_external_access]
'''
Performing initial validation
Checking remote state
Expand All @@ -10,7 +10,18 @@

'''
# ---
# name: test_deploy_procedure_fails_if_object_exists_and_no_replace
# name: test_deploy_procedure_fails_if_integration_does_not_exists[snowpark_procedure_external_access_v2]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Following external access integration does not exists in Snowflake: |
| external_2 |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_procedure_fails_if_object_exists_and_no_replace[snowpark_procedures]
'''
Performing initial validation
Checking remote state
Expand All @@ -22,7 +33,30 @@

'''
# ---
# name: test_deploy_procedure_fully_qualified_name[database error]
# name: test_deploy_procedure_fails_if_object_exists_and_no_replace[snowpark_procedures_v2]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Following objects already exists. Consider using --replace. |
| procedure: procedureName |
| procedure: test |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_procedure_fully_qualified_name[snowpark_procedure_fully_qualified_name][database error]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Database provided but name |
| 'custom_database.custom_schema.fqn_procedure_error' is fully qualified name. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_procedure_fully_qualified_name[snowpark_procedure_fully_qualified_name_v2][database error]
'''
Performing initial validation
Checking remote state
Expand All @@ -33,7 +67,7 @@

'''
# ---
# name: test_deploy_procedure_fully_qualified_name_duplicated_schema[schema error]
# name: test_deploy_procedure_fully_qualified_name_duplicated_schema[snowpark_procedure_fully_qualified_name-snowpark.procedures.5.name][schema error]
'''
Performing initial validation
Checking remote state
Expand All @@ -44,7 +78,28 @@

'''
# ---
# name: test_deploy_procedure_secrets_without_external_access
# name: test_deploy_procedure_fully_qualified_name_duplicated_schema[snowpark_procedure_fully_qualified_name_v2-entities.custom_database_custom_schema_fqn_procedure_error.identifier.name][schema error]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| Schema provided but name 'custom_schema.fqn_procedure_error' is fully |
| qualified name. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_procedure_secrets_without_external_access[snowpark_procedure_secrets_without_external_access]
'''
Performing initial validation
Checking remote state
+- Error ----------------------------------------------------------------------+
| procedureName defined with secrets but without external integration. |
+------------------------------------------------------------------------------+

'''
# ---
# name: test_deploy_procedure_secrets_without_external_access[snowpark_procedure_secrets_without_external_access_v2]
'''
Performing initial validation
Checking remote state
Expand Down
Loading

0 comments on commit e9783ef

Please sign in to comment.