-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Basic solution SNOW-1636849 Auto-teardown Native App in integration tests (#1478) Changes `with project_directory()` to `with nativeapp_project_directory()`, which automatically runs `snow app teardown` before exiting the project. This allows us to remove the `try`/`finally` in most tests. For tests that were using `with pushd(test_project)`, this has been changed to `with nativeapp_teardown()`, which is what `with nativeapp_project_directory()` uses under the hood. SNOW-1621834 Cast version to identifier when creating/dropping app versions (#1475) When running `snow app version create` and `snow app version drop`, wrap the version in `to_identifier()` so users don't have to specify the quotes around version names that aren't valid identifiers. If the name is already quoted, `to_identifier()` doesn't do anything. Added tests Added tests * Added tests Added tests * Post-review-fixes
- Loading branch information
1 parent
4b30958
commit 9ac000e
Showing
13 changed files
with
281 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
definition_version: '2' | ||
entities: | ||
function1: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
meta: | ||
use_mixins: my_mixin | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
function2: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
stage: bar | ||
type: function | ||
mixins: | ||
my_mixin: | ||
stage: foo |
29 changes: 29 additions & 0 deletions
29
tests/test_data/projects/mixins_defaults_hierarchy/snowflake.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
definition_version: '2' | ||
entities: | ||
function1: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
meta: | ||
use_mixins: my_mixin | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
function2: | ||
artifacts: | ||
- src | ||
handler: app.hello2 | ||
identifier: name | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
defaults: | ||
stage: baz | ||
mixins: | ||
my_mixin: | ||
stage: foo |
5 changes: 5 additions & 0 deletions
5
tests/test_data/projects/mixins_different_entities/environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: sf_env | ||
channels: | ||
- snowflake | ||
dependencies: | ||
- pandas |
3 changes: 3 additions & 0 deletions
3
tests/test_data/projects/mixins_different_entities/pages/my_page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import streamlit as st | ||
|
||
st.title("Example page") |
45 changes: 45 additions & 0 deletions
45
tests/test_data/projects/mixins_different_entities/snowflake.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
definition_version: '2' | ||
entities: | ||
function1: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
meta: | ||
use_mixins: my_mixin | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
function2: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
streamlit1: | ||
artifacts: | ||
- streamlit_app.py | ||
- environment.yml | ||
- pages | ||
identifier: | ||
name: test_streamlit | ||
pages_dir: non_existent_dir | ||
query_warehouse: test_warehouse | ||
stage: streamlit | ||
title: My Fancy Streamlit | ||
type: streamlit | ||
meta: | ||
use_mixins: my_mixin | ||
defaults: | ||
stage: baz | ||
mixins: | ||
my_mixin: | ||
stage: foo | ||
main_file: streamlit_app.py | ||
pages_dir: pages |
Empty file.
5 changes: 5 additions & 0 deletions
5
tests/test_data/projects/mixins_list_applied_in_order/environment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: sf_env | ||
channels: | ||
- snowflake | ||
dependencies: | ||
- pandas |
3 changes: 3 additions & 0 deletions
3
tests/test_data/projects/mixins_list_applied_in_order/pages/my_page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import streamlit as st | ||
|
||
st.title("Example page") |
58 changes: 58 additions & 0 deletions
58
tests/test_data/projects/mixins_list_applied_in_order/snowflake.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
definition_version: '2' | ||
entities: | ||
function1: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
meta: | ||
use_mixins: | ||
- second_mixin | ||
- first_mixin | ||
returns: string | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
function2: | ||
artifacts: | ||
- src | ||
handler: app.hello | ||
identifier: name | ||
returns: string | ||
meta: | ||
use_mixins: | ||
- third_mixin | ||
signature: | ||
- name: name | ||
type: string | ||
type: function | ||
streamlit1: | ||
artifacts: | ||
- streamlit_app.py | ||
- environment.yml | ||
- pages | ||
identifier: | ||
name: test_streamlit | ||
pages_dir: non_existent_dir | ||
query_warehouse: test_warehouse | ||
stage: streamlit | ||
title: My Fancy Streamlit | ||
type: streamlit | ||
meta: | ||
use_mixins: | ||
- first_mixin | ||
- second_mixin | ||
mixins: | ||
first_mixin: | ||
stage: foo | ||
main_file: streamlit_app.py | ||
pages_dir: non_existent_pages_dir | ||
second_mixin: | ||
stage: bar | ||
main_file: streamlit_app.py | ||
pages_dir: pages | ||
third_mixin: | ||
stage: baz | ||
main_file: streamlit_app.py | ||
pages_dir: pages |
Empty file.