-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create and document performance tests
- Loading branch information
1 parent
66f10f0
commit fd1ab4f
Showing
2 changed files
with
77 additions
and
46 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
48 changes: 48 additions & 0 deletions
48
tests/performance/list_relations_tests/test_show_objects.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,48 @@ | ||
from datetime import timedelta | ||
|
||
import pytest | ||
|
||
from tests.performance.list_relations_tests.list_relations import BaseConfig, Scenario | ||
|
||
|
||
SHOW_OBJECTS_MACRO = """ | ||
{% macro snowflake__get_show_objects_sql(schema, results_per_iteration) %} | ||
show objects in {{ schema.database }}.{{ schema.schema }} limit {{ results_per_iteration }} | ||
{% endmacro %} | ||
""" | ||
|
||
|
||
class ShowObjects(BaseConfig): | ||
@pytest.fixture(scope="class") | ||
def macros(self): | ||
yield {"snowflake__get_show_objects_sql.sql": SHOW_OBJECTS_MACRO} | ||
|
||
|
||
class TestShowObjects10View10Table10Dynamic(ShowObjects): | ||
scenario = Scenario(10, 10, 10) | ||
expected_duration = timedelta(seconds=0, microseconds=920_000).total_seconds() | ||
|
||
|
||
class TestShowObjects15View15Table0Dynamic(ShowObjects): | ||
scenario = Scenario(15, 15, 0) | ||
expected_duration = timedelta(seconds=0, microseconds=920_000).total_seconds() | ||
|
||
|
||
class TestShowObjects100View100Table100Dynamic(ShowObjects): | ||
scenario = Scenario(100, 100, 100) | ||
expected_duration = timedelta(seconds=1, microseconds=370_000).total_seconds() | ||
|
||
|
||
class TestShowObjects150View150Table0Dynamic(ShowObjects): | ||
scenario = Scenario(150, 150, 0) | ||
expected_duration = timedelta(seconds=1, microseconds=370_000).total_seconds() | ||
|
||
|
||
class TestShowObjects1000View1000Table1000Dynamic(ShowObjects): | ||
scenario = Scenario(1000, 1000, 1000) | ||
expected_duration = timedelta(seconds=3, microseconds=400_000).total_seconds() | ||
|
||
|
||
class TestShowObjects1500View1500Table0Dynamic(ShowObjects): | ||
scenario = Scenario(1500, 1500, 0) | ||
expected_duration = timedelta(seconds=3, microseconds=400_000).total_seconds() |